Re: [PATCH 4/6] regulator: add bcm59056 regulator driver

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 04:29:14PM -0500, Matt Porter wrote: > On Tue, Feb 04, 2014 at 05:28:36PM +, Mark Brown wrote: > > > + /* > > > + * Regulator API handles empty constraints but not NULL > > > + * constraints > > > + */ > > > + if (!reg_data) >

Re: [PATCH 2/6] regulator: add bcm59056 pmu DT binding

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 04:16:38PM -0500, Matt Porter wrote: > On Tue, Feb 04, 2014 at 05:23:09PM +, Mark Brown wrote: > > Is this really only a regulator - does the chip have no other functions? > It's your average multi-function device with other functions as you are > suspecting. Buried i

Re: [PATCH 4/6] regulator: add bcm59056 regulator driver

2014-02-04 Thread Matt Porter
On Tue, Feb 04, 2014 at 05:28:36PM +, Mark Brown wrote: > On Tue, Feb 04, 2014 at 07:19:10AM -0500, Matt Porter wrote: > > > +static unsigned int bcm59056_get_mode(struct regulator_dev *dev) > > +{ > > + return REGULATOR_MODE_NORMAL; > > +} > > + > > +static int bcm59056_set_mode(struct regu

Re: [PATCH 2/6] regulator: add bcm59056 pmu DT binding

2014-02-04 Thread Matt Porter
On Tue, Feb 04, 2014 at 05:23:09PM +, Mark Brown wrote: > On Tue, Feb 04, 2014 at 07:19:08AM -0500, Matt Porter wrote: > > Add a DT binding for the BCM59056 PMU. The binding inherits from > > the generic regulator bindings. > > Is this really only a regulator - does the chip have no other func

Re: [PATCH 05/17] mmc: mmci: Put the device into low power state at system suspend

2014-02-04 Thread Kevin Hilman
Ulf Hansson writes: > Due to the available runtime PM callbacks, we are now able to put our > device into low power state at system suspend. > > Earlier we could not accomplish this without trusting a power domain > for the device to take care of it. Now we are able to cope with > scenarios both

Re: [PATCH 10/17] spi: pl022: Remove redundant pinctrl to default state in probe

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 04:58:51PM +0100, Ulf Hansson wrote: > The driver core is now taking care of putting our pins into default > state at probe. Thus we can remove the redundant call for it in probe. I applied this one too, as with the last patch it looks independant of the runtime PM stuff.

Re: [PATCH 09/17] spi: pl022: Simplify clock handling

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 04:58:50PM +0100, Ulf Hansson wrote: > Make use of clk_prepare_enable and clk_disable_unprepare to simplify > code. No functional change. I went ahead and applied this since it looks good and seems like an unrelated cleanup to the runtime PM stuff which seems to be where th

Re: [PATCH 07/17] spi: pl022: Don't ignore power domain and amba bus at system suspend

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 04:58:48PM +0100, Ulf Hansson wrote: > @@ -2328,8 +2300,23 @@ static int pl022_suspend(struct device *dev) > return ret; > } > > - pm_runtime_get_sync(dev); > - pl022_suspend_resources(pl022, false); > + pm_runtime_disable(dev); > + > +

Re: [PATCH 00/17] amba: PM fixups for amba bus and some amba drivers

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 04:58:41PM +0100, Ulf Hansson wrote: > The fixes for the amba bus needs to be merged prior to the other, thus I think > it could make sense to merge this complete patchset through Russell's tree, > if he and the other maintainers think this is okay. What are the actual dep

