summaryrefslogtreecommitdiffstats
path: root/drivers/power/rt9455_charger.c
Commit message (Collapse)AuthorAgeFilesLines
* power: Remove unnecessary MODULE_ALIAS() for I2C driversJavier Martinez Canillas2015-09-221-1/+0
| | | | | | | | | These drivers already have an I2C device id table that is used to create module aliases and the used MODULE_ALIAS() was either already in the I2C table so it was redundant or wasn't a valid I2C id so it was never used. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* power_supply: rt9455_charger: Properly notify userspace about charging eventsAnda-Maria Nicolae2015-07-091-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Charging events this patch refers to are: - charger is connected to/disconnected from the power source - battery is reconnected to the charger, after it was absent. When the charger is connected to/disconnected from the power source, CHRVPI interrupt occurs and PWR_RDY bit is either set or cleared. PWR_RDY bit is updated after 1-2 seconds CHRVPI interrupt has occurred. power_supply_changed() should be called after PWR_RDY bit is updated. /sys/class/power_supply/rt9455-charger/online file displays the value of PWR_RDY bit. This way, if the userspace is notified that a charging event has occurred and the userspace reads /sys/class/power_supply/rt9455-charger/online file, this file is properly updated when the userspace reads it. This is the reason why power_supply_changed() is called in rt9455_pwr_rdy_work_callback(), instead of being called in interrupt handler. Since no interrupt is triggered when the battery is reconnected to the charger, the userspace is never notified that the battery is reconnected. This is why power_supply_changed() is called in rt9455_max_charging_time_work_callback(), so that the userspace is notified that the battery is reconnected. Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* power_supply: rt9455_charger: Fix error reported by static analysis toolAnda-Maria Nicolae2015-06-131-3/+0
| | | | | | | | The result of container_of macro cannot be NULL, so there is no need to check whether info is NULL. Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* power_supply: rt9455_charger: Check if CONFIG_USB_PHY is enabledAnda-Maria Nicolae2015-06-031-0/+4
| | | | | | | | | | | | | | If CONFIG_USB_PHY is not enabled, struct notifier_block is not defined and compilation fails. Therefore, the functions that process USB event notifications are defined only if CONFIG_USB_PHY is enabled. There is no need to define these functions if CONFIG_USB_PHY is not enabled, since no USB notifications are received in this case. Also, since rt9455_set_boost_voltage_before_boost_mode() function is called only if USB_EVENT_ID notification is received, this function should also be defined only if CONFIG_USB_PHY is enabled. Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* power_supply: Add support for Richtek RT9455 battery chargerAnda-Maria Nicolae2015-05-301-0/+1751
Based on the datasheet found here: http://www.richtek.com/download_ds.jsp?p=RT9455 Signed-off-by: Anda-Maria Nicolae <anda-maria.nicolae@intel.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>