Commit Graph

17 Commits

Author SHA1 Message Date
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 <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
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 <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
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 <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
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 <dan.carpenter@oracle.com>
Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-05-05 20:02:35 -07:00
Linus Torvalds 919c840167 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.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQIcBAABAgAGBQJPdhj7AAoJEGgI9fZJve1bSKEQAKzKXPwqpBREXzS888YWzb34
 0r3Bly+F8eSRTjclbEEvEOVVCjxKOFpow5lN+eAkRNAMLDBcMamfBTR+rpoYb822
 d7R4Hy/stVnmD5nul0WMezZ0OZf6qRy8kHazmvb63Jk37ykof52TqoEInKdHL/ww
 afUNfCnAFAbZkjxEr/9MwpM+nzYKdlGIoQlu9CJLARJiT9CyICjgHG48MGmyxOws
 1LPha40jXuKLoyE+6nvG1Ji71NzZlFaVuFpzk75kjsWoB78zkRsMSv+zboHRz3QP
 PI+uS54auIkGhqeIeEuuSzPZx+1K2Fr2/qyut3tqM8AejBE4kETiBAy0b0BREBSd
 NqA4/Yw24c8xglIFP6OlNjHnLgCsExfHATzqzML2El/dXG8P2ggEayZzDh9bmsuU
 ZNKOmHZYgEj2eEorJcmlfZ23rJwlxuspl1m2nH2WEnqw6Z6TnskK4N1JSNlpGRPU
 j+iHbTPA04hultQkzNHCdPRR/jK1IC5eGdwc612QgxOhZPkvhmW92e8EOVz/3E3X
 TqKXfBiKxKtkIncLPYFh7oeZINKnlqZrXsYrHhxhlm9UstGOqfEIqbCGqlf0Q4P1
 WOhIQe1cP/JpB9T58e3mLF2dQIGScTqzQCRSW6/m+3HmDwZb8JyUQRw5188s3yJr
 umrBS5hqS+z3bISWrcGi
 =Y8fe
 -----END PGP SIGNATURE-----

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 <felipe.contreras@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
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.

[ balbi@ti.com : fixed a compile error on isp1704_charger.c ]

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
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 <heikki.krogerus@linux.intel.com>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
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 <heikki.krogerus@linux.intel.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
Acked-by: Li Yang <leoli@freescale.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
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 <felipe.contreras@gmail.com>
Acked-by: Heikki Krogerus <krohei@gmail.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
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 <mike@compulab.co.il>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Nithish Mahalingam <nithish.mahalingam@intel.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Haojian Zhuang <haojian.zhuang@marvell.com>
Cc: Balaji Rao <balajirrao@openmoko.org>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Clifton Barnes <cabarnes@indesign-llc.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
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 <kalle.jokiniemi@nokia.com>
Acked-By: Heikki Krogerus <heikki.krogerus@nokia.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
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 <heikki.krogerus@nokia.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
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 <heikki.krogerus@nokia.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
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 <heikki.krogerus@nokia.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
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 <ameya.palande@nokia.com>
Acked-by: Heikki Krogerus <heikki.krogerus@nokia.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
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 <ext-heikki.krogerus@nokia.com>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2010-08-19 16:25:20 +04:00