Commit Graph
24 Commits
Author SHA1 Message Date
Wei Yongjun 4fa99230ea isp1704_charger: remove useless check in isp1704_charger_probe()
Neither devm_usb_get_phy_by_phandle() nor devm_usb_get_phy() can
return a NULL result, so remove the useless !isp->phy check.

Signed-off-by: Wei Yongjun <[email protected]>
2014-01-25 15:24:15 +04:00
Sebastian Reichel 34a109610e isp1704_charger: Add DT support
This patch introduces device tree support to the isp1704 charger driver.
Adding support involved moving the handling of the enable GPIO from board
code into the driver.

Signed-off-by: Sebastian Reichel <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2013-12-23 18:34:58 -08:00
Pali Rohár f07c11ea32 isp1704_charger: Fix driver to work with changes introduced in v3.5
* omap musb driver does not report USB_EVENT_ENUMERATED event anymore
* omap musb driver reporting USB_EVENT_VBUS when charger is connected
* read last event from phy->last_event (instead from ulpi register)
* do not call wall charger detection more times

Signed-off-by: Pali Rohár <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2013-10-22 13:57:16 -07:00
Jingoo Han 2a2ce52a40 isp1704_charger: Use devm_kzalloc()
Use devm_kzalloc() to make cleanup paths more simple.

Signed-off-by: Jingoo Han <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2013-03-31 23:25:40 -07:00
Bill Pemberton 415ec69fb1 power: remove use of __devexit
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <[email protected]>
Cc: Anton Vorontsov <[email protected]>
Cc: David Woodhouse <[email protected]>
Acked-by: Mark Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-28 11:43:22 -08:00
Bill Pemberton c8afa6406e power: remove use of __devinit
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <[email protected]>
Cc: Anton Vorontsov <[email protected]>
Cc: David Woodhouse <[email protected]>
Acked-by: Mark Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-28 11:43:22 -08:00
Bill Pemberton 28ea73f4c6 power: remove use of __devexit_p
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <[email protected]>
Cc: Anton Vorontsov <[email protected]>
Cc: David Woodhouse <[email protected]>
Acked-by: Mark Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-11-28 11:43:22 -08:00
Kishon Vijay Abraham I ded017ee6c usb: phy: fix return value check of usb_get_phy
usb_get_phy will return -ENODEV if it's not able to find the phy. Hence
fixed all the callers of usb_get_phy to check for this error condition
instead of relying on a non-zero value as success condition.

Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
2012-07-02 10:40:49 +03:00
Kishon Vijay Abraham I 662dca54ca usb: otg: support for multiple transceivers by a single controller
Add a linked list for keeping multiple PHY instances with different
types so that we can have separate USB2 and USB3 PHYs on one single
board. _get_phy_ has been changed so that the controller gets
the transceiver by type. _remove_phy_ has been added to let the phy
be removed from the phy list.

Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
2012-06-25 14:05:35 +03:00
Kishon Vijay Abraham I 721002ec1d usb: otg: utils: rename function name in OTG utils
_transceiver() in otg.c is replaced with _phy. usb_set_transceiver is
replaced with usb_add_phy to make it similar to other usb standard
function names like usb_add_hcd.

Signed-off-by: Kishon Vijay Abraham I <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
2012-06-25 14:04:26 +03:00
Dan Carpenter 81a08382ae isp1704_charger: Use after free on probe error
We can't use "isp" after freeing it.

Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Felipe Contreras <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2012-05-05 20:02:35 -07:00
Linus Torvalds 919c840167 Merge tag 'for-v3.4-rc1' of git://git.infradead.org/battery-2.6
Pull battery updates from Anton Vorontsov:
 "Various small bugfixes and enhancements, plus two new drivers:
   - A quite complex ab8500 charger driver, submitted by Arun Murthy @
     ST-Ericsson;
   - Summit Microelectronics SMB347 Battery Charger, submitted by Bruce
     E Robertson and Alan Cox @ Intel.

  And that's all."

* tag 'for-v3.4-rc1' of git://git.infradead.org/battery-2.6: (36 commits)
  max17042_battery: Clean up interrupt handling
  Revert "max8998_charger: Include linux/module.h just once"
  ab8500_fg: Fix some build warnings on x86_64
  max17042_battery: Fix CHARGE_FULL representation.
  max8998_charger: Include linux/module.h just once
  power_supply: Convert i2c drivers to module_i2c_driver
  lp8727_charger: Add MODULE_DEVICE_TABLE
  charger-manager: Simplify charger_get_property(), get rid of a warning
  charger-manager: Clean up for better readability
  da9052-battery: Convert to use module_platform_driver
  da9052-battery: Fix a memory leak when unload the module
  da9052-battery: Add missing platform_set_drvdata
  ab8500: Turn unneeded global symbols into local ones
  ab8500_fg: Fix copy-paste error
  ab8500_fg: Get rid of 'struct battery_type'
  ab8500_fg: Get rid of 'struct v_to_cap'
  ab8500_btemp: Get rid of 'enum adc_therm'
  ab8500_charger: Convert to the new USB OTG calls
  ab8500-btemp: AB8500 battery temperature driver
  ab8500-fg: A8500 fuel gauge driver
  ...
