Lines Matching +full:pmic +full:- +full:specific
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * acpi_ac.c - ACPI AC Adapter Driver ($Revision: 27 $)
54 /* Lists of PMIC ACPI HIDs with an (often better) native charger driver */
56 { "INT33F4", -1 }, /* X-Powers AXP288 PMIC */
57 { "INT34D3", 3 }, /* Intel Cherrytrail Whiskey Cove PMIC */
91 /* --------------------------------------------------------------------------
93 -------------------------------------------------------------------------- */
100 return -EINVAL; in acpi_ac_get_state()
102 status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, in acpi_ac_get_state()
103 &ac->state); in acpi_ac_get_state()
107 ac->state = ACPI_AC_STATUS_UNKNOWN; in acpi_ac_get_state()
108 return -ENODEV; in acpi_ac_get_state()
114 /* --------------------------------------------------------------------------
116 -------------------------------------------------------------------------- */
124 return -ENODEV; in get_ac_property()
127 return -ENODEV; in get_ac_property()
131 val->intval = ac->state; in get_ac_property()
134 return -EINVAL; in get_ac_property()
143 /* --------------------------------------------------------------------------
145 -------------------------------------------------------------------------- */
164 * a specific time before doing actual operations in the in acpi_ac_notify()
167 * specific time for the EC event handler to make progress. in acpi_ac_notify()
173 acpi_bus_generate_netlink_event(device->pnp.device_class, in acpi_ac_notify()
174 dev_name(&device->dev), event, in acpi_ac_notify()
175 (u32) ac->state); in acpi_ac_notify()
176 acpi_notifier_call_chain(device, event, (u32) ac->state); in acpi_ac_notify()
177 kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE); in acpi_ac_notify()
190 * On HP Pavilion dv6-6179er AC status notifications aren't triggered in acpi_ac_battery_notify()
193 * discharging. Re-reading AC status triggers lost AC notifications, in acpi_ac_battery_notify()
196 if (strcmp(event->device_class, ACPI_BATTERY_CLASS) == 0 && in acpi_ac_battery_notify()
197 event->type == ACPI_BATTERY_NOTIFY_STATUS) in acpi_ac_battery_notify()
218 /* ECS EF20EA, AXP288 PMIC but uses separate fuel-gauge */
225 /* Lenovo Ideapad Miix 320, AXP288 PMIC, separate fuel-gauge */
230 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo MIIX 320-10ICR"),
252 return -EINVAL; in acpi_ac_add()
256 return -ENOMEM; in acpi_ac_add()
258 ac->device = device; in acpi_ac_add()
261 device->driver_data = ac; in acpi_ac_add()
269 ac->charger_desc.name = acpi_device_bid(device); in acpi_ac_add()
270 ac->charger_desc.type = POWER_SUPPLY_TYPE_MAINS; in acpi_ac_add()
271 ac->charger_desc.properties = ac_props; in acpi_ac_add()
272 ac->charger_desc.num_properties = ARRAY_SIZE(ac_props); in acpi_ac_add()
273 ac->charger_desc.get_property = get_ac_property; in acpi_ac_add()
274 ac->charger = power_supply_register(&ac->device->dev, in acpi_ac_add()
275 &ac->charger_desc, &psy_cfg); in acpi_ac_add()
276 if (IS_ERR(ac->charger)) { in acpi_ac_add()
277 result = PTR_ERR(ac->charger); in acpi_ac_add()
283 ac->state ? "on-line" : "off-line"); in acpi_ac_add()
285 ac->battery_nb.notifier_call = acpi_ac_battery_notify; in acpi_ac_add()
286 register_acpi_notifier(&ac->battery_nb); in acpi_ac_add()
302 return -EINVAL; in acpi_ac_resume()
306 return -EINVAL; in acpi_ac_resume()
308 old_state = ac->state; in acpi_ac_resume()
311 if (old_state != ac->state) in acpi_ac_resume()
312 kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE); in acpi_ac_resume()
325 return -EINVAL; in acpi_ac_remove()
329 power_supply_unregister(ac->charger); in acpi_ac_remove()
330 unregister_acpi_notifier(&ac->battery_nb); in acpi_ac_remove()
343 return -ENODEV; in acpi_ac_init()
351 pr_info(PREFIX "AC: found native %s PMIC, not loading\n", in acpi_ac_init()
353 return -ENODEV; in acpi_ac_init()
359 return -ENODEV; in acpi_ac_init()