Re: [PATCH 4/6] regulator: add bcm59056 regulator driver

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 07:19:10AM -0500, Matt Porter wrote: > +static unsigned int bcm59056_get_mode(struct regulator_dev *dev) > +{ > + return REGULATOR_MODE_NORMAL; > +} > + > +static int bcm59056_set_mode(struct regulator_dev *dev, unsigned int mode) > +{ > + if (mode == REGULATOR_MODE

Re: [PATCH 2/6] regulator: add bcm59056 pmu DT binding

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 07:19:08AM -0500, Matt Porter wrote: > Add a DT binding for the BCM59056 PMU. The binding inherits from > the generic regulator bindings. Is this really only a regulator - does the chip have no other functions? > +- regulators: This is the list of child nodes that specify

Re: [PATCH 3/6] mfd: add bcm59056 pmu driver

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 05:08:32PM +, Lee Jones wrote: > > What using of_match_ptr() should do is allow the compiler to figure out > > that the table isn't used when DT is disabled and discard it without > > ifdefs. Not sure if that actually works yet but that's the idea. > Right, but I'm gu

Re: [PATCH 3/6] mfd: add bcm59056 pmu driver

2014-02-04 Thread Lee Jones
> > > > +static struct i2c_driver bcm59056_i2c_driver = { > > > > + .driver = { > > > > + .name = "bcm59056", > > > > + .owner = THIS_MODULE, > > > > + .of_match_table = of_match_ptr(bcm59056_of_match), > > > > No need to use of_match_ptr()

Re: [PATCH 08/17] spi: pl022: Fully gate clocks at request inactivity

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 04:58:49PM +0100, Ulf Hansson wrote: > Use clk_disable_unprepare and clk_prepare_enable from the runtime PM > callbacks, to fully gate|ungate clocks. Potentially this will save more > power, depending on the clock tree for the current SOC. The same patch has already been ap

Re: [PATCH 3/6] mfd: add bcm59056 pmu driver

2014-02-04 Thread Mark Brown
On Tue, Feb 04, 2014 at 09:31:19AM -0500, Matt Porter wrote: > On Tue, Feb 04, 2014 at 01:29:51PM +, Lee Jones wrote: > > > +static struct i2c_driver bcm59056_i2c_driver = { > > > + .driver = { > > > +.name = "bcm59056", > > > +.owner = THIS_MODULE, > > > +.

[PATCH 02/17] amba: Add late and early PM callbacks

2014-02-04 Thread Ulf Hansson
To give provision for amba drivers to make use of the late|early PM callbacks, we point the amba bus PM callbacks to the generic versions of these. Cc: Russell King Signed-off-by: Ulf Hansson --- drivers/amba/bus.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/amba/bus.c

[PATCH 03/17] mmc: mmci: Mask IRQs for all variants during runtime suspend

2014-02-04 Thread Ulf Hansson
In runtime suspended state, we are not expecting IRQs and thus we can safely mask them, not only for pwrreg_nopower variants but for all. Obviously we then also need to make sure we restore the IRQ mask while becoming runtime resumed. Cc: Russell King Signed-off-by: Ulf Hansson --- drivers/mmc

[PATCH 01/17] amba: Let runtime PM callbacks be available for CONFIG_PM

2014-02-04 Thread Ulf Hansson
Convert to the SET_PM_RUNTIME_PM macro while defining the runtime PM callbacks. This means the callbacks becomes available for both CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME, which is needed by drivers and power domains. Cc: Russell King Signed-off-by: Ulf Hansson --- drivers/amba/bus.c |4 ++--

[PATCH 04/17] mmc: mmci: Let runtime PM callbacks be available for CONFIG_PM

2014-02-04 Thread Ulf Hansson
Convert to the SET_PM_RUNTIME_PM macro while defining the runtime PM callbacks. This means the callbacks becomes available for both CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME, which is needed to handle the combinations of these scenarios. Cc: Russell King Signed-off-by: Ulf Hansson --- drivers/mmc/h

[PATCH 06/17] spi: pl022: Let runtime PM callbacks be available for CONFIG_PM

2014-02-04 Thread Ulf Hansson
Convert to the SET_PM_RUNTIME_PM macro while defining the runtime PM callbacks. This means the callbacks becomes available for both CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME, which is needed to handle the combinations of these scenarios. Cc: Mark Brown Signed-off-by: Ulf Hansson --- drivers/spi/spi

[PATCH 07/17] spi: pl022: Don't ignore power domain and amba bus at system suspend

2014-02-04 Thread Ulf Hansson
Due to the available runtime PM callbacks for CONFIG_PM, we are now able to put the device into complete low power state at system suspend. Previously only the resources controlled by the driver were put into low power state at system suspend. Both the amba bus and a potential power domain were ig

[PATCH 08/17] spi: pl022: Fully gate clocks at request inactivity

2014-02-04 Thread Ulf Hansson
Use clk_disable_unprepare and clk_prepare_enable from the runtime PM callbacks, to fully gate|ungate clocks. Potentially this will save more power, depending on the clock tree for the current SOC. Cc: Mark Brown Signed-off-by: Ulf Hansson --- drivers/spi/spi-pl022.c |4 ++-- 1 file changed,

[PATCH 09/17] spi: pl022: Simplify clock handling

2014-02-04 Thread Ulf Hansson
Make use of clk_prepare_enable and clk_disable_unprepare to simplify code. No functional change. Cc: Mark Brown Signed-off-by: Ulf Hansson --- drivers/spi/spi-pl022.c | 15 +++ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi

[PATCH 05/17] mmc: mmci: Put the device into low power state at system suspend

2014-02-04 Thread Ulf Hansson
Due to the available runtime PM callbacks, we are now able to put our device into low power state at system suspend. Earlier we could not accomplish this without trusting a power domain for the device to take care of it. Now we are able to cope with scenarios both with and without a power domain.

[PATCH 10/17] spi: pl022: Remove redundant pinctrl to default state in probe

2014-02-04 Thread Ulf Hansson
The driver core is now taking care of putting our pins into default state at probe. Thus we can remove the redundant call for it in probe. Cc: Mark Brown Signed-off-by: Ulf Hansson --- drivers/spi/spi-pl022.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/spi/spi-pl022.c b/driv

[PATCH 12/17] i2c: nomadik: Remove redundant call to pm_runtime_disable

2014-02-04 Thread Ulf Hansson
The amba bus are responsible for pm_runtime_enable|disable, remove the redundant pm_runtime_disable at driver removal. Cc: Alessandro Rubini Cc: Linus Walleij Cc: Wolfram Sang Signed-off-by: Ulf Hansson --- drivers/i2c/busses/i2c-nomadik.c |1 - 1 file changed, 1 deletion(-) diff --git a

[PATCH 15/17] i2c: nomadik: Convert to late and early system PM callbacks

2014-02-04 Thread Ulf Hansson
At system suspend_late, runtime PM has been disabled by the PM core which means we can safely operate on these resources. Consequentially we no longer have to wait until the noirq phase of the system suspend. Cc: Alessandro Rubini Cc: Linus Walleij Cc: Wolfram Sang Signed-off-by: Ulf Hansson -

[PATCH 14/17] i2c: nomadik: Fixup deployment of runtime PM

2014-02-04 Thread Ulf Hansson
Since the device is active while a successful probe has been completed, the reference counting for the clock will be screwed up and never reach zero. The issue is resolved by implementing runtime PM callbacks and let them handle the resources accordingly, including the clock. Cc: Alessandro Rubin

[PATCH 11/17] i2c: nomadik: Convert to devm functions

2014-02-04 Thread Ulf Hansson
Use devm_* functions to simplify code and error handling. Cc: Alessandro Rubini Cc: Linus Walleij Cc: Wolfram Sang Signed-off-by: Ulf Hansson --- drivers/i2c/busses/i2c-nomadik.c | 29 + 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/i2c/b

[PATCH 17/17] i2c: nomadik: Fixup system suspend

2014-02-04 Thread Ulf Hansson
For !CONFIG_PM_RUNTIME, the device were never put back into active state while resuming. For CONFIG_PM_RUNTIME, we blindly trusted the device to be inactive while we were about to handle it at suspend late, which is just too optimistic. Even if the driver uses pm_runtime_put_sync() after each tra

[PATCH 13/17] i2c: nomadik: Leave probe with the device in active state

2014-02-04 Thread Ulf Hansson
Since the runtime PM state is expected to be active according to the amba bus, we must align our behaviour while probing to it. Moreover, this is needed to be able to have the driver fully functional without depending on CONFIG_RUNTIME_PM. Cc: Alessandro Rubini Cc: Linus Walleij Cc: Wolfram San

[PATCH 16/17] i2c: nomadik: Remove busy check for transfers at suspend late

2014-02-04 Thread Ulf Hansson
We should never be busy performing transfers at suspend late, thus there are no reason to check for it. Cc: Alessandro Rubini Cc: Linus Walleij Cc: Wolfram Sang Signed-off-by: Ulf Hansson --- drivers/i2c/busses/i2c-nomadik.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/dri

[PATCH 00/17] amba: PM fixups for amba bus and some amba drivers

2014-02-04 Thread Ulf Hansson
This patchset fixes the PM problems you yet when combining CONFIG_PM_SLEEP and CONFIG_PM_RUNTIME. In principle these drivers did not manage to put it's devices into low power state at system suspend, which then this patchset intend to fix. Both the drivers and the amba bus converts to the new SET_

Re: [PATCH 3/6] mfd: add bcm59056 pmu driver

2014-02-04 Thread Lee Jones
> > ... then you'll still need this. > > Yes, I was far too vague..I'm going to stop explicitly populating the > data field. > > static const struct of_device_id bcm59056_of_match[] = { > { .compatible = "brcm,bcm59056"}, > { } > }; +1 > > And I don't think you can drop this, as the

Re: [PATCH 3/6] mfd: add bcm59056 pmu driver

2014-02-04 Thread Matt Porter
On Tue, Feb 04, 2014 at 02:47:31PM +, Lee Jones wrote: > Hold your horses. :) Holding :) > > > > Add a driver for the BCM59056 PMU multi-function device. The driver > > > > initially supports regmap initialization and instantiation of the > > > > voltage regulator device function of the PMU.

Re: [PATCH 3/6] mfd: add bcm59056 pmu driver

2014-02-04 Thread Lee Jones
Hold your horses. :) > > > Add a driver for the BCM59056 PMU multi-function device. The driver > > > initially supports regmap initialization and instantiation of the > > > voltage regulator device function of the PMU. > > > > > > Signed-off-by: Matt Porter > > > Reviewed-by: Tim Kryger > > > R

Re: [PATCH 0/6] BCM59056 PMU regulator support

2014-02-04 Thread Matt Porter
On Tue, Feb 04, 2014 at 01:40:43PM +, Lee Jones wrote: > > The BCM59056 is a multi-function power management unit used with the > > BCM281xx family of SoCs. This series adds an MFD and voltage regulator > > driver to support the BCM59056. The bcm28155-ap DT support is updated > > to enable use

[PATCH] i2c: designware-pci: Add Baytrail PCI IDs

2014-02-04 Thread Mika Westerberg
Intel Baytrail I2C controllers can be enumerated from PCI as well as from ACPI. In order to support this add the Baytrail PCI IDs to the driver. Signed-off-by: Mika Westerberg --- drivers/i2c/busses/i2c-designware-pcidrv.c | 25 +++-- 1 file changed, 23 insertions(+), 2 delet

Re: [PATCH 3/6] mfd: add bcm59056 pmu driver

2014-02-04 Thread Matt Porter
On Tue, Feb 04, 2014 at 01:29:51PM +, Lee Jones wrote: > > Add a driver for the BCM59056 PMU multi-function device. The driver > > initially supports regmap initialization and instantiation of the > > voltage regulator device function of the PMU. > > > > Signed-off-by: Matt Porter > > Reviewe

Re: [PATCH 0/6] BCM59056 PMU regulator support

2014-02-04 Thread Lee Jones
> The BCM59056 is a multi-function power management unit used with the > BCM281xx family of SoCs. This series adds an MFD and voltage regulator > driver to support the BCM59056. The bcm28155-ap DT support is updated > to enable use of regulators on the otg and sdhci peripherals. > > Matt Porter (6

Re: [PATCH 3/6] mfd: add bcm59056 pmu driver

2014-02-04 Thread Lee Jones
> Add a driver for the BCM59056 PMU multi-function device. The driver > initially supports regmap initialization and instantiation of the > voltage regulator device function of the PMU. > > Signed-off-by: Matt Porter > Reviewed-by: Tim Kryger > Reviewed-by: Markus Mayer > --- > drivers/mfd/Kco

[PATCH] i2c: designware-pci: Cleanup driver power management

2014-02-04 Thread Mika Westerberg
The PCI part of the DesignWare I2C driver does a lot of things that are not required anymore. For example drivers aren't supposed to handle PCI state transitions themselves. This is all provided by the PCI bus core already. In addition to that there is no point scheduling RPM suspend on driver's i

[PATCH 5/6] ARM: configs: bcm_defconfig: enable bcm59056 regulator support

2014-02-04 Thread Matt Porter
Enable BCM59056 MFD and regulator drivers to manage voltage regulators on BCM281xx platforms. Signed-off-by: Tim Kryger Signed-off-by: Matt Porter Reviewed-by: Markus Mayer --- arch/arm/configs/bcm_defconfig | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/configs/bcm_defcon

[PATCH 1/6] i2c: bcm-kona: register with subsys_initcall

2014-02-04 Thread Matt Porter
Voltage regulators are needed very early due to deferred probe being incompatible with built-in USB gadget drivers. In order to have the PMU driver available before USB UDC, make i2c available during subsys_initcall. Signed-off-by: Matt Porter Reviewed-by: Tim Kryger Reviewed-by: Markus Mayer -

[PATCH 4/6] regulator: add bcm59056 regulator driver

2014-02-04 Thread Matt Porter
Add a regulator driver for the BCM59056 PMU voltage regulators. The driver supports LDOs and DCDCs in normal mode only. There is no support for low-power mode or power sequencing. Signed-off-by: Matt Porter Reviewed-by: Tim Kryger Reviewed-by: Markus Mayer --- drivers/regulator/Kconfig

[PATCH 2/6] regulator: add bcm59056 pmu DT binding

2014-02-04 Thread Matt Porter
Add a DT binding for the BCM59056 PMU. The binding inherits from the generic regulator bindings. Signed-off-by: Matt Porter Reviewed-by: Tim Kryger Reviewed-by: Markus Mayer --- .../devicetree/bindings/regulator/bcm59056.txt | 37 ++ 1 file changed, 37 insertions(+) cr

[PATCH 6/6] ARM: dts: add bcm59056 pmu support and enable for bcm28155-ap

2014-02-04 Thread Matt Porter
Add a dtsi to support the BCM59056 PMU used by the BCM281xx family of SoCs. Enable regulators for use with the dwc2 and sdhci on bcm28155-ap. Signed-off-by: Tim Kryger Signed-off-by: Matt Porter Reviewed-by: Markus Mayer --- arch/arm/boot/dts/bcm28155-ap.dts | 41 ++ arch/arm/boot/dts

[PATCH 3/6] mfd: add bcm59056 pmu driver

2014-02-04 Thread Matt Porter
Add a driver for the BCM59056 PMU multi-function device. The driver initially supports regmap initialization and instantiation of the voltage regulator device function of the PMU. Signed-off-by: Matt Porter Reviewed-by: Tim Kryger Reviewed-by: Markus Mayer --- drivers/mfd/Kconfig |

[PATCH 0/6] BCM59056 PMU regulator support

2014-02-04 Thread Matt Porter
The BCM59056 is a multi-function power management unit used with the BCM281xx family of SoCs. This series adds an MFD and voltage regulator driver to support the BCM59056. The bcm28155-ap DT support is updated to enable use of regulators on the otg and sdhci peripherals. Matt Porter (6): i2c: bc

Re: [PATCH] i2c: designware-pci: Add CONFIG_PM_RUNTIME to i2c_dw_pci_runtime_idle()

2014-02-04 Thread 'Mika Westerberg'
On Tue, Feb 04, 2014 at 02:50:46PM +0900, Jingoo Han wrote: > Add CONFIG_PM_RUNTIME to i2c_dw_pci_runtime_idle() to fix the > build warning when CONFIG_PM_RUNTIME is not selected. This is > because runtime PM callbacks defined by SET_RUNTIME_PM_OPS are > only used when the CONFIG_PM_RUNTIME is enab