2012-03-30 16:09:02 -07:00
Felipe Contreras d2c0077c54 isp1704_charger: Fix probe error path
We enable power, but don't disable it in case of an error.

Signed-off-by: Felipe Contreras <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2012-03-26 20:41:00 +04:00
Heikki Krogerus b1c711d629 usb: otg: mv_otg: Start using struct usb_otg
Use struct usb_otg members with OTG specific functions instead
of usb_phy members.

[ [email protected] : fixed a compile error on isp1704_charger.c ]

Signed-off-by: Heikki Krogerus <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
Acked-by: Neil Zhang <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
2012-02-27 15:41:22 +02:00
Heikki Krogerus fcc8ebc990 power_supply: Convert all users to new usb_phy
Use the new usb_phy_* functions instead of the old
otg_* ones.

Signed-off-by: Heikki Krogerus <[email protected]>
Acked-by: Anton Vorontsov <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
2012-02-13 13:53:21 +02:00
Heikki Krogerus 8675381109 usb: otg: Rename otg_transceiver to usb_phy
This is the first step in separating USB transceivers from
USB OTG utilities.

Includes fixes to IMX code from Sascha Hauer.

Signed-off-by: Heikki Krogerus <[email protected]>
Acked-by: Sascha Hauer <[email protected]>
Acked-by: Pavankumar Kondeti <[email protected]>
Acked-by: Li Yang <[email protected]>
Acked-by: Alan Stern <[email protected]>
Acked-by: Igor Grinberg <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
2012-02-13 13:34:36 +02:00
Felipe Contreras c934502db7 isp1704_charger: Fix missing check
A segfault happens if there's no board information.

Signed-off-by: Felipe Contreras <[email protected]>
Acked-by: Heikki Krogerus <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2012-01-06 06:01:58 +04:00
Axel Lin 300bac7fb8 power_supply: Convert drivers/power/* to use module_platform_driver()
This patch converts the drivers in drivers/power/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Mike Rapoport <[email protected]>
Cc: Lars-Peter Clausen <[email protected]>
Cc: Nithish Mahalingam <[email protected]>
Cc: MyungJoo Ham <[email protected]>
Cc: Haojian Zhuang <[email protected]>
Cc: Balaji Rao <[email protected]>
Cc: Mark Brown <[email protected]>
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Clifton Barnes <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2012-01-04 09:12:07 +04:00
Kalle Jokiniemi 2785cefc98 isp1704_charger: Allow board specific powering routine
The ISP1704/1707 chip can be put to full power down
state by asserting the CHIP_SEL line. This patch enables
platform or board specific hooks to put the device into
power down mode in case not needed.

This patch is a preparation for enabling this powering
routine in n900 (rx-51) devices.

Thanks to Heikki Krogerus for helping out with the patch.

Signed-off-by: Kalle Jokiniemi <[email protected]>
Acked-By: Heikki Krogerus <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2011-04-20 17:48:49 +04:00
Heikki Krogerus e1a85694e0 isp1704_charger: Detect charger after probe
If the device is booted up with cable connected, or the
module is loaded after plugging in the cable, the
notification has come and gone, so not relying on it at
probe time. Instead this checks the VBUS level manually
after probe.

Signed-off-by: Heikki Krogerus <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2010-11-18 16:56:21 +03:00
Heikki Krogerus a4607d9f5c isp1704_charger: Set isp->dev before anything needs it
isp1704_test_ulpi() is the first place that needs isp->dev
member, so it must be set before calling the function.

Signed-off-by: Heikki Krogerus <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2010-11-18 16:56:20 +03:00
Heikki Krogerus bac43b2050 isp1704_charger: Detect HUB/Host chargers
To avoid breaking high speed chirp handshaking with CDP
chargers, no more then 500mA should be drawn. To make sure
of this, utilizing current_max property. After the device
has enumerated, it's safe to draw the maximum 1800mA as
defined in the Battery Charging Specification. This can be
also used with normal USB connection if the controller sends
ENUMERATED notification with the milliamps as data.

From now on the online property indicates VBUS, present
property if there is a charger and current_max the milliamps
possible to draw from VBUS.

Signed-off-by: Heikki Krogerus <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2010-11-18 16:56:19 +03:00
Ameya Palande 746d8fb8c6 isp1704_charger: Correct length for storing model
Model should have room to accommodate the trailing null byte,
"isp170[4|7]\0".

Signed-off-by: Ameya Palande <[email protected]>
Acked-by: Heikki Krogerus <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2010-11-18 16:56:18 +03:00
Heikki Krogerus ec46475f3e power_supply: Add isp1704 charger detection driver
NXP ISP1704 is Battery Charging Specification 1.0 compliant USB
transceiver. This adds a power supply driver for ISP1704 and
ISP1707 USB transceivers.

Signed-off-by: Heikki Krogerus <[email protected]>
Signed-off-by: Anton Vorontsov <[email protected]>
2010-08-19 16:25:20 +04:00