From d7c68494954aed1042b63492698793fc10072ae3 Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Mon, 7 Feb 2022 22:28:31 +0100 Subject: [PATCH] add present node. This makes gkrellm (and possibly other tools) find the battery. Signed-off-by: Jos Dehaes --- drivers/power/supply/macsmc_power.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/power/supply/macsmc_power.c b/drivers/power/supply/macsmc_power.c index 90d325d6a1295d..9f92aa8a666457 100644 --- a/drivers/power/supply/macsmc_power.c +++ b/drivers/power/supply/macsmc_power.c @@ -147,6 +147,9 @@ static int macsmc_battery_get_property(struct power_supply *psy, case POWER_SUPPLY_PROP_SERIAL_NUMBER: val->strval = power->serial_number; break; + case POWER_SUPPLY_PROP_PRESENT: + val->intval = 1; + break; default: return -EINVAL; } @@ -176,6 +179,7 @@ static enum power_supply_property macsmc_battery_props[] = { POWER_SUPPLY_PROP_HEALTH, POWER_SUPPLY_PROP_MODEL_NAME, POWER_SUPPLY_PROP_SERIAL_NUMBER, + POWER_SUPPLY_PROP_PRESENT, }; static const struct power_supply_desc macsmc_battery_desc = {