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 wrote: > * NeilBrown [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 > > --- >

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

2015-08-06 Thread NeilBrown
; > Anyway, I 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 wrote: > * NeilBrown [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) > > { > >

[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 Signed-off-by: NeilBrown --- drivers/power/twl4030_charger.c | 48 --- 1 file changed, 35 insertions(+), 13 deletions

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

2015-07-29 Thread NeilBrown
to' if selected. Acked-by: Pavel Machek Signed-off-by: NeilBrown --- .../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-

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

2015-07-29 Thread NeilBrown
So 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. Acked-by: Pavel Machek Signed-off-by: NeilBrown --- drivers/power/t

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

2015-07-29 Thread NeilBrown
sysfs. So setting 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 --- drivers/power/twl4030_charger.c | 67 --- 1 file changed, 61 insertions(+), 6 deletions(-) diff --git a/dri

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

2015-07-29 Thread NeilBrown
over-charge. 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 Signed-off-by: NeilBrown --- .../ABI/testing/sysfs-class-power-twl4030 |9 +++ drivers/pow

[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 --- 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 2c537ee11bbe

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

2015-07-29 Thread NeilBrown
o use it as a current source. So this patch reverts the above commit, and adds the necessary runtime_pm calls. Acked-by: Lee Jones Signed-off-by: NeilBrown --- drivers/mfd/twl-core.c |9 - drivers/power/twl4030_charger.c | 18 +- 2 files changed, 9 inser

[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 --- drivers/power/twl4030_charger.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/power/twl4030_charger.c b/drivers

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

2015-07-29 Thread NeilBrown
From: Pavel Machek Drivers using module_platform_driver_probe cannot return EPROBE_DEFER from the probe function, which makes them rather useless these days... Convert to module_platform_driver() so EPROBE_DEFER can be used. Signed-off-by: Pavel Machek Signed-off-by: NeilBrown --- drivers

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

2015-07-29 Thread NeilBrown
se current 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 Signed-off-by: NeilBrown --- dri

[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 Signed-off-by: NeilBrown --- .../ABI/testing/s

[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 --- drivers/power

[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 Signed-off-by: NeilBrown --- .../ABI/testing/sysfs-class-power-twl4030 | 10 ++ drivers/power/twl4030_charger.c

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 wrote: > Hello Neil, > > some suggestions: > > On 23.03.2015 00:20, NeilBrown wrote: > > From: NeilBrown > > diff --git a/Documentation/ABI/testing/sysfs-class-power-twl4030 > > b/Documentation/ABI/testing/sysfs-clas

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 wrote: > Hi, > > On Thursday 16 April 2015 01:33 PM, NeilBrown wrote: > > From: NeilBrown > > > > The twl4030 phy can measure, with low precision, the > > resistance-to-ground of the ID pin. > > &g

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 wrote: > On Thu 2015-04-16 18:03:04, NeilBrown wrote: > > From: NeilBrown > > > > This driver device one local attribute: vbus. > > Describe that in Documentation/ABI/testing/sysfs-platform/twl4030-usb. > &

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

2015-04-16 Thread NeilBrown
ues. In particular: 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, NeilBr

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

2015-04-16 Thread NeilBrown
From: NeilBrown This driver device one local attribute: vbus. Describe that in Documentation/ABI/testing/sysfs-platform/twl4030-usb. Signed-off-by: NeilBrown --- .../ABI/testing/sysfs-platform-twl4030-usb |8 1 file changed, 8 insertions(+) create mode 100644

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

2015-04-16 Thread NeilBrown
From: 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. Acked-by: Pavel Machek Signed-off-by: NeilBrown

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

2015-04-16 Thread NeilBrown
From: NeilBrown Signed-off-by: NeilBrown --- 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 100644 --- a/drivers/phy

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

2015-04-16 Thread NeilBrown
these two pointless tests. Signed-off-by: NeilBrown --- 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/p

[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 --- 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/phy-twl4030

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

2015-04-16 Thread NeilBrown
From: NeilBrown 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_autosuspe

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

2015-03-29 Thread NeilBrown
at time the device cannot use more than 200mA, and that doesn't 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 > > Best regards, > Pavel pgpc908HCllRF.pgp Description: OpenPGP digital signature

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 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_

[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

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

2015-03-25 Thread NeilBrown
: NeilBrown --- 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/drivers/mmc

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 wrote: > On 24 February 2015 at 03:42, NeilBrown wrote: > > @@ -941,8 +947,12 @@ void mmc_release_host(struct mmc_host *host) > > > > WARN_ON(!host->claimed); > > > > - if (host-&

[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 --- drivers/mmc/core/core.c |5 - include/linux/mmc/host.h |6 -- 2 files changed, 11 deletions(-) diff --g

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

2015-03-22 Thread NeilBrown
From: NeilBrown 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 ab37813f4093a5f59cb8e083cde277289dc72ed3

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

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

[PATCH 01/14] twl4030_charger: use devm_request_threaded_irq

2015-03-22 Thread NeilBrown
From: NeilBrown This simplifies the error paths. Signed-off-by: NeilBrown --- 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 b07f4e2f2dde

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

2015-03-22 Thread NeilBrown
From: NeilBrown 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. With this pat

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

2015-03-22 Thread NeilBrown
From: NeilBrown We will need this calculation in other places, so create functions to map between register value and uA value. Acked-by: Pavel Machek Signed-off-by: NeilBrown --- drivers/power/twl4030_charger.c | 48 --- 1 file changed, 35 insertions

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

2015-03-22 Thread NeilBrown
From: 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

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

2015-03-22 Thread NeilBrown
From: NeilBrown 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

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

2015-03-22 Thread NeilBrown
From: NeilBrown If it cannot, we will stop pulling more current when voltage drops. Signed-off-by: NeilBrown --- 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/14] twl4030_charger: add ac/mode to match usb/mode

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

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

2015-03-22 Thread NeilBrown
From: NeilBrown 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 dro

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

2015-03-22 Thread NeilBrown
From: 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

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

2015-03-22 Thread NeilBrown
From: 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 Signed-off-by: NeilBrown --

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

2015-03-22 Thread NeilBrown
From: NeilBrown 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' i

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

2015-03-22 Thread NeilBrown
From: 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. Acked-by: Pavel Machek Signed-off-by: NeilBrown --- drivers/power/twl4030_charger.c |5 + 1 file changed, 5

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

2015-03-22 Thread NeilBrown
nt 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 configu

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 wrote: > On Tue, Feb 24, 2015 at 6:33 AM, NeilBrown wrote: > > This allows AC charging to be turned off, much like usb charging. > > > > "continuous" (aka "linear") mode maps to the CVENAC (con

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

2015-03-21 Thread NeilBrown
On Wed, 4 Mar 2015 07:54:41 +0100 "Dr. H. Nikolaus Schaller" wrote: > > Am 04.03.2015 um 07:35 schrieb NeilBrown : > > > On Mon, 2 Mar 2015 22:04:31 +0100 Pavel Machek wrote: > > > >> Hi! > >> > >>> The twl4030 phy can measure,

Re: twl4030_charger: need changes to get probed?

2015-03-08 Thread NeilBrown
er thing. So maybe we should fix platform_driver_probe() to do the right thing 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 co

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 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 cho

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 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

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 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/ :-). ! > >

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 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

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 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 and th

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 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 > >

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 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. > >

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

2015-03-03 Thread NeilBrown
t limit > > differently to when it isn't (and so USB is used). > > So 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 i

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

2015-03-03 Thread NeilBrown
_init twl4030_bci_probe(struct > > platform_device *pdev) > > if (!pdata) > > pdata = twl4030_bci_parse_dt(&pdev->dev); > > > > + bci->ichg_eoc = 80100; /* Stop charging when current drops to here */ > > + bci->ichg_lo = 241000; /* low

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 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 A

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

2015-03-03 Thread NeilBrown
If the read fails, which it does sometimes, try again in 50msec. > > > > Signed-off-by: NeilBrown > > --- > > drivers/phy/phy-twl4030-usb.c | 63 > > + > > 1 file changed, 63 insertions(+) > > > > d

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

2015-03-03 Thread NeilBrown
e(twl->dev); > > pm_runtime_mark_last_busy(twl->dev); > > inline function returning (x == OMAP_MUSB_VBUS_VALID || x == > OMAP_MUSB_ID_GROUND) would really help 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 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 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

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

2015-03-03 Thread NeilBrown
y it would be available to all hosts, and you wouldn't need to revert that patch. NeilBrown pgplTpnSDXJsy.pgp Description: OpenPGP digital signature

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 wrote: > * NeilBrown [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 t

Re: "advanced" LED controllers

2015-02-25 Thread NeilBrown
if you set each led on a given controller to saturate at different level and to use the same sound source, then you could get the "graphic equaliser" effect. Maybe 'blinking' should have 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
r 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, but >

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 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 cy

[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 -- Hi Tomi, I wonder if you would consider this patch too. It works for

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

2015-02-25 Thread NeilBrown
On Wed, 25 Feb 2015 10:49:58 +0200 Tomi Valkeinen wrote: > Hi, > > On 24/02/15 22:31, NeilBrown wrote: > > On Tue, 24 Feb 2015 12:40:32 +0200 Tomi Valkeinen > > wrote: > > > >> Hi, > >> > >> On 24/02/15 11:37, NeilBrown wrote: > >&g

[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 'a

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

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

[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 --- drivers/power/twl4030_charger.c |5 + 1 file changed, 5 insertions(+) diff --git a/dri

[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 --- drivers/power/twl4030_charger.c | 40 +--

[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 --- 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 7ad6b4b531d7

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

2015-02-24 Thread NeilBrown
So setting 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 --- drivers/power/twl4030_charger.c | 54 ++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/dri

[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 --- drivers/power/twl4030_charge

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

2015-02-24 Thread NeilBrown
On Tue, 24 Feb 2015 12:40:32 +0200 Tomi Valkeinen wrote: > Hi, > > On 24/02/15 11:37, NeilBrown wrote: > > > > > > commit 303e4697e762dc92a40405f4e4b8aac02cd0d70b > > OMAPDSS: rename display-sysfs 'name' entry > > > > broke the xor

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

2015-02-24 Thread NeilBrown
; is not compatible with i2c or spi. i2c 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

[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 --- drivers/power/power_supply_core.c | 45 + include/linux/power_supply.h |4 +++ 2 files changed, 49 insertions

[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 --- 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 index

[PATCH 02/15] twl4030_charger: use devm_request_threaded_irq

2015-02-23 Thread NeilBrown
This simplifies the error paths. Signed-off-by: NeilBrown --- 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 100644 --- a

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

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

[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 --- drivers/power/twl4030_charger.c | 48 --- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/drivers

[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 --- drivers/power

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

2015-02-23 Thread NeilBrown
se current 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 --- drivers/power/twl4030_charge

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

2015-02-23 Thread NeilBrown
d '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 --- drivers/power/twl4030_charger.c | 30 +- 1 file changed, 25 insertions

[PATCH 00/15] Enhance twl4030_charger functionality.

2015-02-23 Thread NeilBrown
y. Some of this functionality 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 t

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

2015-02-23 Thread NeilBrown
the intention 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 --- drivers/phy/phy-twl4030-usb.c | 20 +--- 1 file changed, 13 in

[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 --- drivers/phy/phy-twl4030-usb.c | 63

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

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

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

2015-02-23 Thread NeilBrown
n. Signed-off-by: NeilBrown --- 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-u

[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 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 --- drivers/mmc/core/sdio.c | 32 1 file changed, 12

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

2015-02-23 Thread NeilBrown
h a 4-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 --- drivers/mmc/host/omap_hsmmc.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/driver

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

2015-02-23 Thread NeilBrown
to handle '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 --- drivers/mmc/co

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

2015-02-23 Thread NeilBrown
t_autosuspend) if ->sdio_narrowed is 2. Signed-off-by: NeilBrown --- 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 in

[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 1/4] mmc: core: fold mmc_set_bus_width calls into sdio_enable_4bit_bus.

2015-01-30 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 --- drivers/mmc/core/sdio.c | 32 1 file changed, 12

  1   2   3   4   >