Re: [PATCH 03/13] twl4030_charger: correctly handle -EPROBE_DEFER from devm_usb_get_phy_by_node

2015-08-18 Thread NeilBrown
On Tue, 18 Aug 2015 01:07:58 -0700 Tony Lindgren t...@atomide.com wrote: * NeilBrown n...@brown.name [150729 17:29]: Now that twl4030_bci_probe can safely return -EPROBE_DEFER, do so when devm_usb_get_phy_by_node returns that error. Signed-off-by: NeilBrown n...@brown.name

Re: [PATCH 07/13] twl4030_charger: distinguish between USB current and 'AC' current

2015-08-06 Thread NeilBrown
queued the below patch with Tony's ACK to fix the build issue in next. OK, thanks. I'll try to figure out are more proper approach ... might be a week or so though. Thanks, NeilBrown pgpEQ176T2qUB.pgp Description: OpenPGP digital signature

Re: [PATCH 07/13] twl4030_charger: distinguish between USB current and 'AC' current

2015-08-06 Thread NeilBrown
On Thu, 6 Aug 2015 20:11:16 -0700 Tony Lindgren t...@atomide.com wrote: * NeilBrown n...@brown.name [150729 17:28]: --- a/drivers/power/twl4030_charger.c +++ b/drivers/power/twl4030_charger.c static int twl4030_charger_update_current(struct twl4030_bci *bci) { int status

Re: [Gta04-owner] [PATCH 08/14] twl4030_charger: allow max_current to be managed via sysfs.

2015-07-29 Thread NeilBrown
On Mon, 23 Mar 2015 13:14:50 +0100 jake42 jak...@rommel.stw.uni-erlangen.de wrote: Hello Neil, some suggestions: On 23.03.2015 00:20, NeilBrown wrote: From: NeilBrown ne...@suse.de diff --git a/Documentation/ABI/testing/sysfs-class-power-twl4030 b/Documentation/ABI/testing/sysfs

[PATCH 03/13] twl4030_charger: correctly handle -EPROBE_DEFER from devm_usb_get_phy_by_node

2015-07-29 Thread NeilBrown
Now that twl4030_bci_probe can safely return -EPROBE_DEFER, do so when devm_usb_get_phy_by_node returns that error. Signed-off-by: NeilBrown n...@brown.name --- drivers/power/twl4030_charger.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/power

[PATCH 02/13] twl4030_charger: convert to module_platform_driver instead of ..._probe.

2015-07-29 Thread NeilBrown
-by: NeilBrown n...@brown.name --- drivers/power/twl4030_charger.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c index fe71c61109f5..045238370d3f 100644 --- a/drivers/power/twl4030_charger.c +++ b/drivers

[PATCH 06/13] twl4030_charger: allow fine control of charger current.

2015-07-29 Thread NeilBrown
setting are managed by the driver, but most are left at their default settings. The current drawn is set to 500mA if the allow_usb module parameter is set, and to 100mA otherwise. More fine control will appear in later patches. Acked-by: Pavel Machek pa...@ucw.cz Signed-off-by: NeilBrown n

[PATCH 00/13] Enhance twl4030_charger functionality. - V3

2015-07-29 Thread NeilBrown
, in part because extcon has seen some changes lately which leave me even more confused about how best to use it than before. I need to sort that out before I can resolve the rest of my usb phy patches and then add a few more charger patches. Thanks, NeilBrown --- NeilBrown (12

[PATCH 08/13] twl4030_charger: allow max_current to be managed via sysfs.

2015-07-29 Thread NeilBrown
'max_current' sysfs attributes are created which allow the max to be set. Whenever a current source changes, the default is restored. This will be followed by a uevent, so user-space can decide to update again. Acked-by: Pavel Machek pa...@ucw.cz Signed-off-by: NeilBrown n...@brown.name

[PATCH 04/13] twl4030_charger: trust phy to determine when USB power is available.

2015-07-29 Thread NeilBrown
The usb phy driver already determines when VBUS is available, so repeating the test in the charger driver is pointless duplication. On probe, process the last event from the phy, and from then on, do whatever the phy tells us without double-checking. Signed-off-by: NeilBrown n...@brown.name

[PATCH 09/13] twl4030_charger: enable manual enable/disable of usb charging.

2015-07-29 Thread NeilBrown
Signed-off-by: NeilBrown n...@brown.name --- .../ABI/testing/sysfs-class-power-twl4030 | 11 drivers/power/twl4030_charger.c| 59 2 files changed, 70 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-power-twl4030 b

[PATCH 07/13] twl4030_charger: distinguish between USB current and 'AC' current

2015-07-29 Thread NeilBrown
accordingly. Now we must review the current setting on any interrupt or USB event which might indicate that the charger-source has changed. Acked-by: Pavel Machek pa...@ucw.cz Signed-off-by: NeilBrown n...@brown.name --- drivers/power/twl4030_charger.c | 36 +--- 1

[PATCH 05/13] twl4030_charger: split uA calculation into a function.

2015-07-29 Thread NeilBrown
We will need this calculation in other places, so create functions to map between register value and uA value. Acked-by: Pavel Machek pa...@ucw.cz Signed-off-by: NeilBrown n...@brown.name --- drivers/power/twl4030_charger.c | 48 --- 1 file changed, 35

[PATCH 01/13] twl4030_charger: use runtime_pm to keep usb phy active while charging.

2015-07-29 Thread NeilBrown
it as a current source. So this patch reverts the above commit, and adds the necessary runtime_pm calls. Acked-by: Lee Jones lee.jo...@linaro.org Signed-off-by: NeilBrown n...@brown.name --- drivers/mfd/twl-core.c |9 - drivers/power/twl4030_charger.c | 18

[PATCH 11/13] twl4030_charger: add ac/mode to match usb/mode

2015-07-29 Thread NeilBrown
This allows AC charging to be turned off, much like usb charging. continuous mode is not available though. Acked-by: Pavel Machek pa...@ucw.cz Signed-off-by: NeilBrown n...@brown.name --- .../ABI/testing/sysfs-class-power-twl4030 | 10 ++ drivers/power/twl4030_charger.c

[PATCH 13/13] twl4030_charger: assume a 'charger' can supply maximum current.

2015-07-29 Thread NeilBrown
If it cannot, we will stop pulling more current when voltage drops. Signed-off-by: NeilBrown n...@brown.name --- drivers/power/twl4030_charger.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c index

[PATCH 12/13] twl4030_charger: Increase current carefully while watching voltage.

2015-07-29 Thread NeilBrown
a large value will cause the maximum available to be used - up to the limit of 1.7A imposed by the hardware. Signed-off-by: NeilBrown n...@brown.name --- drivers/power/twl4030_charger.c | 67 --- 1 file changed, 61 insertions(+), 6 deletions(-) diff --git

[PATCH 10/13] twl4030_charger: add software controlled linear charging mode.

2015-07-29 Thread NeilBrown
. It was used with a bike hub dynamo since a year or so. In that case there are automatically charging stops when the cyclist needs a break. Original-by: Andreas Kemnade andr...@kemnade.info Signed-off-by: NeilBrown n...@brown.name --- .../ABI/testing/sysfs-class-power-twl4030 |9 +++ drivers

Re: [PATCH 5/6] phy: twl4030-usb: add support for reading resistor on ID pin.

2015-06-01 Thread NeilBrown
On Mon, 1 Jun 2015 19:06:52 +0530 Kishon Vijay Abraham I kis...@ti.com wrote: Hi, On Thursday 16 April 2015 01:33 PM, NeilBrown wrote: From: NeilBrown ne...@suse.de The twl4030 phy can measure, with low precision, the resistance-to-ground of the ID pin. Add a function to read

Re: [PATCH 4/6] phy: twl4030-usb: add ABI documentation

2015-04-17 Thread NeilBrown
On Sat, 18 Apr 2015 00:14:36 +0200 Pavel Machek pa...@ucw.cz wrote: On Thu 2015-04-16 18:03:04, NeilBrown wrote: From: NeilBrown ne...@suse.de This driver device one local attribute: vbus. Describe that in Documentation/ABI/testing/sysfs-platform/twl4030-usb. Signed-off

[PATCH 2/6] phy: twl4030-usb: remove pointless 'suspended' test in 'suspend' callback.

2015-04-16 Thread NeilBrown
tests. Signed-off-by: NeilBrown n...@brown.name --- drivers/phy/phy-twl4030-usb.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index 3078f80bf520..590c2b1c1a94 100644 --- a/drivers/phy/phy-twl4030-usb.c +++ b/drivers/phy/phy

[PATCH 3/6] phy: twl4030-usb: remove incorrect pm_runtime_get_sync() in probe function.

2015-04-16 Thread NeilBrown
: 96be39ab34b77c6f6f5cd6ae03aac6c6449ee5c4 Signed-off-by: NeilBrown n...@brown.name --- drivers/phy/phy-twl4030-usb.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index 590c2b1c1a94..3a707dd14238 100644 --- a/drivers/phy/phy-twl4030-usb.c +++ b/drivers/phy

[PATCH 1/6] phy: twl4030-usb: make runtime pm more reliable.

2015-04-16 Thread NeilBrown
From: NeilBrown ne...@suse.de A construct like: if (pm_runtime_suspended(twl-dev)) pm_runtime_get_sync(twl-dev); is against the spirit of the runtime_pm interface as it makes the internal refcounting useless. In this case it is also racy, particularly as 'put_autosuspend

[PATCH 5/6] phy: twl4030-usb: add support for reading resistor on ID pin.

2015-04-16 Thread NeilBrown
From: NeilBrown ne...@suse.de The twl4030 phy can measure, with low precision, the resistance-to-ground of the ID pin. Add a function to read the value, and export the result via sysfs. If the read fails, which it does sometimes, try again in 50msec. Acked-by: Pavel Machek pa...@ucw.cz Signed

[PATCH 6/6] phy: twl4030-usb: add extcon to report cable connections.

2015-04-16 Thread NeilBrown
From: NeilBrown ne...@suse.de Signed-off-by: NeilBrown ne...@suse.de --- drivers/phy/phy-twl4030-usb.c | 67 + 1 file changed, 67 insertions(+) diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index 1d6f3e70193e..c42153d43ec2

[PATCH 0/6] Enhancements to twl4030 phy to support better charging.

2015-04-16 Thread NeilBrown
: phy: twl4030-usb: remove incorrect pm_runtime_get_sync() in probe function. Fixes a bug which causes the usb phy to remain permanently powered on, hence the Cc to Tony. If these could be queued for some future merge window, I would really appreciate it. Thanks, NeilBrown --- NeilBrown

[PATCH 4/6] phy: twl4030-usb: add ABI documentation

2015-04-16 Thread NeilBrown
From: NeilBrown ne...@suse.de This driver device one local attribute: vbus. Describe that in Documentation/ABI/testing/sysfs-platform/twl4030-usb. Signed-off-by: NeilBrown n...@brown.name --- .../ABI/testing/sysfs-platform-twl4030-usb |8 1 file changed, 8 insertions

Re: [PATCH 13/14] twl4030_charger: Increase current carefully while watching voltage.

2015-03-29 Thread NeilBrown
cause the voltage to drop. Then later when user enabled wifi-hotspot, the current needed might go up above what the charger can provide. Maybe I should only increase the limit while the actual current is also increasing. Maybe also revisit the setting when the battery starts charging. NeilBrown

Re: [PATCH 3/4] mmc: sdio: support switching to 1-bit before turning off clocks

2015-03-25 Thread NeilBrown
On Mon, 23 Mar 2015 10:10:18 +0100 Ulf Hansson ulf.hans...@linaro.org wrote: On 24 February 2015 at 03:42, NeilBrown ne...@suse.de wrote: @@ -941,8 +947,12 @@ void mmc_release_host(struct mmc_host *host) WARN_ON(!host-claimed); - if (host-ops-disable host-claim_cnt == 1

[PATCH 2/2] mmc: remove enable/disable methods.

2015-03-25 Thread NeilBrown
The 'enable' and 'disable' methods are deprecated according to host.h, and are no longer used. So discard them. Signed-off-by: NeilBrown n...@brown.name --- drivers/mmc/core/core.c |5 - include/linux/mmc/host.h |6 -- 2 files changed, 11 deletions(-) diff --git a/drivers/mmc

[PATCH 1/2] mmc: omap_hsmmc: stop using .enable and .disable method.

2015-03-25 Thread NeilBrown
-by: NeilBrown n...@brown.name --- drivers/mmc/host/omap_hsmmc.c | 24 +++- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index f84cfb01716d..092bcecd73e6 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b

[PATCH 0/2] Remove mmc_host enable/disable methods.

2015-03-25 Thread NeilBrown
Only omap_hsmmc uses enable and disable, and this seems to be largely for historical reasons and is no longer necessary. I have tested these patches with an OMAP3 with an uSD card on mmc0 and a wifi SDIO device on mmc1. NeilBrown --- NeilBrown (2): mmc: omap_hsmmc: stop using .enable

Re: [PATCH 1/2] mmc: omap_hsmmc: stop using .enable and .disable method.

2015-03-25 Thread NeilBrown
On Thu, 26 Mar 2015 08:43:37 +1100 NeilBrown n...@brown.name wrote: enable and disable are only used to get and put runtime pm references. .set_ios already does this itself, and other drivers just do it in set_ios and .request without using enable/disable. So add pm_runtime get/put

[PATCH 09/14] twl4030_charger: only draw USB current as negotiated with host.

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de If the phy has been told what current it can draw, it tells us and now we use that number. Note that 'vbus_draw' is in mA, while usb_cur is in uA. Acked-by: Pavel Machek pa...@ucw.cz Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c |5

Re: [Gta04-owner] [PATCH 3/4] usb: phy: twl4030: add support for reading restore on ID pin.

2015-03-22 Thread NeilBrown
On Wed, 4 Mar 2015 07:54:41 +0100 Dr. H. Nikolaus Schaller h...@goldelico.com wrote: Am 04.03.2015 um 07:35 schrieb NeilBrown ne...@suse.de: On Mon, 2 Mar 2015 22:04:31 +0100 Pavel Machek pa...@ucw.cz wrote: Hi! The twl4030 phy can measure, with low precision, the resistance

[PATCH 03/14] twl4030_charger: use runtime_pm to keep usb phy active while charging.

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de The twl4030 usb phy needs to be active while we are using the USB VBUS as a current source for charging. In particular, the usb3v1 regulator must be enabled and the PHY_PWR_PHYPWD bit must be set to keep the phy powered. commit

[PATCH 02/14] twl4030_charger: use devres for power_supply_register and kzalloc.

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de Final allocations/registrations are now managed by devres. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c | 32 +--- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/drivers/power

[PATCH 06/14] twl4030_charger: allow fine control of charger current.

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de The twl4030 allows control of the incoming current. Part of this control is a 'CGAIN' setting which doubles the range for half the precision. This control affects several different current setting, so all need to be updated at once when CGAIN is changed

[PATCH 05/14] twl4030_charger: split uA calculation into a function.

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de We will need this calculation in other places, so create functions to map between register value and uA value. Acked-by: Pavel Machek pa...@ucw.cz Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c | 48

[PATCH 04/14] twl4030_charger: trust phy to determine when USB power is available.

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de The usb phy driver already determines when VBUS is available, so repeating the test in the charger driver is pointless duplication. On probe, process the last event from the phy, and from then on, do whatever the phy tells us without double-checking. Signed-off

[PATCH 11/14] twl4030_charger: add software controlled linear charging mode.

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de Add a 'continuous' option for usb charging which enables the linear charging mode of the twl4030. Linear charging does a good job with not-so-reliable power sources. Auto mode does not work well as it switches off when voltage drops momentarily. Care must be taken

[PATCH 14/14] twl4030_charger: assume a 'charger' can supply maximum current.

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de If it cannot, we will stop pulling more current when voltage drops. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/power/twl4030_charger.c b/drivers/power

Re: [PATCH 13/15] twl4030_charger: add ac/mode to match usb/mode

2015-03-22 Thread NeilBrown
On Fri, 6 Mar 2015 23:59:04 +0200 Grazvydas Ignotas nota...@gmail.com wrote: On Tue, Feb 24, 2015 at 6:33 AM, NeilBrown ne...@suse.de wrote: This allows AC charging to be turned off, much like usb charging. continuous (aka linear) mode maps to the CVENAC (constant voltage) feature

[PATCH 13/14] twl4030_charger: Increase current carefully while watching voltage.

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de The USB Battery Charging spec (BC1.2) suggests a dedicated charging port can deliver from 0.5 to 5.0A at between 4.75 and 5.25 volts. To choose the correct current voltage setting requires a trial and error approach: try to draw current and see if the voltage drops

[PATCH 12/14] twl4030_charger: add ac/mode to match usb/mode

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de This allows AC charging to be turned off, much like usb charging. continuous mode is not available though. Acked-by: Pavel Machek pa...@ucw.cz Signed-off-by: NeilBrown ne...@suse.de --- .../ABI/testing/sysfs-class-power-twl4030 | 10 ++ drivers/power

[PATCH 08/14] twl4030_charger: allow max_current to be managed via sysfs.

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de 'max_current' sysfs attributes are created which allow the max to be set. Whenever a current source changes, the default is restored. This will be followed by a uevent, so user-space can decide to update again. Acked-by: Pavel Machek pa...@ucw.cz Signed-off

[PATCH 07/14] twl4030_charger: distinguish between USB current and 'AC' current

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de The twl4030 charger has two current sources, 'USB' and 'AC' (presumably Accessory Charger). If 'AC' is providing current, we should set the current limit differently to when it isn't (and so USB is used). So split 'cur' into 'usb_cur' and 'ac_cur' and use

[PATCH 10/14] twl4030_charger: enable manual enable/disable of usb charging.

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de 'off' or 'auto' to /sys/class/power/twl4030_usb/mode will now enable or disable charging from USB port. Normally this is enabled on 'plug' and disabled on 'unplug'. Unplug will still disable charging. 'plug' will only enable it if 'auto' if selected. Acked

[PATCH 00/14] Enhance twl4030_charger functionality. - V2

2015-03-22 Thread NeilBrown
if it can do so without the voltage dropping too much - a 'continuous' mode is available which ignores voltage and just takes what it can (to be used with caution, but very useful in some circumstances). - 'ac' and 'usb' power sources can be configured separately. Thanks, NeilBrown

[PATCH 01/14] twl4030_charger: use devm_request_threaded_irq

2015-03-22 Thread NeilBrown
From: NeilBrown ne...@suse.de This simplifies the error paths. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c

Re: twl4030_charger: need changes to get probed?

2015-03-08 Thread NeilBrown
with -EPROBEDEFER?? Trouble is, I really don't understand the point or mechanism for platform_driver_probe(), so I cannot suggest anything. But I have been annoyed before that platform_driver_probe doesn't cope with EPROBEDEFER, so I would like it fixed. NeilBrown pgp5MxAjPABro.pgp Description: OpenPGP

Re: [PATCH 15/15] twl4030_charger: assume a 'charger' can supply maximum current.

2015-03-04 Thread NeilBrown
On Mon, 2 Mar 2015 22:29:39 +0100 Pavel Machek pa...@ucw.cz wrote: On Tue 2015-02-24 15:33:53, NeilBrown wrote: If it cannot, we will stop pulling more current when voltage drops. Can you justify it a bit more? I mean... maybe there's a fuse in the charger? Or maybe it will supply

Re: [PATCH 12/15] twl4030_charger: add software controlled linear charging mode.

2015-03-04 Thread NeilBrown
On Mon, 2 Mar 2015 22:09:26 +0100 Pavel Machek pa...@ucw.cz wrote: On Tue 2015-02-24 15:33:52, NeilBrown wrote: Add a 'continuous' option for usb charging which enabled the linear charging mode of the twl4030. Documentation/ :-). ! Linear charging does a good job with not so

Re: [PATCH 04/15] twl4030_charger: use runtime_pm to keep usb phy active while charging.

2015-03-04 Thread NeilBrown
On Wed, 25 Feb 2015 07:24:43 + Lee Jones lee.jo...@linaro.org wrote: On Tue, 24 Feb 2015, NeilBrown wrote: The twl4030 usb phy needs to be active while we are using the USB VBUS as a current source for charging. In particular, the usb3v1 regulator must be enabled

Re: [PATCH 09/15] twl4030_charger: allow max_current to be managed via sysfs.

2015-03-04 Thread NeilBrown
On Mon, 2 Mar 2015 22:05:26 +0100 Pavel Machek pa...@ucw.cz wrote: On Tue 2015-02-24 15:33:52, NeilBrown wrote: 'max_current' sysfs attributes are created which allow the max to be set. Whenever a current source changes, the default is restored. This will be followed by a uevent, so user

Re: [PATCH 14/15] twl4030_charger: Increase current carefully while watching voltage.

2015-03-04 Thread NeilBrown
On Mon, 2 Mar 2015 22:29:45 +0100 Pavel Machek pa...@ucw.cz wrote: On Tue 2015-02-24 15:33:53, NeilBrown wrote: The USB Battery Charging spec (BC1.2) suggests a dedicated charging port can deliver from 0.5 to 5.0A at between 4.75 and 5.25 volts. To choose the correct current voltage

Re: [PATCH 06/15] twl4030_charger: split uA calculation into a function.

2015-03-04 Thread NeilBrown
On Mon, 2 Mar 2015 22:05:18 +0100 Pavel Machek pa...@ucw.cz wrote: On Tue 2015-02-24 15:33:51, NeilBrown wrote: We will need this calculation in other places, so create functions to map between register value and uA value. Signed-off-by: NeilBrown ne...@suse.de Acked-by: Pavel Machek

Re: [PATCH 1/4] usb: phy: twl4030: make runtime pm more reliable.

2015-03-03 Thread NeilBrown
readability here. Thanks, Pavel Good idea. I've done that. The function is called cable_present(). Thanks, NeilBrown pgpbO85e0cIau.pgp Description: OpenPGP digital signature

Re: [PATCH 08/15] twl4030_charger: distinguish between USB current and 'AC' current

2015-03-03 Thread NeilBrown
split 'cur' into 'usb_cur' and 'ac_cur' and use accordingly. Now we must review the current setting on any interrupt or USB event which might indicate that the charger-source has changed. Signed-off-by: NeilBrown ne...@suse.de @@ -103,7 +104,9 @@ struct twl4030_bci { /* ichg

Re: [PATCH 2/4] usb: phy: twl4030: allow charger to see usb current draw limits.

2015-03-03 Thread NeilBrown
On Mon, 2 Mar 2015 22:03:55 +0100 Pavel Machek pa...@ucw.cz wrote: On Tue 2015-02-24 14:40:37, NeilBrown wrote: The charger needs to know when a USB gadget has been enumerated and what the agreed maximum current was so that it can adjust charging accordingly. So define a set_power

Re: [PATCH 07/15] twl4030_charger: allow fine control of charger current.

2015-03-03 Thread NeilBrown
charging when current drops to here */ + bci-ichg_lo = 241000; /* low threshold */ Low + bci-ichg_hi = 50; /* High threshold */ Acked-by: Pavel Machek pa...@ucw.cz Thanks again! NeilBrown pgp0d5hnlrrkh.pgp Description: OpenPGP digital signature

Re: [PATCH 4/4] usb: phy: twl4030: test ID resistance to see if charger is present.

2015-03-03 Thread NeilBrown
On Mon, 2 Mar 2015 22:04:44 +0100 Pavel Machek pa...@ucw.cz wrote: On Tue 2015-02-24 14:40:37, NeilBrown wrote: If an 'A' plug is inserted, ID should be pulled to ground. If a 'B' plug, then ID should be floating. If an Accessory Charger Adapter is inserted, then ID will be neither

Re: [PATCH 11/15] twl4030_charger: enable manual enable/disable of usb charging.

2015-03-03 Thread NeilBrown
On Mon, 2 Mar 2015 22:03:42 +0100 Pavel Machek pa...@ucw.cz wrote: On Tue 2015-02-24 15:33:52, NeilBrown wrote: 'off' or 'auto' to /sys/class/power/twl4030_usb/mode will now enable or disable charging from USB port. Normally this is enabled on 'plug' and disabled on 'unplug

Re: [PATCH 3/4] usb: phy: twl4030: add support for reading restore on ID pin.

2015-03-03 Thread NeilBrown
again in 50msec. Signed-off-by: NeilBrown ne...@suse.de --- drivers/phy/phy-twl4030-usb.c | 63 + 1 file changed, 63 insertions(+) diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index 023fe150c7a1..759950898df9

Re: [PATCH 3/4] mmc: sdio: support switching to 1-bit before turning off clocks

2015-03-03 Thread NeilBrown
On Tue, 3 Mar 2015 14:53:55 -0800 Tony Lindgren t...@atomide.com wrote: * NeilBrown ne...@suse.de [150223 18:47]: According to section 7.1.2 of http://www.sandisk.com/media/File/OEM/Manuals/SD_SDIO_specsv1.pdf In the case where the interrupt mechanism is used to wake the host

Re: [PATCH 0/6] mmc: omap_hsmmc: simplify cover/card detect logic

2015-03-03 Thread NeilBrown
. NeilBrown pgplTpnSDXJsy.pgp Description: OpenPGP digital signature

Re: [PATCH] OMAP: DSS: DPI: disable vt-switch on suspend/resume.

2015-02-25 Thread NeilBrown
On Wed, 25 Feb 2015 12:03:36 +0200 Tomi Valkeinen tomi.valkei...@ti.com wrote: On 25/02/15 11:37, NeilBrown wrote: These devices do not need to return to non-graphic console for suspend, so disable that option. This means there is less work to do in the suspend/resume cycle, making

Re: advanced LED controllers

2015-02-25 Thread NeilBrown
a 'synchronise' setting to that a bunch of LEDs can be synchonised so you can create a cylon eye effect. i.e. don't focus on the low-level 'what can we provide' but on the high level what might users want. NeilBrown pgpmXIEFj4kez.pgp Description: OpenPGP digital signature

Re: [PATCH] OMAPDSS: restore name sysfs entry.

2015-02-25 Thread NeilBrown
driver available? Maybe a wiki page telling me how to set it up? http://processors.wiki.ti.com/index.php/Linux_Core_DSS_User%27s_Guide seems to have some useful suggestions, but no mention of Xorg... Thanks, NeilBrown So of course we need to keep omapfb working for the years to come

[PATCH] OMAP: DSS: DPI: disable vt-switch on suspend/resume.

2015-02-25 Thread NeilBrown
These devices do not need to return to non-graphic console for suspend, so disable that option. This means there is less work to do in the suspend/resume cycle, making it smoother and cheaper. Signed-off-by: NeilBrown n...@brown.name -- Hi Tomi, I wonder if you would consider this patch too

Re: [PATCH] OMAPDSS: restore name sysfs entry.

2015-02-25 Thread NeilBrown
On Wed, 25 Feb 2015 10:49:58 +0200 Tomi Valkeinen tomi.valkei...@ti.com wrote: Hi, On 24/02/15 22:31, NeilBrown wrote: On Tue, 24 Feb 2015 12:40:32 +0200 Tomi Valkeinen tomi.valkei...@ti.com wrote: Hi, On 24/02/15 11:37, NeilBrown wrote: commit

Re: [PATCH] OMAPDSS: restore name sysfs entry.

2015-02-24 Thread NeilBrown
On Tue, 24 Feb 2015 12:40:32 +0200 Tomi Valkeinen tomi.valkei...@ti.com wrote: Hi, On 24/02/15 11:37, NeilBrown wrote: commit 303e4697e762dc92a40405f4e4b8aac02cd0d70b OMAPDSS: rename display-sysfs 'name' entry broke the xorg X server on my device as it couldn't find

[PATCH 09/15] twl4030_charger: allow max_current to be managed via sysfs.

2015-02-24 Thread NeilBrown
'max_current' sysfs attributes are created which allow the max to be set. Whenever a current source changes, the default is restored. This will be followed by a uevent, so user-space can decide to update again. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c | 76

[PATCH 15/15] twl4030_charger: assume a 'charger' can supply maximum current.

2015-02-24 Thread NeilBrown
If it cannot, we will stop pulling more current when voltage drops. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c index

[PATCH 14/15] twl4030_charger: Increase current carefully while watching voltage.

2015-02-24 Thread NeilBrown
a large value will cause the maximum available to be used - up to the limit of 1.7mA imposed by the hardware. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c | 54 ++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git

[PATCH 10/15] twl4030_charger: only draw USB current as negotiated with host.

2015-02-24 Thread NeilBrown
If the phy has been told what current it can draw, it tells us and now we use that number. Note that 'vbus_draw' is in mA, while usb_cur is in uA. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c |5 + 1 file changed, 5 insertions(+) diff --git a/drivers/power

[PATCH 11/15] twl4030_charger: enable manual enable/disable of usb charging.

2015-02-24 Thread NeilBrown
'off' or 'auto' to /sys/class/power/twl4030_usb/mode will now enable or disable charging from USB port. Normally this is enabled on 'plug' and disabled on 'unplug'. Unplug will still disable charging. 'plug' will only enable it if 'auto' if selected. Signed-off-by: NeilBrown ne...@suse.de

[PATCH 12/15] twl4030_charger: add software controlled linear charging mode.

2015-02-24 Thread NeilBrown
. In that case there are automatically charging stops when the cyclist needs a break. Orignal-by: Andreas Kemnade andr...@kemnade.info Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c | 57 --- 1 file changed, 52 insertions(+), 5 deletions

[PATCH 13/15] twl4030_charger: add ac/mode to match usb/mode

2015-02-24 Thread NeilBrown
This allows AC charging to be turned off, much like usb charging. continuous (aka linear) mode maps to the CVENAC (constant voltage) feature of the twl4030. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c | 40 +-- 1 file changed

[PATCH] OMAPDSS: restore name sysfs entry.

2015-02-24 Thread NeilBrown
does register it own 'name' file, but spi does not, hence my problem - I have an spi display. So create a special case for i2c: add the name attribute for non-i2c devices. Fixes: 303e4697e762dc92a40405f4e4b8aac02cd0d70b Signed-off-by: NeilBrown ne...@suse.de -- Hi Tomi, I wonder if you would

[PATCH 1/4] mmc: core: fold mmc_set_bus_width calls into sdio_enable_4bit_bus.

2015-02-23 Thread NeilBrown
Every call to sdio_enable_4bit_bus is followed (on success) but a call to mmc_set_bus_width(). To simplify the code, include those calls directly in sdio_enable_4bit_bus(). Signed-off-by: NeilBrown n...@brown.name --- drivers/mmc/core/sdio.c | 32 1 file

[PATCH 4/4] mmc: omap_hsmmc: switch to 1-bit before stopping clocks.

2015-02-23 Thread NeilBrown
-bit bus, with interrupts and runtime power-management enabled, and get around 14Mb/sec throughput (which is the best I've seen). Signed-off-by: NeilBrown n...@brown.name --- drivers/mmc/host/omap_hsmmc.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH 2/4] mmc: core: allow non-blocking form of mmc_claim_host

2015-02-23 Thread NeilBrown
'abort' being set just as the host is claimed. This allows extra functionality. If __mmc_claim_host() is called with an 'abort' pointer which is initialized to '1', it will effect a non-blocking 'claim'. Signed-off-by: NeilBrown n...@brown.name --- drivers/mmc/core/core.c |3 ++- 1 file

[PATCH 0/4] Switch to 1-bit mode SDIO before disabling clocks.

2015-02-23 Thread NeilBrown
. Thanks, NeilBrown --- NeilBrown (4): mmc: core: fold mmc_set_bus_width calls into sdio_enable_4bit_bus. mmc: core: allow non-blocking form of mmc_claim_host mmc: sdio: support switching to 1-bit before turning off clocks mmc: omap_hsmmc: switch to 1-bit before stopping clocks

[PATCH 3/4] mmc: sdio: support switching to 1-bit before turning off clocks

2015-02-23 Thread NeilBrown
-off-by: NeilBrown n...@brown.name --- drivers/mmc/core/core.c | 18 ++ drivers/mmc/core/sdio.c | 42 +- include/linux/mmc/core.h |2 ++ include/linux/mmc/host.h |2 ++ 4 files changed, 59 insertions(+), 5 deletions(-) diff --git

[PATCH 2/4] usb: phy: twl4030: allow charger to see usb current draw limits.

2015-02-23 Thread NeilBrown
-by: NeilBrown ne...@suse.de --- drivers/phy/phy-twl4030-usb.c | 27 +-- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c index 97c59074233f..023fe150c7a1 100644 --- a/drivers/phy/phy-twl4030-usb.c

[PATCH 1/4] usb: phy: twl4030: make runtime pm more reliable.

2015-02-23 Thread NeilBrown
of the code. So be more direct is taking and dropping references. If twl-linkstat is VBUS_VALID or ID_GROUND, then hold a pm_runtime reference, otherwise don't. Signed-off-by: NeilBrown ne...@suse.de --- drivers/phy/phy-twl4030-usb.c | 20 +--- 1 file changed, 13 insertions(+), 7

[PATCH 3/4] usb: phy: twl4030: add support for reading restore on ID pin.

2015-02-23 Thread NeilBrown
The twl4030 phy can measure, with low precision, the resistance-to-ground of the ID pin. Add a function to read the value, and export the result via sysfs. If the read fails, which it does sometimes, try again in 50msec. Signed-off-by: NeilBrown ne...@suse.de --- drivers/phy/phy-twl4030-usb.c

[PATCH 4/4] usb: phy: twl4030: test ID resistance to see if charger is present.

2015-02-23 Thread NeilBrown
that it is a charger. Fortunately, this will treat the Openmoko charger (and other similar chargers) as a charger. Signed-off-by: NeilBrown ne...@suse.de --- drivers/phy/phy-twl4030-usb.c | 28 1 file changed, 28 insertions(+) diff --git a/drivers/phy/phy-twl4030-usb.c b

[PATCH 0/4] Enhancements to twl4030 phy to support better charging.

2015-02-23 Thread NeilBrown
. There is also support for conveying the max current negotiated by a host to the charger. Comments most welcome. thanks, NeilBrown --- NeilBrown (4): usb: phy: twl4030: make runtime pm more reliable. usb: phy: twl4030: allow charger to see usb current draw limits. usb: phy

[PATCH 08/15] twl4030_charger: distinguish between USB current and 'AC' current

2015-02-23 Thread NeilBrown
the current setting on any interrupt or USB event which might indicate that the charger-source has changed. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c | 30 +- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/drivers/power

[PATCH 07/15] twl4030_charger: allow fine control of charger current.

2015-02-23 Thread NeilBrown
setting are managed by the driver, but most are left at their default settings. The current drawn is set to 500mA if the allow_usb module parameter is set, and to 100mA otherwise. More fine control will appear in later patches. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power

[PATCH 04/15] twl4030_charger: use runtime_pm to keep usb phy active while charging.

2015-02-23 Thread NeilBrown
it as a current source. So this patch reverts the above commit, and adds the necessary runtime_pm calls. Signed-off-by: NeilBrown ne...@suse.de --- drivers/mfd/twl-core.c |9 - drivers/power/twl4030_charger.c | 18 +- 2 files changed, 9 insertions(+), 18

[PATCH 06/15] twl4030_charger: split uA calculation into a function.

2015-02-23 Thread NeilBrown
We will need this calculation in other places, so create functions to map between register value and uA value. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c | 48 --- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git

[PATCH 05/15] twl4030_charger: trust phy to determine when USB power is available.

2015-02-23 Thread NeilBrown
The usb phy driver already determines when VBUS is available, so repeating the test in the charger driver is pointless duplication. On probe, process the last event from the phy, and from then on, do whatever the phy tells us without double-checking. Signed-off-by: NeilBrown ne...@suse.de

[PATCH 00/15] Enhance twl4030_charger functionality.

2015-02-23 Thread NeilBrown
requires patch to phy-twl4030-usb.c which have been sent separately. Thanks, NeilBrown --- NeilBrown (15): power_supply core: support use of devres to register/unregister a power supply. twl4030_charger: use devm_request_threaded_irq twl4030_charger: use devres

[PATCH 03/15] twl4030_charger: use devres for power_supply_register and kzalloc.

2015-02-23 Thread NeilBrown
Final allocations/registrations are now managed by devres. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c | 23 ++- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c

[PATCH 02/15] twl4030_charger: use devm_request_threaded_irq

2015-02-23 Thread NeilBrown
This simplifies the error paths. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/twl4030_charger.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c index 4cf5ffbc904a..300dd7a34e80

[PATCH 01/15] power_supply core: support use of devres to register/unregister a power supply.

2015-02-23 Thread NeilBrown
Using devm_power_supply_register allows the unregister to happen automatically on error or final put. Signed-off-by: NeilBrown ne...@suse.de --- drivers/power/power_supply_core.c | 45 + include/linux/power_supply.h |4 +++ 2 files changed, 49

[PATCH 2/4] mmc: core: allow non-blocking form of mmc_claim_host

2015-01-30 Thread NeilBrown
'abort' being set just as the host is claimed. This allows extra functionality. If __mmc_claim_host() is called with an 'abort' pointer which is initialized to '1', it will effect a non-blocking 'claim'. Signed-off-by: NeilBrown n...@brown.name --- drivers/mmc/core/core.c |3 ++- 1 file

  1   2   3   >