Commit Graph

5 Commits

Author SHA1 Message Date
Mika Westerberg d72bade76d smb347-charger: Move IRQ enabling to the end of probe
There is a potential problem if we call smb347_irq_enable() from
smb347_irq_init() because smb347_irq_enable() makes the device registers
read-only once it returns and smb347_irq_init() expects them to still be
read-write. Currently no harm happens because it is the last call we make
in smb347_irq_init().

Anyway a better place for enabling IRQs is at the end of probe function
and this is also symmetric to call smb347_irq_disable() which is done at
the beginning of remove function.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05 05:35:47 -07:00
Mika Westerberg 055d7f0f29 smb347-charger: Rename few functions to match better what they are doing
The naming used in the driver for some functions is not very clear what
the functions are really doing. To make this a bit easier to understand
we rename few functions which were badly named.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05 05:35:22 -07:00
Mika Westerberg b75ef1d807 smb347-charger: Convert to use module_i2c_driver()
This reduces the amount of boilerplate code in the driver and
makes it a bit simpler.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05 05:34:56 -07:00
Ramakrishna Pallala e6fe3597fa smb347_charger: Cleanup power supply registration code in probe
This patch checks if the usb or mains charging is enabled by the
platform before registering with the power supply class.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05 05:29:00 -07:00
Bruce E. Robertson ed1a230f96 Add I2C driver for Summit Microelectronics SMB347 Battery Charger.
Driver support for the Summit I²C battery charger. This is used in some
Intel devices.

Signed-off-by: Bruce E. Robertson <bruce.e.robertson@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-03-26 20:41:01 +04:00