Re: [PATCH v2] ARM: dts: remove bcm11351-brt.dts
On Wed, Feb 19, 2014 at 04:31:52PM -0500, Matt Porter wrote: > The BCM11351 BRT board will never see the light of day. Remove the BRT > dts since it is not maintainable. > > Reviewed-by: Alex Elder > Signed-off-by: Matt Porter > --- > Changes since v1: > - remove bcm11351-brt from Makefile > Applied to mach-bcm for-3.15/dt -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] ARM: dts: remove bcm11351-brt.dts
On Wed, Feb 19, 2014 at 04:31:52PM -0500, Matt Porter wrote: The BCM11351 BRT board will never see the light of day. Remove the BRT dts since it is not maintainable. Reviewed-by: Alex Elder el...@linaro.org Signed-off-by: Matt Porter mpor...@linaro.org --- Changes since v1: - remove bcm11351-brt from Makefile Applied to mach-bcm for-3.15/dt -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] ARM: dts: Leave sdio1 as disabled on bcm28155-ap
On Tue, Feb 04, 2014 at 03:27:40PM -0800, Tim Kryger wrote: > The sdio1 interface pins are routed to an unpopulated daughter card > connector on the bcm28155-ap board. Thus there is no need to mark > this interface as enabled. > > Signed-off-by: Tim Kryger > Reviewed-by: Matt Porter Applied to mach-bcm armsoc/for-3.15/dt -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 5/8] mmc: sdhci-bcm-kona: Add basic use of clocks
[trimmed cc] On Fri, Jan 24, 2014 at 09:07:24AM -0800, Tim Kryger wrote: > On Tue, Jan 7, 2014 at 11:37 AM, Tim Kryger wrote: > > On Sat, Dec 14, 2013 at 12:14 AM, Christian Daudt > > wrote: > >> On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger wrote: > >>> Enable the external clock needed by the host controller during the > >>> probe and disable it during the remove. > >>> > >>> Signed-off-by: Tim Kryger > >>> Reviewed-by: Markus Mayer > >>> Reviewed-by: Matt Porter > >> > >> Reviewed-by: Christian Daudt > >> > >> Chris, > >> Are you ok with me pulling this patch along with the rest of the > >> patchset into the bcm tree? > >> > >> Thanks, > >>csd > > > > Chris, > > > > Can you please provide an answer to csd? > > > > Thanks, > > Tim Kryger > > Chris, > > I haven't heard back so this patch has been dropped for 3.14 to allow > the remaining patches in the series to move forward. As such, I will > be re-posting this patch for 3.15. It is essential for the > bcm28155_ap board to transition away from fake fixed clocks to the > real clock driver. This is because the bcm281xx clock driver does not > set the CLK_IGNORE_UNUSED flag for the SDHCI peripheral clocks and the > common clock code will shut them off in late init unless the SDHCI > driver has asked for them to be enabled. I just queued Alex's patch for 3.15 that decouples the dependency between this patch and the bcm kona common clock driver. Chris: we no longer need this to be taken through arm-soc since removing the dependency. Could you please take this patch through your tree for 3.15? Thanks, Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [GIT PULL] bcm pinctrl rename
On Mon, Feb 24, 2014 at 09:32:47AM -0800, Christian Daudt wrote: > On Fri, Feb 21, 2014 at 2:29 PM, Olof Johansson wrote: > > On Wed, Feb 12, 2014 at 09:20:13AM -0800, Christian Daudt wrote: > >> The following changes since commit > >> b28a960c42fcd9cfc987441fa6d1c1a471f0f9ed: > >> > >> Linux 3.14-rc2 (2014-02-09 18:15:47 -0800) > >> > >> are available in the git repository at: > >> > >> git://github.com/broadcom/bcm11351.git tags/bcm-for-3.14-pinctrl-rename > >> > >> for you to fetch changes up to f5310a1712b68c7f83539fce6ebbfb6f0f510f5b: > >> > >> Update dtsi with new pinctrl compatible string (2014-02-12 09:06:53 > >> -0800) > >> > >> > >> Renaming pinctrl code to keep in line with rest of bcm mobile > >> > >> Given that this driver has been in the works for a while, it > >> was written prior to the code standardizing on bcm-based naming. > >> this patchset brings it in line with the remainder of the code. > >> > >> > >> Sherman Yin (4): > >> pinctrl: Rename Broadcom Capri pinctrl binding > >> pinctrl: Rename Broadcom Capri pinctrl driver > >> Update bcm_defconfig with new pinctrl CONFIG > >> Update dtsi with new pinctrl compatible string > > > > Hi, > > > > (As per irc discussion). The rename isn't the right thing to do at this > > time in the release, but the binding needs to be tweaked before it ships > > in a full release, or we'll always need to live with it. > > > > So, I'll be happy to take the bindings piece and the dtsi piece (and the > > small edit to the driver to change the compatible string match table), > > but the file rename and Kconfig entry edit is 3.15 material. > > > > Please send new pull request with just that (or, if you prefer, just send > > the > > patches and we can apply them too). > > > > > > -Olof > > Ok, I have this ready to go, just need an ack for this patch (which > will replace "pinctrl: Rename Broadcom Capri pinctrl driver"): > Subject: [PATCH] pinctrl: refer to updated dt binding string. > > Bring the driver in line with the bcm-based dt name for pinctrl. > This is being done to keep consistency with other Broadcom mobile > SoC drivers. > > Signed-off-by: Christian Daudt > > diff --git a/drivers/pinctrl/pinctrl-capri.c b/drivers/pinctrl/pinctrl-capri.c > index 4669c53..eb25002 100644 > --- a/drivers/pinctrl/pinctrl-capri.c > +++ b/drivers/pinctrl/pinctrl-capri.c > @@ -1435,7 +1435,7 @@ int __init capri_pinctrl_probe(struct > platform_device *pdev) > } > > static struct of_device_id capri_pinctrl_of_match[] = { > - { .compatible = "brcm,capri-pinctrl", }, > + { .compatible = "brcm,bcm11351-pinctrl", }, > { }, > }; Looks good. Does the binding rename patch stay as is? Reviewed-by: Matt Porter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [GIT PULL] bcm pinctrl rename
On Mon, Feb 24, 2014 at 09:32:47AM -0800, Christian Daudt wrote: On Fri, Feb 21, 2014 at 2:29 PM, Olof Johansson o...@lixom.net wrote: On Wed, Feb 12, 2014 at 09:20:13AM -0800, Christian Daudt wrote: The following changes since commit b28a960c42fcd9cfc987441fa6d1c1a471f0f9ed: Linux 3.14-rc2 (2014-02-09 18:15:47 -0800) are available in the git repository at: git://github.com/broadcom/bcm11351.git tags/bcm-for-3.14-pinctrl-rename for you to fetch changes up to f5310a1712b68c7f83539fce6ebbfb6f0f510f5b: Update dtsi with new pinctrl compatible string (2014-02-12 09:06:53 -0800) Renaming pinctrl code to keep in line with rest of bcm mobile Given that this driver has been in the works for a while, it was written prior to the code standardizing on bcm-based naming. this patchset brings it in line with the remainder of the code. Sherman Yin (4): pinctrl: Rename Broadcom Capri pinctrl binding pinctrl: Rename Broadcom Capri pinctrl driver Update bcm_defconfig with new pinctrl CONFIG Update dtsi with new pinctrl compatible string Hi, (As per irc discussion). The rename isn't the right thing to do at this time in the release, but the binding needs to be tweaked before it ships in a full release, or we'll always need to live with it. So, I'll be happy to take the bindings piece and the dtsi piece (and the small edit to the driver to change the compatible string match table), but the file rename and Kconfig entry edit is 3.15 material. Please send new pull request with just that (or, if you prefer, just send the patches and we can apply them too). -Olof Ok, I have this ready to go, just need an ack for this patch (which will replace pinctrl: Rename Broadcom Capri pinctrl driver): Subject: [PATCH] pinctrl: refer to updated dt binding string. Bring the driver in line with the bcm-based dt name for pinctrl. This is being done to keep consistency with other Broadcom mobile SoC drivers. Signed-off-by: Christian Daudt b...@fixthebug.org diff --git a/drivers/pinctrl/pinctrl-capri.c b/drivers/pinctrl/pinctrl-capri.c index 4669c53..eb25002 100644 --- a/drivers/pinctrl/pinctrl-capri.c +++ b/drivers/pinctrl/pinctrl-capri.c @@ -1435,7 +1435,7 @@ int __init capri_pinctrl_probe(struct platform_device *pdev) } static struct of_device_id capri_pinctrl_of_match[] = { - { .compatible = brcm,capri-pinctrl, }, + { .compatible = brcm,bcm11351-pinctrl, }, { }, }; Looks good. Does the binding rename patch stay as is? Reviewed-by: Matt Porter mpor...@linaro.org -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 5/8] mmc: sdhci-bcm-kona: Add basic use of clocks
[trimmed cc] On Fri, Jan 24, 2014 at 09:07:24AM -0800, Tim Kryger wrote: On Tue, Jan 7, 2014 at 11:37 AM, Tim Kryger tim.kry...@linaro.org wrote: On Sat, Dec 14, 2013 at 12:14 AM, Christian Daudt b...@fixthebug.org wrote: On Thu, Dec 5, 2013 at 11:20 AM, Tim Kryger tim.kry...@linaro.org wrote: Enable the external clock needed by the host controller during the probe and disable it during the remove. Signed-off-by: Tim Kryger tim.kry...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org Reviewed-by: Matt Porter matt.por...@linaro.org Reviewed-by: Christian Daudt b...@fixthebug.org Chris, Are you ok with me pulling this patch along with the rest of the patchset into the bcm tree? Thanks, csd Chris, Can you please provide an answer to csd? Thanks, Tim Kryger Chris, I haven't heard back so this patch has been dropped for 3.14 to allow the remaining patches in the series to move forward. As such, I will be re-posting this patch for 3.15. It is essential for the bcm28155_ap board to transition away from fake fixed clocks to the real clock driver. This is because the bcm281xx clock driver does not set the CLK_IGNORE_UNUSED flag for the SDHCI peripheral clocks and the common clock code will shut them off in late init unless the SDHCI driver has asked for them to be enabled. I just queued Alex's patch for 3.15 that decouples the dependency between this patch and the bcm kona common clock driver. Chris: we no longer need this to be taken through arm-soc since removing the dependency. Could you please take this patch through your tree for 3.15? Thanks, Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] ARM: dts: Leave sdio1 as disabled on bcm28155-ap
On Tue, Feb 04, 2014 at 03:27:40PM -0800, Tim Kryger wrote: The sdio1 interface pins are routed to an unpopulated daughter card connector on the bcm28155-ap board. Thus there is no need to mark this interface as enabled. Signed-off-by: Tim Kryger tim.kry...@linaro.org Reviewed-by: Matt Porter matt.por...@linaro.org Applied to mach-bcm armsoc/for-3.15/dt -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ARM: bcm2835: Move to mach-bcm directory
On Fri, Feb 21, 2014 at 09:41:53AM -0800, Markus Mayer wrote: > On 21 February 2014 06:09, Matt Porter wrote: > > On Thu, Feb 20, 2014 at 09:53:56PM -0700, Stephen Warren wrote: > >> On 02/20/2014 05:16 PM, Markus Mayer wrote: > >> > Move the bcm2835 board file into the mach-bcm directory. This allows us > >> > to get rid of the mach-bcm2835 directory with the associated Kconfig > >> > and Makefile. > >> > >> This looks fine, although it needs a small patch to bcm2835_defconfig > >> squashed in, which I'll post in a second. > >> > >> Do you want me to take it through the bcm2835 tree? That's probably > >> easiest to avoid conflicts with any other bcm2835 patches, not that it's > >> too likely there will be any to the board file. > > > > That's ok with me. Be aware that we may have minor Kconfig/Makefile > > conflicts between the bcm2835 tree and the mach-bcm tree since we just > > queued the bcm5301x support. > > Matt, will you squash Stephen's patch into mine when you take the > patches or should I submit a v2 of the patch that combines both? I think Stephen prefers to take this through the bcm2835 tree so I'll let him weigh in on that. -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v6 0/8] ARM: brcmstb: Add Broadcom STB SoC support
On Thu, Feb 20, 2014 at 04:41:32PM -0800, Florian Fainelli wrote: > Matt, > > 2014-02-03 13:30 GMT-08:00 Marc Carino : > > This patchset contains the board support package for the > > Broadcom BCM7445 ARM-based SoC [1]. These changes contain a > > minimal set of code needed for a BCM7445-based board to boot > > the Linux kernel. > > If you are happy with this round of changes, can you also carry those > patches in your tree for 3.15? I had to add a couple trivial comments on the dts that I missed back in v2. More importantly, you'll need to collect some acks on various pieces. In particular the power/reset driver needs a maintainer ack to go in via arm-soc. I'd also like to see an ack from Arnd since he provided a lot of the comments. Also, we need Russell's ack on the debug and proc-v7.S patches. I'll note that the drivers/power maintainers aren't cced on this posting so they probably didn't notice that driver. -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v6 8/8] ARM: brcmstb: dts: add a reference DTS for Broadcom 7445
On Mon, Feb 03, 2014 at 01:30:41PM -0800, Marc Carino wrote: > Add a sample DTS which will allow bootup of a board populated > with the BCM7445 chip. > > Signed-off-by: Marc Carino > Acked-by: Florian Fainelli > --- > arch/arm/boot/dts/bcm7445.dts | 111 > + > 1 files changed, 111 insertions(+), 0 deletions(-) > create mode 100644 arch/arm/boot/dts/bcm7445.dts Looking forward, I suspect you are going to have to move to a bcm7445.dtsi with your board specific implementations in something like bcm7445-myrefbrd.dts. It's probably better to split this now to encourage inclusion of the common SoC nodes from the board specific dts. Since it's not abstracted this way it'll encourage people to just copy the entire bcm7445.dts for their board. > diff --git a/arch/arm/boot/dts/bcm7445.dts b/arch/arm/boot/dts/bcm7445.dts > new file mode 100644 > index 000..ffa3305 > --- /dev/null > +++ b/arch/arm/boot/dts/bcm7445.dts > @@ -0,0 +1,111 @@ > +/dts-v1/; > +/include/ "skeleton.dtsi" > + > +/ { > + #address-cells = <2>; > + #size-cells = <2>; > + model = "Broadcom STB (bcm7445)"; > + compatible = "brcm,bcm7445", "brcm,brcmstb"; > + interrupt-parent = <>; > + > + chosen {}; > + > + memory { > + device_type = "memory"; > + reg = <0x00 0x 0x00 0x4000>, > + <0x00 0x4000 0x00 0x4000>, > + <0x00 0x8000 0x00 0x4000>; > + }; > + > + cpus { > + #address-cells = <1>; > + #size-cells = <0>; > + > + cpu@0 { > + compatible = "brcm,brahma-b15"; > + device_type = "cpu"; > + reg = <0>; > + }; > + > + cpu@1 { > + compatible = "brcm,brahma-b15"; > + device_type = "cpu"; > + reg = <1>; > + }; > + > + cpu@2 { > + compatible = "brcm,brahma-b15"; > + device_type = "cpu"; > + reg = <2>; > + }; > + > + cpu@3 { > + compatible = "brcm,brahma-b15"; > + device_type = "cpu"; > + reg = <3>; > + }; > + }; > + > + gic: interrupt-controller@ffd0 { > + compatible = "brcm,brahma-b15-gic", "arm,cortex-a15-gic"; > + reg = <0x00 0xffd01000 0x00 0x1000>, > + <0x00 0xffd02000 0x00 0x2000>, > + <0x00 0xffd04000 0x00 0x2000>, > + <0x00 0xffd06000 0x00 0x2000>; > + interrupt-controller; > + #interrupt-cells = <3>; > + }; > + > + timer { > + compatible = "arm,armv7-timer"; > + interrupts = <1 13 0xf08>, > + <1 14 0xf08>, > + <1 11 0xf08>, > + <1 10 0xf08>; These should leverage the preprocessor defines that are available e.g. interrupts = , ... > + }; > + > + rdb { > + #address-cells = <1>; > + #size-cells = <1>; > + compatible = "simple-bus"; > + ranges = <0 0x00 0xf000 0x100>; > + > + serial@406b00 { > + compatible = "ns16550a"; > + reg = <0x406b00 0x20>; > + reg-shift = <2>; > + reg-io-width = <4>; > + interrupts = <0 75 0x4>; same here: interrupt = ; -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ARM: bcm2835: Move to mach-bcm directory
On Thu, Feb 20, 2014 at 09:53:56PM -0700, Stephen Warren wrote: > On 02/20/2014 05:16 PM, Markus Mayer wrote: > > Move the bcm2835 board file into the mach-bcm directory. This allows us > > to get rid of the mach-bcm2835 directory with the associated Kconfig > > and Makefile. > > This looks fine, although it needs a small patch to bcm2835_defconfig > squashed in, which I'll post in a second. > > Do you want me to take it through the bcm2835 tree? That's probably > easiest to avoid conflicts with any other bcm2835 patches, not that it's > too likely there will be any to the board file. That's ok with me. Be aware that we may have minor Kconfig/Makefile conflicts between the bcm2835 tree and the mach-bcm tree since we just queued the bcm5301x support. -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ARM: bcm2835: Move to mach-bcm directory
On Thu, Feb 20, 2014 at 09:53:56PM -0700, Stephen Warren wrote: On 02/20/2014 05:16 PM, Markus Mayer wrote: Move the bcm2835 board file into the mach-bcm directory. This allows us to get rid of the mach-bcm2835 directory with the associated Kconfig and Makefile. This looks fine, although it needs a small patch to bcm2835_defconfig squashed in, which I'll post in a second. Do you want me to take it through the bcm2835 tree? That's probably easiest to avoid conflicts with any other bcm2835 patches, not that it's too likely there will be any to the board file. That's ok with me. Be aware that we may have minor Kconfig/Makefile conflicts between the bcm2835 tree and the mach-bcm tree since we just queued the bcm5301x support. -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v6 8/8] ARM: brcmstb: dts: add a reference DTS for Broadcom 7445
On Mon, Feb 03, 2014 at 01:30:41PM -0800, Marc Carino wrote: Add a sample DTS which will allow bootup of a board populated with the BCM7445 chip. Signed-off-by: Marc Carino marc.cee...@gmail.com Acked-by: Florian Fainelli f.faine...@gmail.com --- arch/arm/boot/dts/bcm7445.dts | 111 + 1 files changed, 111 insertions(+), 0 deletions(-) create mode 100644 arch/arm/boot/dts/bcm7445.dts Looking forward, I suspect you are going to have to move to a bcm7445.dtsi with your board specific implementations in something like bcm7445-myrefbrd.dts. It's probably better to split this now to encourage inclusion of the common SoC nodes from the board specific dts. Since it's not abstracted this way it'll encourage people to just copy the entire bcm7445.dts for their board. diff --git a/arch/arm/boot/dts/bcm7445.dts b/arch/arm/boot/dts/bcm7445.dts new file mode 100644 index 000..ffa3305 --- /dev/null +++ b/arch/arm/boot/dts/bcm7445.dts @@ -0,0 +1,111 @@ +/dts-v1/; +/include/ skeleton.dtsi + +/ { + #address-cells = 2; + #size-cells = 2; + model = Broadcom STB (bcm7445); + compatible = brcm,bcm7445, brcm,brcmstb; + interrupt-parent = gic; + + chosen {}; + + memory { + device_type = memory; + reg = 0x00 0x 0x00 0x4000, + 0x00 0x4000 0x00 0x4000, + 0x00 0x8000 0x00 0x4000; + }; + + cpus { + #address-cells = 1; + #size-cells = 0; + + cpu@0 { + compatible = brcm,brahma-b15; + device_type = cpu; + reg = 0; + }; + + cpu@1 { + compatible = brcm,brahma-b15; + device_type = cpu; + reg = 1; + }; + + cpu@2 { + compatible = brcm,brahma-b15; + device_type = cpu; + reg = 2; + }; + + cpu@3 { + compatible = brcm,brahma-b15; + device_type = cpu; + reg = 3; + }; + }; + + gic: interrupt-controller@ffd0 { + compatible = brcm,brahma-b15-gic, arm,cortex-a15-gic; + reg = 0x00 0xffd01000 0x00 0x1000, + 0x00 0xffd02000 0x00 0x2000, + 0x00 0xffd04000 0x00 0x2000, + 0x00 0xffd06000 0x00 0x2000; + interrupt-controller; + #interrupt-cells = 3; + }; + + timer { + compatible = arm,armv7-timer; + interrupts = 1 13 0xf08, + 1 14 0xf08, + 1 11 0xf08, + 1 10 0xf08; These should leverage the preprocessor defines that are available e.g. interrupts = GIC_PPI 13 GIC_CPU_MASK_RAW(15)|IRQ_TYPE_LEVEL_LOW, ... + }; + + rdb { + #address-cells = 1; + #size-cells = 1; + compatible = simple-bus; + ranges = 0 0x00 0xf000 0x100; + + serial@406b00 { + compatible = ns16550a; + reg = 0x406b00 0x20; + reg-shift = 2; + reg-io-width = 4; + interrupts = 0 75 0x4; same here: interrupt = GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH; -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v6 0/8] ARM: brcmstb: Add Broadcom STB SoC support
On Thu, Feb 20, 2014 at 04:41:32PM -0800, Florian Fainelli wrote: Matt, 2014-02-03 13:30 GMT-08:00 Marc Carino marc.cee...@gmail.com: This patchset contains the board support package for the Broadcom BCM7445 ARM-based SoC [1]. These changes contain a minimal set of code needed for a BCM7445-based board to boot the Linux kernel. If you are happy with this round of changes, can you also carry those patches in your tree for 3.15? I had to add a couple trivial comments on the dts that I missed back in v2. More importantly, you'll need to collect some acks on various pieces. In particular the power/reset driver needs a maintainer ack to go in via arm-soc. I'd also like to see an ack from Arnd since he provided a lot of the comments. Also, we need Russell's ack on the debug and proc-v7.S patches. I'll note that the drivers/power maintainers aren't cced on this posting so they probably didn't notice that driver. -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ARM: bcm2835: Move to mach-bcm directory
On Fri, Feb 21, 2014 at 09:41:53AM -0800, Markus Mayer wrote: On 21 February 2014 06:09, Matt Porter mpor...@linaro.org wrote: On Thu, Feb 20, 2014 at 09:53:56PM -0700, Stephen Warren wrote: On 02/20/2014 05:16 PM, Markus Mayer wrote: Move the bcm2835 board file into the mach-bcm directory. This allows us to get rid of the mach-bcm2835 directory with the associated Kconfig and Makefile. This looks fine, although it needs a small patch to bcm2835_defconfig squashed in, which I'll post in a second. Do you want me to take it through the bcm2835 tree? That's probably easiest to avoid conflicts with any other bcm2835 patches, not that it's too likely there will be any to the board file. That's ok with me. Be aware that we may have minor Kconfig/Makefile conflicts between the bcm2835 tree and the mach-bcm tree since we just queued the bcm5301x support. Matt, will you squash Stephen's patch into mine when you take the patches or should I submit a v2 of the patch that combines both? I think Stephen prefers to take this through the bcm2835 tree so I'll let him weigh in on that. -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2 2/3] clk: bcm281xx: don't disable unused peripheral clocks
On Fri, Feb 14, 2014 at 12:29:19PM -0600, Alex Elder wrote: > Add the CLK_IGNORE_UNUSED flag when setting up a peripheral clock. > This prevents unused clocks from getting disabled, and by doing > this we can use the common clock code even before we've resolved > all the spots that need to get a reference to their clock. > > Signed-off-by: Alex Elder > Reviewed-by: Matt Porter Mike: if you'll provide your ack on this patch, we would like to take the entire series through arm-soc for 3.15 as we originally agreed for 3.14. Patches 1 and 3 are the original two you acked for 3.14 but had to be dropped late in the merge window. Thanks, Matt > --- > drivers/clk/bcm/clk-kona-setup.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/clk/bcm/clk-kona-setup.c > b/drivers/clk/bcm/clk-kona-setup.c > index f1e88fe..c7607fe 100644 > --- a/drivers/clk/bcm/clk-kona-setup.c > +++ b/drivers/clk/bcm/clk-kona-setup.c > @@ -579,7 +579,7 @@ static int peri_clk_setup(struct ccu_data *ccu, struct > peri_clk_data *data, > struct clk_init_data *init_data) > { > init_data->ops = _peri_clk_ops; > - init_data->flags = 0; > + init_data->flags = CLK_IGNORE_UNUSED; > > return clk_sel_setup(data->clocks, >sel, init_data); > } > -- > 1.7.9.5 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2 2/3] clk: bcm281xx: don't disable unused peripheral clocks
On Fri, Feb 14, 2014 at 12:29:19PM -0600, Alex Elder wrote: Add the CLK_IGNORE_UNUSED flag when setting up a peripheral clock. This prevents unused clocks from getting disabled, and by doing this we can use the common clock code even before we've resolved all the spots that need to get a reference to their clock. Signed-off-by: Alex Elder el...@linaro.org Reviewed-by: Matt Porter mpor...@linaro.org Mike: if you'll provide your ack on this patch, we would like to take the entire series through arm-soc for 3.15 as we originally agreed for 3.14. Patches 1 and 3 are the original two you acked for 3.14 but had to be dropped late in the merge window. Thanks, Matt --- drivers/clk/bcm/clk-kona-setup.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/bcm/clk-kona-setup.c b/drivers/clk/bcm/clk-kona-setup.c index f1e88fe..c7607fe 100644 --- a/drivers/clk/bcm/clk-kona-setup.c +++ b/drivers/clk/bcm/clk-kona-setup.c @@ -579,7 +579,7 @@ static int peri_clk_setup(struct ccu_data *ccu, struct peri_clk_data *data, struct clk_init_data *init_data) { init_data-ops = kona_peri_clk_ops; - init_data-flags = 0; + init_data-flags = CLK_IGNORE_UNUSED; return clk_sel_setup(data-clocks, data-sel, init_data); } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2] ARM: dts: remove bcm11351-brt.dts
The BCM11351 BRT board will never see the light of day. Remove the BRT dts since it is not maintainable. Reviewed-by: Alex Elder Signed-off-by: Matt Porter --- Changes since v1: - remove bcm11351-brt from Makefile arch/arm/boot/dts/Makefile | 3 +-- arch/arm/boot/dts/bcm11351-brt.dts | 54 -- 2 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 arch/arm/boot/dts/bcm11351-brt.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 6d1e43d..faf4676 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -47,8 +47,7 @@ dtb-$(CONFIG_ARCH_AT91) += sama5d36ek.dtb dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb -dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm11351-brt.dtb \ - bcm28155-ap.dtb +dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm28155-ap.dtb dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb dtb-$(CONFIG_ARCH_BERLIN) += \ berlin2-sony-nsz-gs7.dtb\ diff --git a/arch/arm/boot/dts/bcm11351-brt.dts b/arch/arm/boot/dts/bcm11351-brt.dts deleted file mode 100644 index 396b704..000 --- a/arch/arm/boot/dts/bcm11351-brt.dts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2012 Broadcom Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -/dts-v1/; - -#include "bcm11351.dtsi" - -/ { - model = "BCM11351 BRT board"; - compatible = "brcm,bcm11351-brt", "brcm,bcm11351"; - - memory { - reg = <0x8000 0x4000>; /* 1 GB */ - }; - - uart@3e00 { - status = "okay"; - }; - - sdio1: sdio@3f18 { - max-frequency = <4800>; - status = "okay"; - }; - - sdio2: sdio@3f19 { - non-removable; - max-frequency = <4800>; - status = "okay"; - }; - - sdio4: sdio@3f1b { - max-frequency = <4800>; - cd-gpios = < 14 0>; - status = "okay"; - }; - - usbotg: usb@3f12 { - status = "okay"; - }; - - usbphy: usb-phy@3f13 { - status = "okay"; - }; -}; -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ARM: dts: remove bcm11351-brt.dts
On Wed, Feb 19, 2014 at 03:21:29PM -0600, Alex Elder wrote: > On 02/19/2014 02:13 PM, Matt Porter wrote: > > The BCM11351 BRT board will never see the light of day. Remove the BRT > > dts since it is not maintainable. > > > > Signed-off-by: Matt Porter > > Please remove the line in the Makefile that refers to this file. > Provided you make that change, it looks good to me. > > Reviewed-by: Alex Elder Done, thanks. -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ARM: dts: remove bcm11351-brt.dts
The BCM11351 BRT board will never see the light of day. Remove the BRT dts since it is not maintainable. Signed-off-by: Matt Porter --- arch/arm/boot/dts/bcm11351-brt.dts | 54 -- 1 file changed, 54 deletions(-) delete mode 100644 arch/arm/boot/dts/bcm11351-brt.dts diff --git a/arch/arm/boot/dts/bcm11351-brt.dts b/arch/arm/boot/dts/bcm11351-brt.dts deleted file mode 100644 index 396b704..000 --- a/arch/arm/boot/dts/bcm11351-brt.dts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2012 Broadcom Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -/dts-v1/; - -#include "bcm11351.dtsi" - -/ { - model = "BCM11351 BRT board"; - compatible = "brcm,bcm11351-brt", "brcm,bcm11351"; - - memory { - reg = <0x8000 0x4000>; /* 1 GB */ - }; - - uart@3e00 { - status = "okay"; - }; - - sdio1: sdio@3f18 { - max-frequency = <4800>; - status = "okay"; - }; - - sdio2: sdio@3f19 { - non-removable; - max-frequency = <4800>; - status = "okay"; - }; - - sdio4: sdio@3f1b { - max-frequency = <4800>; - cd-gpios = < 14 0>; - status = "okay"; - }; - - usbotg: usb@3f12 { - status = "okay"; - }; - - usbphy: usb-phy@3f13 { - status = "okay"; - }; -}; -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ARM: dts: remove bcm11351-brt.dts
The BCM11351 BRT board will never see the light of day. Remove the BRT dts since it is not maintainable. Signed-off-by: Matt Porter mpor...@linaro.org --- arch/arm/boot/dts/bcm11351-brt.dts | 54 -- 1 file changed, 54 deletions(-) delete mode 100644 arch/arm/boot/dts/bcm11351-brt.dts diff --git a/arch/arm/boot/dts/bcm11351-brt.dts b/arch/arm/boot/dts/bcm11351-brt.dts deleted file mode 100644 index 396b704..000 --- a/arch/arm/boot/dts/bcm11351-brt.dts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2012 Broadcom Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2. - * - * This program is distributed as is WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -/dts-v1/; - -#include bcm11351.dtsi - -/ { - model = BCM11351 BRT board; - compatible = brcm,bcm11351-brt, brcm,bcm11351; - - memory { - reg = 0x8000 0x4000; /* 1 GB */ - }; - - uart@3e00 { - status = okay; - }; - - sdio1: sdio@3f18 { - max-frequency = 4800; - status = okay; - }; - - sdio2: sdio@3f19 { - non-removable; - max-frequency = 4800; - status = okay; - }; - - sdio4: sdio@3f1b { - max-frequency = 4800; - cd-gpios = gpio 14 0; - status = okay; - }; - - usbotg: usb@3f12 { - status = okay; - }; - - usbphy: usb-phy@3f13 { - status = okay; - }; -}; -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ARM: dts: remove bcm11351-brt.dts
On Wed, Feb 19, 2014 at 03:21:29PM -0600, Alex Elder wrote: On 02/19/2014 02:13 PM, Matt Porter wrote: The BCM11351 BRT board will never see the light of day. Remove the BRT dts since it is not maintainable. Signed-off-by: Matt Porter mpor...@linaro.org Please remove the line in the Makefile that refers to this file. Provided you make that change, it looks good to me. Reviewed-by: Alex Elder el...@linaro.org Done, thanks. -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2] ARM: dts: remove bcm11351-brt.dts
The BCM11351 BRT board will never see the light of day. Remove the BRT dts since it is not maintainable. Reviewed-by: Alex Elder el...@linaro.org Signed-off-by: Matt Porter mpor...@linaro.org --- Changes since v1: - remove bcm11351-brt from Makefile arch/arm/boot/dts/Makefile | 3 +-- arch/arm/boot/dts/bcm11351-brt.dts | 54 -- 2 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 arch/arm/boot/dts/bcm11351-brt.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 6d1e43d..faf4676 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -47,8 +47,7 @@ dtb-$(CONFIG_ARCH_AT91) += sama5d36ek.dtb dtb-$(CONFIG_ARCH_ATLAS6) += atlas6-evb.dtb dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb -dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm11351-brt.dtb \ - bcm28155-ap.dtb +dtb-$(CONFIG_ARCH_BCM_MOBILE) += bcm28155-ap.dtb dtb-$(CONFIG_ARCH_BCM2835) += bcm2835-rpi-b.dtb dtb-$(CONFIG_ARCH_BERLIN) += \ berlin2-sony-nsz-gs7.dtb\ diff --git a/arch/arm/boot/dts/bcm11351-brt.dts b/arch/arm/boot/dts/bcm11351-brt.dts deleted file mode 100644 index 396b704..000 --- a/arch/arm/boot/dts/bcm11351-brt.dts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2012 Broadcom Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation version 2. - * - * This program is distributed as is WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -/dts-v1/; - -#include bcm11351.dtsi - -/ { - model = BCM11351 BRT board; - compatible = brcm,bcm11351-brt, brcm,bcm11351; - - memory { - reg = 0x8000 0x4000; /* 1 GB */ - }; - - uart@3e00 { - status = okay; - }; - - sdio1: sdio@3f18 { - max-frequency = 4800; - status = okay; - }; - - sdio2: sdio@3f19 { - non-removable; - max-frequency = 4800; - status = okay; - }; - - sdio4: sdio@3f1b { - max-frequency = 4800; - cd-gpios = gpio 14 0; - status = okay; - }; - - usbotg: usb@3f12 { - status = okay; - }; - - usbphy: usb-phy@3f13 { - status = okay; - }; -}; -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 4/5] ARM: configs: bcm_defconfig: enable bcm590xx regulator support
Enable BCM590xx 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_defconfig b/arch/arm/configs/bcm_defconfig index 2519d6d..0100464 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig @@ -79,6 +79,13 @@ CONFIG_HW_RANDOM=y CONFIG_I2C=y CONFIG_I2C_CHARDEV=y # CONFIG_HWMON is not set +CONFIG_MFD_BCM590XX=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_VIRTUAL_CONSUMER=y +CONFIG_REGULATOR_USERSPACE_CONSUMER=y +CONFIG_REGULATOR_BCM590XX=y + CONFIG_VIDEO_OUTPUT_CONTROL=y CONFIG_FB=y CONFIG_BACKLIGHT_LCD_SUPPORT=y -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 1/5] mfd: add bcm590xx pmu DT binding
Add a DT binding for the BCM590xx PMUs. The binding inherits from the generic regulator bindings. Signed-off-by: Matt Porter Reviewed-by: Tim Kryger Reviewed-by: Markus Mayer --- Documentation/devicetree/bindings/mfd/bcm590xx.txt | 49 ++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/bcm590xx.txt diff --git a/Documentation/devicetree/bindings/mfd/bcm590xx.txt b/Documentation/devicetree/bindings/mfd/bcm590xx.txt new file mode 100644 index 000..a4a8039 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/bcm590xx.txt @@ -0,0 +1,49 @@ +--- +BCM590xx Power Management Units +--- + +Required properties: +- compatible: "brcm,bcm59056" +- reg: I2C slave address +- interrupts: interrupt for the PMU. Generic interrupt client node bindings + are described in interrupt-controller/interrupts.txt + +--- +BCM590xx PMU Regulators +--- + +Required properties: +- compatible: "brcm,bcm59056-regs" + +Optional properties: +- regulators: This is the list of child nodes that specify the regulator + initialization data for defined regulators. Generic regulator bindings + are described in regulator/regulator.txt. + + The valid regulator-compatible values for BCM59056 are: + rfldo, camldo1, camldo2, simldo1, simlso2, sdldo, sdxldo, + mmcldo1, mmcldo2, audldo, micldo, usbldo, vibldo, + csr, iosr1, iosr2, msr, sdsr1, sdsr2, vsr + +Example: + pmu: bcm59056@8 { + compatible = "brcm,bcm59056"; + reg = <0x08>; + interrupts = ; + regs { + compatible = "brcm,bcm59056-regs"; + regulators { + #address-cells = <1>; + #size-cells = <0>; + + rfldo_reg: regulator@0 { + reg = <0>; + regulator-compatible = "rfldo"; + regulator-min-microvolt = <120>; + regulator-max-microvolt = <330>; + }; + + ... + }; + }; + }; -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 5/5] ARM: dts: add bcm590xx pmu support and enable for bcm28155-ap
Add a dtsi to support the BCM590xx PMUs 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 | 43 +- arch/arm/boot/dts/bcm59056.dtsi | 162 ++ 2 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/bcm59056.dtsi diff --git a/arch/arm/boot/dts/bcm28155-ap.dts b/arch/arm/boot/dts/bcm28155-ap.dts index 5ff2382..28fe731 100644 --- a/arch/arm/boot/dts/bcm28155-ap.dts +++ b/arch/arm/boot/dts/bcm28155-ap.dts @@ -46,7 +46,11 @@ i2c@3500d000 { status="okay"; - clock-frequency = <40>; + clock-frequency = <10>; + + pmu: pmu@8 { + reg = <0x08>; + }; }; sdio1: sdio@3f18 { @@ -57,16 +61,22 @@ sdio2: sdio@3f19 { non-removable; max-frequency = <4800>; + vmmc-supply = <_reg>; + vqmmc-supply = <_reg>; status = "okay"; }; sdio4: sdio@3f1b { max-frequency = <4800>; cd-gpios = < 14 GPIO_ACTIVE_LOW>; + vmmc-supply = <_reg>; + vqmmc-supply = <_reg>; status = "okay"; }; usbotg: usb@3f12 { + vusb_d-supply = <_reg>; + vusb_a-supply = <_reg>; status = "okay"; }; @@ -74,3 +84,34 @@ status = "okay"; }; }; + +#include "bcm59056.dtsi" + + { + interrupts = ; + regs { + regulators { + camldo1_reg: regulator@1 { + regulator-min-microvolt = <330>; + regulator-max-microvolt = <330>; + }; + + sdldo_reg: regulator@5 { + regulator-min-microvolt = <300>; + regulator-max-microvolt = <300>; + }; + + usbldo_reg: regulator@11 { + regulator-min-microvolt = <330>; + regulator-max-microvolt = <330>; + regulator-always-on; + }; + + iosr1_reg: regulator@14 { + regulator-min-microvolt = <180>; + regulator-max-microvolt = <180>; + regulator-always-on; + }; + }; + }; +}; diff --git a/arch/arm/boot/dts/bcm59056.dtsi b/arch/arm/boot/dts/bcm59056.dtsi new file mode 100644 index 000..b04940b --- /dev/null +++ b/arch/arm/boot/dts/bcm59056.dtsi @@ -0,0 +1,162 @@ +/* +* Copyright 2014 Linaro Limited +* Author: Matt Porter +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +*/ + + { + compatible = "brcm,bcm59056"; + + regs { + compatible = "brcm,bcm59056-regs"; + + regulators { + #address-cells = <1>; + #size-cells = <0>; + + rfldo_reg: regulator@0 { + reg = <0>; + regulator-compatible = "rfldo"; + regulator-min-microvolt = <120>; + regulator-max-microvolt = <330>; + }; + + camldo1_reg: regulator@1 { + reg = <1>; + regulator-compatible = "camldo1"; + regulator-min-microvolt = <180>; + regulator-max-microvolt = <330>; + }; + + camldo2_reg: regulator@2 { + reg = <2>; + regulator-compatible = "camldo2"; + regulator-min-microvolt = <180>; + regulator-max-microvolt = <330>; + }; + + simldo1_reg: regulator@3 { + reg = <3>; + regulator-compatible = "simldo1"; +
[PATCH v2 0/5] BCM59056 PMU regulator support
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. Changes since v1: - renamed to bcm590xx to accomodate future family parts - remove use of subsys_initcall - fix BCM590XX_MAX_REGISTER value - remove unused chip id in mfd of/i2c matching - switch to of_platform_populate() in mfd - update binding to single document with regulators as optional properties in the regulator subdevice IP description - remove unused regulator get/set mode ops - remove unneeded regulator NULL constraint check - regulators property is optional, allow the driver to probe when it is missing - move of_node presence check into bcm590xx_parse_dt_reg_data() Matt Porter (5): mfd: add bcm590xx pmu DT binding mfd: add bcm590xx pmu driver regulator: add bcm590xx regulator driver ARM: configs: bcm_defconfig: enable bcm590xx regulator support ARM: dts: add bcm590xx pmu support and enable for bcm28155-ap Documentation/devicetree/bindings/mfd/bcm590xx.txt | 49 +++ arch/arm/boot/dts/bcm28155-ap.dts | 43 ++- arch/arm/boot/dts/bcm59056.dtsi| 162 arch/arm/configs/bcm_defconfig | 7 + drivers/mfd/Kconfig| 8 + drivers/mfd/Makefile | 1 + drivers/mfd/bcm590xx.c | 86 + drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/bcm590xx-regulator.c | 419 + include/linux/mfd/bcm590xx.h | 31 ++ 11 files changed, 814 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/mfd/bcm590xx.txt create mode 100644 arch/arm/boot/dts/bcm59056.dtsi create mode 100644 drivers/mfd/bcm590xx.c create mode 100644 drivers/regulator/bcm590xx-regulator.c create mode 100644 include/linux/mfd/bcm590xx.h -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 3/5] regulator: add bcm590xx regulator driver
Add a regulator driver for the BCM590xx 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 | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/bcm590xx-regulator.c | 419 + 3 files changed, 428 insertions(+) create mode 100644 drivers/regulator/bcm590xx-regulator.c diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 6a79328..1169a42 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -139,6 +139,14 @@ config REGULATOR_AS3722 AS3722 PMIC. This will enable support for all the software controllable DCDC/LDO regulators. +config REGULATOR_BCM590XX + tristate "Broadcom BCM590xx PMU Regulators" + depends on MFD_BCM590XX + help + This driver provides support for the voltage regulators on the + BCM590xx PMUs. This will enable support for the software + controllable LDO/Switching regulators. + config REGULATOR_DA903X tristate "Dialog Semiconductor DA9030/DA9034 regulators" depends on PMIC_DA903X diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index 979f9dd..e1ab514 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o obj-$(CONFIG_REGULATOR_ARIZONA) += arizona-micsupp.o arizona-ldo1.o obj-$(CONFIG_REGULATOR_AS3711) += as3711-regulator.o obj-$(CONFIG_REGULATOR_AS3722) += as3722-regulator.o +obj-$(CONFIG_REGULATOR_BCM590XX) += bcm590xx-regulator.o obj-$(CONFIG_REGULATOR_DA903X) += da903x.o obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o obj-$(CONFIG_REGULATOR_DA9055) += da9055-regulator.o diff --git a/drivers/regulator/bcm590xx-regulator.c b/drivers/regulator/bcm590xx-regulator.c new file mode 100644 index 000..58fcc3a --- /dev/null +++ b/drivers/regulator/bcm590xx-regulator.c @@ -0,0 +1,419 @@ +/* + * Broadcom BCM590xx regulator driver + * + * Copyright 2014 Linaro Limited + * Author: Matt Porter + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Register defs */ +#define BCM590XX_RFLDOPMCTRL1 0x60 +#define BCM590XX_IOSR1PMCTRL1 0x7a +#define BCM590XX_IOSR2PMCTRL1 0x7c +#define BCM590XX_CSRPMCTRL10x7e +#define BCM590XX_SDSR1PMCTRL1 0x82 +#define BCM590XX_SDSR2PMCTRL1 0x86 +#define BCM590XX_MSRPMCTRL10x8a +#define BCM590XX_VSRPMCTRL10x8e +#define BCM590XX_REG_ENABLEBIT(7) + +#define BCM590XX_RFLDOCTRL 0x96 +#define BCM590XX_CSRVOUT1 0xc0 +#define BCM590XX_LDO_VSEL_MASK GENMASK(5, 3) +#define BCM590XX_SR_VSEL_MASK GENMASK(5, 0) + +/* LDO regulator IDs */ +#define BCM590XX_REG_RFLDO 0 +#define BCM590XX_REG_CAMLDO1 1 +#define BCM590XX_REG_CAMLDO2 2 +#define BCM590XX_REG_SIMLDO1 3 +#define BCM590XX_REG_SIMLDO2 4 +#define BCM590XX_REG_SDLDO 5 +#define BCM590XX_REG_SDXLDO6 +#define BCM590XX_REG_MMCLDO1 7 +#define BCM590XX_REG_MMCLDO2 8 +#define BCM590XX_REG_AUDLDO9 +#define BCM590XX_REG_MICLDO10 +#define BCM590XX_REG_USBLDO11 +#define BCM590XX_REG_VIBLDO12 + +/* DCDC regulator IDs */ +#define BCM590XX_REG_CSR 13 +#define BCM590XX_REG_IOSR1 14 +#define BCM590XX_REG_IOSR2 15 +#define BCM590XX_REG_MSR 16 +#define BCM590XX_REG_SDSR1 17 +#define BCM590XX_REG_SDSR2 18 +#define BCM590XX_REG_VSR 19 + +#define BCM590XX_NUM_REGS 20 + +#define BCM590XX_REG_IS_LDO(n) (n < BCM590XX_REG_CSR) + +struct bcm590xx_board { + struct regulator_init_data *bcm590xx_pmu_init_data[BCM590XX_NUM_REGS]; +}; + +/* LDO group A: supported voltages in microvolts */ +static const unsigned int ldo_a_table[] = { + 120, 180, 250, 270, 280, + 290, 300, 330, +}; + +/* LDO group C: supported voltages in microvolts */ +static const unsigned int ldo_c_table[] = { + 310, 180, 250, 270, 280, + 290, 300, 330, +}; + +/* DCDC group CSR: supported voltages in microvolts */ +static const struct regulator_linear_range dcdc_csr_ranges[] = { + REGULATOR_LINEAR_RANGE(86, 2, 50, 1), + REGULATOR_LINEAR_RANGE(136, 51, 55, 2), + REGULATOR_LINEAR_RANGE(90, 56, 63, 0), +}; + +/* DCDC group IOSR1: supported voltages in microvolts */ +static const struct regulator_linear_range dcdc_iosr1_ranges[] = { + REGULATOR_LINEAR_RANGE(86, 2, 51, 1), + REGULAT
[PATCH v2 2/5] mfd: add bcm590xx pmu driver
Add a driver for the BCM590xx PMU multi-function devices. 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 | 8 + drivers/mfd/Makefile | 1 + drivers/mfd/bcm590xx.c | 86 include/linux/mfd/bcm590xx.h | 31 4 files changed, 126 insertions(+) create mode 100644 drivers/mfd/bcm590xx.c create mode 100644 include/linux/mfd/bcm590xx.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 49bb445..eda60de 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -59,6 +59,14 @@ config MFD_AAT2870_CORE additional drivers must be enabled in order to use the functionality of the device. +config MFD_BCM590XX + bool "Broadcom BCM590xx PMUs" + select MFD_CORE + select REGMAP_I2C + depends on I2C=y + help + Support for the BCM590xx PMUs from Broadcom + config MFD_CROS_EC tristate "ChromeOS Embedded Controller" select MFD_CORE diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 5aea5ef..4c342bf 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -8,6 +8,7 @@ obj-$(CONFIG_MFD_88PM800) += 88pm800.o 88pm80x.o obj-$(CONFIG_MFD_88PM805) += 88pm805.o 88pm80x.o obj-$(CONFIG_MFD_SM501)+= sm501.o obj-$(CONFIG_MFD_ASIC3)+= asic3.o tmio_core.o +obj-$(CONFIG_MFD_BCM590XX) += bcm590xx.o obj-$(CONFIG_MFD_CROS_EC) += cros_ec.o obj-$(CONFIG_MFD_CROS_EC_I2C) += cros_ec_i2c.o obj-$(CONFIG_MFD_CROS_EC_SPI) += cros_ec_spi.o diff --git a/drivers/mfd/bcm590xx.c b/drivers/mfd/bcm590xx.c new file mode 100644 index 000..06f6387 --- /dev/null +++ b/drivers/mfd/bcm590xx.c @@ -0,0 +1,86 @@ +/* + * Broadcom BCM590xx PMU + * + * Copyright 2014 Linaro Limited + * Author: Matt Porter + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct regmap_config bcm590xx_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .max_register = BCM590XX_MAX_REGISTER, + .cache_type = REGCACHE_RBTREE, +}; + +static int bcm590xx_i2c_probe(struct i2c_client *i2c, + const struct i2c_device_id *id) +{ + struct bcm590xx *bcm590xx; + int ret = 0; + + bcm590xx = devm_kzalloc(>dev, sizeof(*bcm590xx), GFP_KERNEL); + if (!bcm590xx) + return -ENOMEM; + + i2c_set_clientdata(i2c, bcm590xx); + bcm590xx->dev = >dev; + bcm590xx->i2c_client = i2c; + + bcm590xx->regmap = devm_regmap_init_i2c(i2c, _regmap_config); + if (IS_ERR(bcm590xx->regmap)) { + ret = PTR_ERR(bcm590xx->regmap); + dev_err(>dev, "regmap initialization failed: %d\n", ret); + return ret; + } + + ret = of_platform_populate(i2c->dev.of_node, NULL, NULL, >dev); + if (ret < 0) + dev_err(>dev, "of_platform_populate() failed: %d\n", ret); + + return ret; +} + +static const struct of_device_id bcm590xx_of_match[] = { + { .compatible = "brcm,bcm59056" }, + { } +}; +MODULE_DEVICE_TABLE(i2c, bcm590xx_of_match); + +static const struct i2c_device_id bcm590xx_i2c_id[] = { + { "bcm59056" }, + { } +}; +MODULE_DEVICE_TABLE(i2c, bcm590xx_i2c_id); + +static struct i2c_driver bcm590xx_i2c_driver = { + .driver = { + .name = "bcm590xx", + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(bcm590xx_of_match), + }, + .probe = bcm590xx_i2c_probe, + .id_table = bcm590xx_i2c_id, +}; +module_i2c_driver(bcm590xx_i2c_driver); + +MODULE_AUTHOR("Matt Porter "); +MODULE_DESCRIPTION("BCM590xx multi-function driver"); +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:bcm590xx"); diff --git a/include/linux/mfd/bcm590xx.h b/include/linux/mfd/bcm590xx.h new file mode 100644 index 000..434df2d --- /dev/null +++ b/include/linux/mfd/bcm590xx.h @@ -0,0 +1,31 @@ +/* + * Broadcom BCM590xx PMU + * + * Copyright 2014 Linaro Limited + * Author: Matt Porter + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later
[PATCH v2 0/5] BCM59056 PMU regulator support
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. Changes since v1: - renamed to bcm590xx to accomodate future family parts - remove use of subsys_initcall - fix BCM590XX_MAX_REGISTER value - remove unused chip id in mfd of/i2c matching - switch to of_platform_populate() in mfd - update binding to single document with regulators as optional properties in the regulator subdevice IP description - remove unused regulator get/set mode ops - remove unneeded regulator NULL constraint check - regulators property is optional, allow the driver to probe when it is missing - move of_node presence check into bcm590xx_parse_dt_reg_data() Matt Porter (5): mfd: add bcm590xx pmu DT binding mfd: add bcm590xx pmu driver regulator: add bcm590xx regulator driver ARM: configs: bcm_defconfig: enable bcm590xx regulator support ARM: dts: add bcm590xx pmu support and enable for bcm28155-ap Documentation/devicetree/bindings/mfd/bcm590xx.txt | 49 +++ arch/arm/boot/dts/bcm28155-ap.dts | 43 ++- arch/arm/boot/dts/bcm59056.dtsi| 162 arch/arm/configs/bcm_defconfig | 7 + drivers/mfd/Kconfig| 8 + drivers/mfd/Makefile | 1 + drivers/mfd/bcm590xx.c | 86 + drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/bcm590xx-regulator.c | 419 + include/linux/mfd/bcm590xx.h | 31 ++ 11 files changed, 814 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/mfd/bcm590xx.txt create mode 100644 arch/arm/boot/dts/bcm59056.dtsi create mode 100644 drivers/mfd/bcm590xx.c create mode 100644 drivers/regulator/bcm590xx-regulator.c create mode 100644 include/linux/mfd/bcm590xx.h -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 3/5] regulator: add bcm590xx regulator driver
Add a regulator driver for the BCM590xx 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 mpor...@linaro.org Reviewed-by: Tim Kryger tim.kry...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/bcm590xx-regulator.c | 419 + 3 files changed, 428 insertions(+) create mode 100644 drivers/regulator/bcm590xx-regulator.c diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 6a79328..1169a42 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -139,6 +139,14 @@ config REGULATOR_AS3722 AS3722 PMIC. This will enable support for all the software controllable DCDC/LDO regulators. +config REGULATOR_BCM590XX + tristate Broadcom BCM590xx PMU Regulators + depends on MFD_BCM590XX + help + This driver provides support for the voltage regulators on the + BCM590xx PMUs. This will enable support for the software + controllable LDO/Switching regulators. + config REGULATOR_DA903X tristate Dialog Semiconductor DA9030/DA9034 regulators depends on PMIC_DA903X diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index 979f9dd..e1ab514 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o obj-$(CONFIG_REGULATOR_ARIZONA) += arizona-micsupp.o arizona-ldo1.o obj-$(CONFIG_REGULATOR_AS3711) += as3711-regulator.o obj-$(CONFIG_REGULATOR_AS3722) += as3722-regulator.o +obj-$(CONFIG_REGULATOR_BCM590XX) += bcm590xx-regulator.o obj-$(CONFIG_REGULATOR_DA903X) += da903x.o obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o obj-$(CONFIG_REGULATOR_DA9055) += da9055-regulator.o diff --git a/drivers/regulator/bcm590xx-regulator.c b/drivers/regulator/bcm590xx-regulator.c new file mode 100644 index 000..58fcc3a --- /dev/null +++ b/drivers/regulator/bcm590xx-regulator.c @@ -0,0 +1,419 @@ +/* + * Broadcom BCM590xx regulator driver + * + * Copyright 2014 Linaro Limited + * Author: Matt Porter mpor...@linaro.org + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include linux/err.h +#include linux/init.h +#include linux/kernel.h +#include linux/mfd/bcm590xx.h +#include linux/module.h +#include linux/of.h +#include linux/platform_device.h +#include linux/regulator/driver.h +#include linux/regulator/machine.h +#include linux/regulator/of_regulator.h +#include linux/slab.h + +/* Register defs */ +#define BCM590XX_RFLDOPMCTRL1 0x60 +#define BCM590XX_IOSR1PMCTRL1 0x7a +#define BCM590XX_IOSR2PMCTRL1 0x7c +#define BCM590XX_CSRPMCTRL10x7e +#define BCM590XX_SDSR1PMCTRL1 0x82 +#define BCM590XX_SDSR2PMCTRL1 0x86 +#define BCM590XX_MSRPMCTRL10x8a +#define BCM590XX_VSRPMCTRL10x8e +#define BCM590XX_REG_ENABLEBIT(7) + +#define BCM590XX_RFLDOCTRL 0x96 +#define BCM590XX_CSRVOUT1 0xc0 +#define BCM590XX_LDO_VSEL_MASK GENMASK(5, 3) +#define BCM590XX_SR_VSEL_MASK GENMASK(5, 0) + +/* LDO regulator IDs */ +#define BCM590XX_REG_RFLDO 0 +#define BCM590XX_REG_CAMLDO1 1 +#define BCM590XX_REG_CAMLDO2 2 +#define BCM590XX_REG_SIMLDO1 3 +#define BCM590XX_REG_SIMLDO2 4 +#define BCM590XX_REG_SDLDO 5 +#define BCM590XX_REG_SDXLDO6 +#define BCM590XX_REG_MMCLDO1 7 +#define BCM590XX_REG_MMCLDO2 8 +#define BCM590XX_REG_AUDLDO9 +#define BCM590XX_REG_MICLDO10 +#define BCM590XX_REG_USBLDO11 +#define BCM590XX_REG_VIBLDO12 + +/* DCDC regulator IDs */ +#define BCM590XX_REG_CSR 13 +#define BCM590XX_REG_IOSR1 14 +#define BCM590XX_REG_IOSR2 15 +#define BCM590XX_REG_MSR 16 +#define BCM590XX_REG_SDSR1 17 +#define BCM590XX_REG_SDSR2 18 +#define BCM590XX_REG_VSR 19 + +#define BCM590XX_NUM_REGS 20 + +#define BCM590XX_REG_IS_LDO(n) (n BCM590XX_REG_CSR) + +struct bcm590xx_board { + struct regulator_init_data *bcm590xx_pmu_init_data[BCM590XX_NUM_REGS]; +}; + +/* LDO group A: supported voltages in microvolts */ +static const unsigned int ldo_a_table[] = { + 120, 180, 250, 270, 280, + 290, 300, 330, +}; + +/* LDO group C: supported voltages in microvolts */ +static const unsigned int ldo_c_table[] = { + 310, 180, 250, 270, 280, + 290, 300, 330, +}; + +/* DCDC group CSR: supported voltages in microvolts */ +static const struct regulator_linear_range dcdc_csr_ranges[] = { + REGULATOR_LINEAR_RANGE(86, 2, 50, 1), + REGULATOR_LINEAR_RANGE(136, 51, 55, 2
[PATCH v2 2/5] mfd: add bcm590xx pmu driver
Add a driver for the BCM590xx PMU multi-function devices. The driver initially supports regmap initialization and instantiation of the voltage regulator device function of the PMU. Signed-off-by: Matt Porter mpor...@linaro.org Reviewed-by: Tim Kryger tim.kry...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- drivers/mfd/Kconfig | 8 + drivers/mfd/Makefile | 1 + drivers/mfd/bcm590xx.c | 86 include/linux/mfd/bcm590xx.h | 31 4 files changed, 126 insertions(+) create mode 100644 drivers/mfd/bcm590xx.c create mode 100644 include/linux/mfd/bcm590xx.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 49bb445..eda60de 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -59,6 +59,14 @@ config MFD_AAT2870_CORE additional drivers must be enabled in order to use the functionality of the device. +config MFD_BCM590XX + bool Broadcom BCM590xx PMUs + select MFD_CORE + select REGMAP_I2C + depends on I2C=y + help + Support for the BCM590xx PMUs from Broadcom + config MFD_CROS_EC tristate ChromeOS Embedded Controller select MFD_CORE diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 5aea5ef..4c342bf 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -8,6 +8,7 @@ obj-$(CONFIG_MFD_88PM800) += 88pm800.o 88pm80x.o obj-$(CONFIG_MFD_88PM805) += 88pm805.o 88pm80x.o obj-$(CONFIG_MFD_SM501)+= sm501.o obj-$(CONFIG_MFD_ASIC3)+= asic3.o tmio_core.o +obj-$(CONFIG_MFD_BCM590XX) += bcm590xx.o obj-$(CONFIG_MFD_CROS_EC) += cros_ec.o obj-$(CONFIG_MFD_CROS_EC_I2C) += cros_ec_i2c.o obj-$(CONFIG_MFD_CROS_EC_SPI) += cros_ec_spi.o diff --git a/drivers/mfd/bcm590xx.c b/drivers/mfd/bcm590xx.c new file mode 100644 index 000..06f6387 --- /dev/null +++ b/drivers/mfd/bcm590xx.c @@ -0,0 +1,86 @@ +/* + * Broadcom BCM590xx PMU + * + * Copyright 2014 Linaro Limited + * Author: Matt Porter mpor...@linaro.org + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include linux/err.h +#include linux/i2c.h +#include linux/init.h +#include linux/mfd/bcm590xx.h +#include linux/mfd/core.h +#include linux/module.h +#include linux/moduleparam.h +#include linux/of.h +#include linux/of_device.h +#include linux/regmap.h +#include linux/slab.h + +static const struct regmap_config bcm590xx_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .max_register = BCM590XX_MAX_REGISTER, + .cache_type = REGCACHE_RBTREE, +}; + +static int bcm590xx_i2c_probe(struct i2c_client *i2c, + const struct i2c_device_id *id) +{ + struct bcm590xx *bcm590xx; + int ret = 0; + + bcm590xx = devm_kzalloc(i2c-dev, sizeof(*bcm590xx), GFP_KERNEL); + if (!bcm590xx) + return -ENOMEM; + + i2c_set_clientdata(i2c, bcm590xx); + bcm590xx-dev = i2c-dev; + bcm590xx-i2c_client = i2c; + + bcm590xx-regmap = devm_regmap_init_i2c(i2c, bcm590xx_regmap_config); + if (IS_ERR(bcm590xx-regmap)) { + ret = PTR_ERR(bcm590xx-regmap); + dev_err(i2c-dev, regmap initialization failed: %d\n, ret); + return ret; + } + + ret = of_platform_populate(i2c-dev.of_node, NULL, NULL, i2c-dev); + if (ret 0) + dev_err(i2c-dev, of_platform_populate() failed: %d\n, ret); + + return ret; +} + +static const struct of_device_id bcm590xx_of_match[] = { + { .compatible = brcm,bcm59056 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, bcm590xx_of_match); + +static const struct i2c_device_id bcm590xx_i2c_id[] = { + { bcm59056 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, bcm590xx_i2c_id); + +static struct i2c_driver bcm590xx_i2c_driver = { + .driver = { + .name = bcm590xx, + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(bcm590xx_of_match), + }, + .probe = bcm590xx_i2c_probe, + .id_table = bcm590xx_i2c_id, +}; +module_i2c_driver(bcm590xx_i2c_driver); + +MODULE_AUTHOR(Matt Porter mpor...@linaro.org); +MODULE_DESCRIPTION(BCM590xx multi-function driver); +MODULE_LICENSE(GPL v2); +MODULE_ALIAS(platform:bcm590xx); diff --git a/include/linux/mfd/bcm590xx.h b/include/linux/mfd/bcm590xx.h new file mode 100644 index 000..434df2d --- /dev/null +++ b/include/linux/mfd/bcm590xx.h @@ -0,0 +1,31 @@ +/* + * Broadcom BCM590xx PMU + * + * Copyright 2014 Linaro Limited + * Author: Matt Porter mpor...@linaro.org + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License
[PATCH v2 5/5] ARM: dts: add bcm590xx pmu support and enable for bcm28155-ap
Add a dtsi to support the BCM590xx PMUs used by the BCM281xx family of SoCs. Enable regulators for use with the dwc2 and sdhci on bcm28155-ap. Signed-off-by: Tim Kryger tim.kry...@linaro.org Signed-off-by: Matt Porter mpor...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- arch/arm/boot/dts/bcm28155-ap.dts | 43 +- arch/arm/boot/dts/bcm59056.dtsi | 162 ++ 2 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/bcm59056.dtsi diff --git a/arch/arm/boot/dts/bcm28155-ap.dts b/arch/arm/boot/dts/bcm28155-ap.dts index 5ff2382..28fe731 100644 --- a/arch/arm/boot/dts/bcm28155-ap.dts +++ b/arch/arm/boot/dts/bcm28155-ap.dts @@ -46,7 +46,11 @@ i2c@3500d000 { status=okay; - clock-frequency = 40; + clock-frequency = 10; + + pmu: pmu@8 { + reg = 0x08; + }; }; sdio1: sdio@3f18 { @@ -57,16 +61,22 @@ sdio2: sdio@3f19 { non-removable; max-frequency = 4800; + vmmc-supply = camldo1_reg; + vqmmc-supply = iosr1_reg; status = okay; }; sdio4: sdio@3f1b { max-frequency = 4800; cd-gpios = gpio 14 GPIO_ACTIVE_LOW; + vmmc-supply = sdldo_reg; + vqmmc-supply = sdxldo_reg; status = okay; }; usbotg: usb@3f12 { + vusb_d-supply = usbldo_reg; + vusb_a-supply = iosr1_reg; status = okay; }; @@ -74,3 +84,34 @@ status = okay; }; }; + +#include bcm59056.dtsi + +pmu { + interrupts = GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH; + regs { + regulators { + camldo1_reg: regulator@1 { + regulator-min-microvolt = 330; + regulator-max-microvolt = 330; + }; + + sdldo_reg: regulator@5 { + regulator-min-microvolt = 300; + regulator-max-microvolt = 300; + }; + + usbldo_reg: regulator@11 { + regulator-min-microvolt = 330; + regulator-max-microvolt = 330; + regulator-always-on; + }; + + iosr1_reg: regulator@14 { + regulator-min-microvolt = 180; + regulator-max-microvolt = 180; + regulator-always-on; + }; + }; + }; +}; diff --git a/arch/arm/boot/dts/bcm59056.dtsi b/arch/arm/boot/dts/bcm59056.dtsi new file mode 100644 index 000..b04940b --- /dev/null +++ b/arch/arm/boot/dts/bcm59056.dtsi @@ -0,0 +1,162 @@ +/* +* Copyright 2014 Linaro Limited +* Author: Matt Porter mpor...@linaro.org +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +*/ + +pmu { + compatible = brcm,bcm59056; + + regs { + compatible = brcm,bcm59056-regs; + + regulators { + #address-cells = 1; + #size-cells = 0; + + rfldo_reg: regulator@0 { + reg = 0; + regulator-compatible = rfldo; + regulator-min-microvolt = 120; + regulator-max-microvolt = 330; + }; + + camldo1_reg: regulator@1 { + reg = 1; + regulator-compatible = camldo1; + regulator-min-microvolt = 180; + regulator-max-microvolt = 330; + }; + + camldo2_reg: regulator@2 { + reg = 2; + regulator-compatible = camldo2; + regulator-min-microvolt = 180; + regulator-max-microvolt = 330; + }; + + simldo1_reg: regulator@3 { + reg = 3; + regulator-compatible = simldo1; + regulator-min-microvolt = 120; + regulator-max-microvolt = 330; + }; + + simldo2_reg: regulator@4 { + reg = 4
[PATCH v2 4/5] ARM: configs: bcm_defconfig: enable bcm590xx regulator support
Enable BCM590xx MFD and regulator drivers to manage voltage regulators on BCM281xx platforms. Signed-off-by: Tim Kryger tim.kry...@linaro.org Signed-off-by: Matt Porter mpor...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- arch/arm/configs/bcm_defconfig | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig index 2519d6d..0100464 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig @@ -79,6 +79,13 @@ CONFIG_HW_RANDOM=y CONFIG_I2C=y CONFIG_I2C_CHARDEV=y # CONFIG_HWMON is not set +CONFIG_MFD_BCM590XX=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_VIRTUAL_CONSUMER=y +CONFIG_REGULATOR_USERSPACE_CONSUMER=y +CONFIG_REGULATOR_BCM590XX=y + CONFIG_VIDEO_OUTPUT_CONTROL=y CONFIG_FB=y CONFIG_BACKLIGHT_LCD_SUPPORT=y -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 1/5] mfd: add bcm590xx pmu DT binding
Add a DT binding for the BCM590xx PMUs. The binding inherits from the generic regulator bindings. Signed-off-by: Matt Porter mpor...@linaro.org Reviewed-by: Tim Kryger tim.kry...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- Documentation/devicetree/bindings/mfd/bcm590xx.txt | 49 ++ 1 file changed, 49 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/bcm590xx.txt diff --git a/Documentation/devicetree/bindings/mfd/bcm590xx.txt b/Documentation/devicetree/bindings/mfd/bcm590xx.txt new file mode 100644 index 000..a4a8039 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/bcm590xx.txt @@ -0,0 +1,49 @@ +--- +BCM590xx Power Management Units +--- + +Required properties: +- compatible: brcm,bcm59056 +- reg: I2C slave address +- interrupts: interrupt for the PMU. Generic interrupt client node bindings + are described in interrupt-controller/interrupts.txt + +--- +BCM590xx PMU Regulators +--- + +Required properties: +- compatible: brcm,bcm59056-regs + +Optional properties: +- regulators: This is the list of child nodes that specify the regulator + initialization data for defined regulators. Generic regulator bindings + are described in regulator/regulator.txt. + + The valid regulator-compatible values for BCM59056 are: + rfldo, camldo1, camldo2, simldo1, simlso2, sdldo, sdxldo, + mmcldo1, mmcldo2, audldo, micldo, usbldo, vibldo, + csr, iosr1, iosr2, msr, sdsr1, sdsr2, vsr + +Example: + pmu: bcm59056@8 { + compatible = brcm,bcm59056; + reg = 0x08; + interrupts = GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH; + regs { + compatible = brcm,bcm59056-regs; + regulators { + #address-cells = 1; + #size-cells = 0; + + rfldo_reg: regulator@0 { + reg = 0; + regulator-compatible = rfldo; + regulator-min-microvolt = 120; + regulator-max-microvolt = 330; + }; + + ... + }; + }; + }; -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2] MAINTAINERS: add additional ARM BCM281xx/BCM11xxx maintainer
Add myself as an additional maintainer for the Broadcom mobile SoCs. Signed-off-by: Matt Porter --- Since v1: put back my missing SOB MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index b2cf5cf..9d6fbfd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1860,6 +1860,7 @@ F:drivers/net/ethernet/broadcom/bnx2x/ BROADCOM BCM281XX/BCM11XXX ARM ARCHITECTURE M: Christian Daudt +M: Matt Porter L: bcm-kernel-feedback-l...@broadcom.com T: git git://git.github.com/broadcom/bcm11351 S: Maintained -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] MAINTAINERS: add additional ARM BCM281xx/BCM11xxx maintainer
Add myself as an additional maintainer for the Broadcom mobile SoCs. --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index b2cf5cf..9d6fbfd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1860,6 +1860,7 @@ F:drivers/net/ethernet/broadcom/bnx2x/ BROADCOM BCM281XX/BCM11XXX ARM ARCHITECTURE M: Christian Daudt +M: Matt Porter L: bcm-kernel-feedback-l...@broadcom.com T: git git://git.github.com/broadcom/bcm11351 S: Maintained -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] MAINTAINERS: add additional ARM BCM281xx/BCM11xxx maintainer
Add myself as an additional maintainer for the Broadcom mobile SoCs. --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index b2cf5cf..9d6fbfd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1860,6 +1860,7 @@ F:drivers/net/ethernet/broadcom/bnx2x/ BROADCOM BCM281XX/BCM11XXX ARM ARCHITECTURE M: Christian Daudt b...@fixthebug.org +M: Matt Porter mpor...@linaro.org L: bcm-kernel-feedback-l...@broadcom.com T: git git://git.github.com/broadcom/bcm11351 S: Maintained -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2] MAINTAINERS: add additional ARM BCM281xx/BCM11xxx maintainer
Add myself as an additional maintainer for the Broadcom mobile SoCs. Signed-off-by: Matt Porter mpor...@linaro.org --- Since v1: put back my missing SOB MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index b2cf5cf..9d6fbfd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1860,6 +1860,7 @@ F:drivers/net/ethernet/broadcom/bnx2x/ BROADCOM BCM281XX/BCM11XXX ARM ARCHITECTURE M: Christian Daudt b...@fixthebug.org +M: Matt Porter mpor...@linaro.org L: bcm-kernel-feedback-l...@broadcom.com T: git git://git.github.com/broadcom/bcm11351 S: Maintained -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 6/6] ARM: dts: AM33XX: Add ecap interrupt properties
Add missing interrupt properties to the ecap0, ecap1, and ecap2 nodes. Signed-off-by: Matt Porter --- arch/arm/boot/dts/am33xx.dtsi | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi index 6d95d3d..b4139ba 100644 --- a/arch/arm/boot/dts/am33xx.dtsi +++ b/arch/arm/boot/dts/am33xx.dtsi @@ -582,6 +582,8 @@ compatible = "ti,am33xx-ecap"; #pwm-cells = <3>; reg = <0x48300100 0x80>; + interrupts = <31>; + interrupt-names = "ecap0"; ti,hwmods = "ecap0"; status = "disabled"; }; @@ -610,6 +612,8 @@ compatible = "ti,am33xx-ecap"; #pwm-cells = <3>; reg = <0x48302100 0x80>; + interrupts = <47>; + interrupt-names = "ecap1"; ti,hwmods = "ecap1"; status = "disabled"; }; @@ -638,6 +642,8 @@ compatible = "ti,am33xx-ecap"; #pwm-cells = <3>; reg = <0x48304100 0x80>; + interrupts = <61>; + interrupt-names = "ecap2"; ti,hwmods = "ecap2"; status = "disabled"; }; -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 3/6] iio: enable selection and build of pulse drivers
Add the pulse driver subdirectory when configuring and building IIO. Signed-off-by: Matt Porter --- drivers/iio/Kconfig | 1 + drivers/iio/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iio/Kconfig b/drivers/iio/Kconfig index 5dd0e12..286acc3 100644 --- a/drivers/iio/Kconfig +++ b/drivers/iio/Kconfig @@ -74,6 +74,7 @@ if IIO_TRIGGER source "drivers/iio/trigger/Kconfig" endif #IIO_TRIGGER source "drivers/iio/pressure/Kconfig" +source "drivers/iio/pulse/Kconfig" source "drivers/iio/temperature/Kconfig" endif # IIO diff --git a/drivers/iio/Makefile b/drivers/iio/Makefile index 887d390..9a953c9 100644 --- a/drivers/iio/Makefile +++ b/drivers/iio/Makefile @@ -24,5 +24,6 @@ obj-y += light/ obj-y += magnetometer/ obj-y += orientation/ obj-y += pressure/ +obj-y += pulse/ obj-y += temperature/ obj-y += trigger/ -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 4/6] iio: Add ABI docs for pulse capture devices
Add standard ABI entries for pulse capture devices. Also add a separate ABI entry for the TI ECAP driver polarity option. Signed-off-by: Matt Porter --- Documentation/ABI/testing/sysfs-bus-iio | 18 ++ Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap | 9 + 2 files changed, 27 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 6e02c50..918a201 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -210,6 +210,14 @@ Contact: linux-...@vger.kernel.org Description: Scaled humidity measurement in milli percent. +What: /sys/bus/iio/devices/iio:deviceX/in_pulseY_raw +What: /sys/bus/iio/devices/iio:deviceX/in_pulse_raw +KernelVersion: 3.15 +Contact: linux-...@vger.kernel.org +Description: + Raw pulse measurement from channel Y. Units after + application of scale and offset are nanoseconds. + What: /sys/bus/iio/devices/iio:deviceX/in_accel_offset What: /sys/bus/iio/devices/iio:deviceX/in_accel_x_offset What: /sys/bus/iio/devices/iio:deviceX/in_accel_y_offset @@ -220,6 +228,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_tempY_offset What: /sys/bus/iio/devices/iio:deviceX/in_temp_offset What: /sys/bus/iio/devices/iio:deviceX/in_pressureY_offset What: /sys/bus/iio/devices/iio:deviceX/in_pressure_offset +What: /sys/bus/iio/devices/iio:deviceX/in_pulseY_offset +What: /sys/bus/iio/devices/iio:deviceX/in_pulse_offset KernelVersion: 2.6.35 Contact: linux-...@vger.kernel.org Description: @@ -251,6 +261,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_magn_y_scale What: /sys/bus/iio/devices/iio:deviceX/in_magn_z_scale What: /sys/bus/iio/devices/iio:deviceX/in_pressureY_scale What: /sys/bus/iio/devices/iio:deviceX/in_pressure_scale +What: /sys/bus/iio/devices/iio:deviceX/in_pulseY_scale +What: /sys/bus/iio/devices/iio:deviceX/in_pulse_scale KernelVersion: 2.6.35 Contact: linux-...@vger.kernel.org Description: @@ -784,6 +796,8 @@ What: /sys/.../iio:deviceX/scan_elements/in_incli_x_en What: /sys/.../iio:deviceX/scan_elements/in_incli_y_en What: /sys/.../iio:deviceX/scan_elements/in_pressureY_en What: /sys/.../iio:deviceX/scan_elements/in_pressure_en +What: /sys/.../iio:deviceX/scan_elements/in_pulseY_en +What: /sys/.../iio:deviceX/scan_elements/in_pulse_en KernelVersion: 2.6.37 Contact: linux-...@vger.kernel.org Description: @@ -799,6 +813,8 @@ What: /sys/.../iio:deviceX/scan_elements/in_voltageY_supply_type What: /sys/.../iio:deviceX/scan_elements/in_timestamp_type What: /sys/.../iio:deviceX/scan_elements/in_pressureY_type What: /sys/.../iio:deviceX/scan_elements/in_pressure_type +What: /sys/.../iio:deviceX/scan_elements/in_pulseY_type +What: /sys/.../iio:deviceX/scan_elements/in_pulse_type KernelVersion: 2.6.37 Contact: linux-...@vger.kernel.org Description: @@ -845,6 +861,8 @@ What: /sys/.../iio:deviceX/scan_elements/in_incli_y_index What: /sys/.../iio:deviceX/scan_elements/in_timestamp_index What: /sys/.../iio:deviceX/scan_elements/in_pressureY_index What: /sys/.../iio:deviceX/scan_elements/in_pressure_index +What: /sys/.../iio:deviceX/scan_elements/in_pulseY_index +What: /sys/.../iio:deviceX/scan_elements/in_pulse_index KernelVersion: 2.6.37 Contact: linux-...@vger.kernel.org Description: diff --git a/Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap b/Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap new file mode 100644 index 000..a9e4a9f --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap @@ -0,0 +1,9 @@ +What: /sys/bus/iio/devices/iio:deviceX/pulse_polarityY +What: /sys/bus/iio/devices/iio:deviceX/pulse_polarity +Date: January 2014 +KernelVersion: 3.15 +Contact: Matt Porter +Description: + Get and set the polarity of the pulse signal to be captured + for channel Y. 1 indicates a high pulse signal and 0 + indicates a low pulse signal. -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 1/6] iio: add support for pulse width capture devices
Add a channel type to support pulse width capture devices. These devices capture the timing of a PWM signal based on a configurable trigger Signed-off-by: Matt Porter --- drivers/iio/industrialio-core.c | 1 + include/linux/iio/types.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index acc911a..6ea0cf8 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -70,6 +70,7 @@ static const char * const iio_chan_type_name_spec[] = { [IIO_CCT] = "cct", [IIO_PRESSURE] = "pressure", [IIO_HUMIDITYRELATIVE] = "humidityrelative", + [IIO_PULSE] = "pulse", }; static const char * const iio_modifier_names[] = { diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 084d882..4fa8840 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h @@ -30,6 +30,7 @@ enum iio_chan_type { IIO_CCT, IIO_PRESSURE, IIO_HUMIDITYRELATIVE, + IIO_PULSE, }; enum iio_modifier { -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 2/6] iio: pulse: add TI ECAP driver
Adds support for capturing PWM signals using the TI ECAP peripheral. This driver supports triggered buffer capture of pulses on multiple ECAP instances. In addition, the driver supports configurable polarity of the signal to be captured. Signed-off-by: Matt Porter --- drivers/iio/pulse/Kconfig | 20 ++ drivers/iio/pulse/Makefile | 6 + drivers/iio/pulse/tiecap.c | 491 + 3 files changed, 517 insertions(+) create mode 100644 drivers/iio/pulse/Kconfig create mode 100644 drivers/iio/pulse/Makefile create mode 100644 drivers/iio/pulse/tiecap.c diff --git a/drivers/iio/pulse/Kconfig b/drivers/iio/pulse/Kconfig new file mode 100644 index 000..9864d4b --- /dev/null +++ b/drivers/iio/pulse/Kconfig @@ -0,0 +1,20 @@ +# +# Pulse Capture Devices +# +# When adding new entries keep the list in alphabetical order + +menu "Pulse Capture Devices" + +config IIO_TIECAP + tristate "TI ECAP Pulse Capture" + depends on SOC_AM33XX + select IIO_BUFFER + select IIO_TRIGGERED_BUFFER + help +If you say yes here you get support for the TI ECAP peripheral +in pulse capture mode. + +This driver can also be built as a module. If so, the module +will be called tiecap + +endmenu diff --git a/drivers/iio/pulse/Makefile b/drivers/iio/pulse/Makefile new file mode 100644 index 000..94d4b00 --- /dev/null +++ b/drivers/iio/pulse/Makefile @@ -0,0 +1,6 @@ +# +# Makefile for IIO PWM Capture Devices +# + +# When adding new entries keep the list in alphabetical order +obj-$(CONFIG_IIO_TIECAP) += tiecap.o diff --git a/drivers/iio/pulse/tiecap.c b/drivers/iio/pulse/tiecap.c new file mode 100644 index 000..fd96745 --- /dev/null +++ b/drivers/iio/pulse/tiecap.c @@ -0,0 +1,491 @@ +/* + * ECAP IIO pulse capture driver + * + * Copyright (C) 2014 Linaro Limited + * Author: Matt Porter + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../pwm/pwm-tipwmss.h" + +/* ECAP regs and bits */ +#define CAP1 0x08 +#define CAP2 0x0c +#define ECCTL1 0x28 +#define ECCTL1_RUN_FREEBIT(15) +#define ECCTL1_CAPLDEN BIT(8) +#define ECCTL1_CAP2POL BIT(2) +#define ECCTL1_CTRRST1 BIT(1) +#define ECCTL1_CAP1POL BIT(0) +#define ECCTL2 0x2a +#define ECCTL2_SYNCO_SEL_DIS BIT(7) +#define ECCTL2_TSCTR_FREERUN BIT(4) +#define ECCTL2_REARM BIT(3) +#define ECCTL2_STOP_WRAP_2 BIT(1) +#define ECEINT 0x2c +#define ECFLG 0x2e +#define ECCLR 0x30 +#define ECINT_CTRCMP BIT(7) +#define ECINT_CTRPRD BIT(6) +#define ECINT_CTROVF BIT(5) +#define ECINT_CEVT4BIT(4) +#define ECINT_CEVT3BIT(3) +#define ECINT_CEVT2BIT(2) +#define ECINT_CEVT1BIT(1) +#define ECINT_ALL (ECINT_CTRCMP | \ + ECINT_CTRPRD | \ + ECINT_CTROVF | \ + ECINT_CEVT4 | \ + ECINT_CEVT3 | \ + ECINT_CEVT2 | \ + ECINT_CEVT1) + +/* ECAP driver flags */ +#define ECAP_POLARITY_HIGH BIT(1) +#define ECAP_ENABLED BIT(0) + +struct ecap_context { + u32 cap1; + u32 cap2; + u16 ecctl1; + u16 ecctl2; + u16 eceint; +}; + +struct ecap_state { + unsigned long flags; + unsigned intclk_rate; + void __iomem*regs; + u32 *buf; + struct ecap_context ctx; +}; + +#define dev_to_ecap_state(d) iio_priv(dev_to_iio_dev(d)) + +static const struct iio_chan_spec ecap_channels[] = { + { + .type = IIO_PULSE, + .info_mask_separate = + BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), + .scan_index = 0, + .scan_type = { + .sign = 'u', + .realbits = 32, + .storagebits= 32, + .endianness = IIO_LE, + }, + }, + IIO_CHAN_SOFT_TIMESTAMP(1) +}; + +static ssize_t ecap_attr_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct ecap_state *state = dev_to_ecap_state(dev); + + return sprintf(buf, "%d\n", +
[PATCH v3 0/6] IIO pulse capture support for TI ECAP
Changes since v2: - Remove various unneeded field initialization - Call iio_triggered_buffer_cleanup() on remove Changes since v1: - Rebased to 3.14-rc1 - Renamed in_pulse_polarity to pulse_polarity - Added ABI entries for pulse devices and TI ECAP This series adds support for PWM capture devices within IIO and adds a TI ECAP IIO driver. PWM capture devices are supported using a new IIO "pulse" channel type. The IIO ECAP driver implements interrupt driven triggered buffer capture only as raw sample reads are not applicable to this hardware. Initially, the driver supports a single pulse width measurement with configurable polarity. The ECAP hardware can support measurement of a complete period and duty cycle but this is not yet implemented. Matt Porter (6): iio: add support for pulse width capture devices iio: pulse: add TI ECAP driver iio: enable selection and build of pulse drivers iio: Add ABI docs for pulse capture devices pwm: enable TI PWMSS if the IIO tiecap driver is selected ARM: dts: AM33XX: Add ecap interrupt properties Documentation/ABI/testing/sysfs-bus-iio| 18 + .../ABI/testing/sysfs-bus-iio-pulse-tiecap | 9 + arch/arm/boot/dts/am33xx.dtsi | 6 + drivers/iio/Kconfig| 1 + drivers/iio/Makefile | 1 + drivers/iio/industrialio-core.c| 1 + drivers/iio/pulse/Kconfig | 20 + drivers/iio/pulse/Makefile | 6 + drivers/iio/pulse/tiecap.c | 491 + drivers/pwm/Kconfig| 2 +- include/linux/iio/types.h | 1 + 11 files changed, 555 insertions(+), 1 deletion(-) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap create mode 100644 drivers/iio/pulse/Kconfig create mode 100644 drivers/iio/pulse/Makefile create mode 100644 drivers/iio/pulse/tiecap.c -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 5/6] pwm: enable TI PWMSS if the IIO tiecap driver is selected
The IIO TI ECAP driver depends on the TI PWMSS management driver in this subsystem. Enable PWMSS when the IIO TI ECAP driver is selected. Signed-off-by: Matt Porter --- drivers/pwm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 22f2f28..bd3cc65 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -219,7 +219,7 @@ config PWM_TIEHRPWM config PWM_TIPWMSS bool - default y if SOC_AM33XX && (PWM_TIECAP || PWM_TIEHRPWM) + default y if SOC_AM33XX && (IIO_TIECAP || PWM_TIECAP || PWM_TIEHRPWM) help PWM Subsystem driver support for AM33xx SOC. -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/6] i2c: bcm-kona: register with subsys_initcall
On Wed, Feb 05, 2014 at 10:30:29AM -0500, Alan Stern wrote: > On Wed, 5 Feb 2014, Matt Porter wrote: > > > On Wed, Feb 05, 2014 at 10:08:18AM +0100, Wolfram Sang wrote: > > > On Tue, Feb 04, 2014 at 07:19:07AM -0500, Matt Porter wrote: > > > > > > > Voltage regulators are needed very early due to deferred probe > > > > being incompatible with built-in USB gadget drivers. > > > > > > What does it need to fix those instead? > > > > [added Alan/Felipe for more insight] > > > > Discussion on that topic came about from this submission: > > http://www.spinics.net/lists/linux-usb/msg94217.html > > > > End of it is: > > http://www.spinics.net/lists/linux-usb/msg94731.html > > > > We can either add to the many drivers that already do subsys_initcall() > > for similar reasons...or I can drop this from the series and add gadget > > probe ordering to my TODO list. > > > > In short, it can't be a late_initcall() hack like the original post and > > really could be solved by converting to a real bus (and letting > > deferred probe do its job)..but Alan voiced concerns about that. > > Don't worry too much about what I said. If adding a "gadget" bus will > solve the problem in an appropriate way, and if nobody else objects > (particularly Felipe, who is on vacation now), then go for it. Ok, I'll take a look at what can be done and restart the conversation when Felipe returns. Wolfram: given this, as I mentioned, I'll simply drop this patch from the series and work around it for now. This will probably make Lee and Mark happy to not see subsys_initcall() in the MFD/regulator drivers as well. -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RESEND] ARM: dts: add BeagleBone Audio Cape (Rev A) dtsi
On Wed, Feb 05, 2014 at 08:56:34AM -0600, Nishanth Menon wrote: > On 02/05/2014 08:38 AM, Matt Porter wrote: > > On Wed, Feb 05, 2014 at 08:09:16AM -0600, Nishanth Menon wrote: > >> On 02/05/2014 07:48 AM, Jack Mitchell wrote: > [...] > >>> + * --- a/arch/arm/boot/dts/am335x-boneblack.dts > >>> + * +++ b/arch/arm/boot/dts/am335x-boneblack.dts > >>> + * @@ -73,6 +74,6 @@ > >>> + * pinctrl-names = "default", "off"; > >>> + * pinctrl-0 = <_hdmi_bonelt_pins>; > >>> + * pinctrl-1 = <_hdmi_bonelt_off_pins>; > >>> + * - status = "okay"; > >>> + * + status = "disabled"; > >>> + * }; > >>> + * }; > >>> + */ > >>> + > >> how about making the audio-cape-reva.dts which includes and overrides > >> parameters of boneblack.dts? > > > > Yeah, that might be a little cleaner. Black makes things unfortunately > > messy for these capes that were really intended for BBW :( > > yes indeed - we might have to live with more dts in such a case. > > > >> Further, I see a bunch of capes in > >> http://elinux.org/Beagleboard:BeagleBone_Capes > >> > >> Assuming that we dont want to discuss capebus all over again, is this > >> the approach we'd like to consider in the interim? > > > > I think that's a fair assumption...I'll note that there is work slowly > > in progress on a very minimal implementation DT overlays upstream. But > > that doesn't exist. We are simply interested in a sane way to use the > > hardware we own in mainline and this approach makes it possible to build > > a kernel+dtb from mainline that works for this configuration. If > > there's a better way to support this hardware *today* let's discuss it. > > One of the big benefits to having this upstream is that it's no longer > > out of sight out of mind. It should be managed alongside all the other > > am335x dts data. > > > > Incidentally, I'm hoping to contribute a similar patch for the DVI cape > > I have here. > > If I am not mistaken, the capes are stackable (within reason), and are > not exactly hotpluggable.. question pops up as to how do we handle > multiple cape descriptions on the same board without having the user > to create custom dts which includes each relevant cape dts he has on > his/her bone? I wonder(without proper research, just thinking aloud) > if u-boot can do some sort of merge of dtbs - assuming ofcourse eeprom > data is used to detect the capes plugged on board? Well covered in the original discussion. gcl summarizes options in https://lkml.org/lkml/2012/11/5/615 Since then, the basic overlay support for the kernel is pretty much a done deal. It has a wide variety of users (FPGA folks) beyond this board specific case. The problem you describe about resource management and conflicts would probably need to be built on top of that. Pantelis had a PoC implementation with capebus/not-a-capebus but that's not part of what is being upstreamed. I'm not sure if there's anybody with enough time out of the Beagleboard community to upstream a resource manager on top of the basic overlay support that's in progress. However, it might make a nice GSoC2014 project. :) -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/6] i2c: bcm-kona: register with subsys_initcall
On Wed, Feb 05, 2014 at 10:08:18AM +0100, Wolfram Sang wrote: > On Tue, Feb 04, 2014 at 07:19:07AM -0500, Matt Porter wrote: > > > Voltage regulators are needed very early due to deferred probe > > being incompatible with built-in USB gadget drivers. > > What does it need to fix those instead? [added Alan/Felipe for more insight] Discussion on that topic came about from this submission: http://www.spinics.net/lists/linux-usb/msg94217.html End of it is: http://www.spinics.net/lists/linux-usb/msg94731.html We can either add to the many drivers that already do subsys_initcall() for similar reasons...or I can drop this from the series and add gadget probe ordering to my TODO list. In short, it can't be a late_initcall() hack like the original post and really could be solved by converting to a real bus (and letting deferred probe do its job)..but Alan voiced concerns about that. -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RESEND] ARM: dts: add BeagleBone Audio Cape (Rev A) dtsi
On Wed, Feb 05, 2014 at 08:09:16AM -0600, Nishanth Menon wrote: > On 02/05/2014 07:48 AM, Jack Mitchell wrote: > > From: Jack Mitchell > > > > Devicetree include file for setting up the am335x mcasp bus, i2c-2 > > bus, and audio codec required for a functioning BeagleBone Audio Cape. > > > > Signed-off-by: Jack Mitchell > > Signed-off-by: Matt Porter > > --- > > arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi | 124 > > + > > arch/arm/boot/dts/am335x-bone-common.dtsi | 14 +++ > > 2 files changed, 138 insertions(+) > > create mode 100644 arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi > > > > diff --git a/arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi > > b/arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi > > new file mode 100644 > > index 000..b8ec3dc > > --- /dev/null > > +++ b/arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi > > @@ -0,0 +1,124 @@ > > +/* > > + * Copyright (C) 2014 Jack Mitchell > > + * > > + * This program is free software; you can redistribute it and/or modify > > + * it under the terms of the GNU General Public License version 2 as > > + * published by the Free Software Foundation. > > + * > > + * In order to enable the BeagleBone Audio Cape this dtsi must be > > + * incuded in the top level dts. On BeagleBone Black hardware the > > + * status of the HDMI dts node must also be set to "disabled". > > + * > > + * --- a/arch/arm/boot/dts/am335x-bone.dts > > + * +++ b/arch/arm/boot/dts/am335x-bone.dts > > + * @@ -9,6 +9,7 @@ > > + * > > + * #include "am33xx.dtsi" > > + * #include "am335x-bone-common.dtsi" > > + * +#include "am335x-bone-audio-cape-reva.dtsi" > > + * > > + * _reg { > > + * regulator-min-microvolt = <180>; > > + * > > + * On BeagleBone Black hardware the status of the HDMI dts node must > > + * also be set to "disabled" > > + * > > + * --- a/arch/arm/boot/dts/am335x-boneblack.dts > > + * +++ b/arch/arm/boot/dts/am335x-boneblack.dts > > + * @@ -73,6 +74,6 @@ > > + * pinctrl-names = "default", "off"; > > + * pinctrl-0 = <_hdmi_bonelt_pins>; > > + * pinctrl-1 = <_hdmi_bonelt_off_pins>; > > + * - status = "okay"; > > + * + status = "disabled"; > > + * }; > > + * }; > > + */ > > + > how about making the audio-cape-reva.dts which includes and overrides > parameters of boneblack.dts? Yeah, that might be a little cleaner. Black makes things unfortunately messy for these capes that were really intended for BBW :( > Further, I see a bunch of capes in > http://elinux.org/Beagleboard:BeagleBone_Capes > > Assuming that we dont want to discuss capebus all over again, is this > the approach we'd like to consider in the interim? I think that's a fair assumption...I'll note that there is work slowly in progress on a very minimal implementation DT overlays upstream. But that doesn't exist. We are simply interested in a sane way to use the hardware we own in mainline and this approach makes it possible to build a kernel+dtb from mainline that works for this configuration. If there's a better way to support this hardware *today* let's discuss it. One of the big benefits to having this upstream is that it's no longer out of sight out of mind. It should be managed alongside all the other am335x dts data. Incidentally, I'm hoping to contribute a similar patch for the DVI cape I have here. -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RESEND] ARM: dts: add BeagleBone Audio Cape (Rev A) dtsi
On Wed, Feb 05, 2014 at 08:09:16AM -0600, Nishanth Menon wrote: On 02/05/2014 07:48 AM, Jack Mitchell wrote: From: Jack Mitchell j...@embed.me.uk Devicetree include file for setting up the am335x mcasp bus, i2c-2 bus, and audio codec required for a functioning BeagleBone Audio Cape. Signed-off-by: Jack Mitchell j...@embed.me.uk Signed-off-by: Matt Porter mpor...@linaro.org --- arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi | 124 + arch/arm/boot/dts/am335x-bone-common.dtsi | 14 +++ 2 files changed, 138 insertions(+) create mode 100644 arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi diff --git a/arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi b/arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi new file mode 100644 index 000..b8ec3dc --- /dev/null +++ b/arch/arm/boot/dts/am335x-bone-audio-cape-reva.dtsi @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2014 Jack Mitchell j...@embed.me.uk + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * In order to enable the BeagleBone Audio Cape this dtsi must be + * incuded in the top level dts. On BeagleBone Black hardware the + * status of the HDMI dts node must also be set to disabled. + * + * --- a/arch/arm/boot/dts/am335x-bone.dts + * +++ b/arch/arm/boot/dts/am335x-bone.dts + * @@ -9,6 +9,7 @@ + * + * #include am33xx.dtsi + * #include am335x-bone-common.dtsi + * +#include am335x-bone-audio-cape-reva.dtsi + * + * ldo3_reg { + * regulator-min-microvolt = 180; + * + * On BeagleBone Black hardware the status of the HDMI dts node must + * also be set to disabled + * + * --- a/arch/arm/boot/dts/am335x-boneblack.dts + * +++ b/arch/arm/boot/dts/am335x-boneblack.dts + * @@ -73,6 +74,6 @@ + * pinctrl-names = default, off; + * pinctrl-0 = nxp_hdmi_bonelt_pins; + * pinctrl-1 = nxp_hdmi_bonelt_off_pins; + * - status = okay; + * + status = disabled; + * }; + * }; + */ + how about making the audio-cape-reva.dts which includes and overrides parameters of boneblack.dts? Yeah, that might be a little cleaner. Black makes things unfortunately messy for these capes that were really intended for BBW :( Further, I see a bunch of capes in http://elinux.org/Beagleboard:BeagleBone_Capes Assuming that we dont want to discuss capebus all over again, is this the approach we'd like to consider in the interim? I think that's a fair assumption...I'll note that there is work slowly in progress on a very minimal implementation DT overlays upstream. But that doesn't exist. We are simply interested in a sane way to use the hardware we own in mainline and this approach makes it possible to build a kernel+dtb from mainline that works for this configuration. If there's a better way to support this hardware *today* let's discuss it. One of the big benefits to having this upstream is that it's no longer out of sight out of mind. It should be managed alongside all the other am335x dts data. Incidentally, I'm hoping to contribute a similar patch for the DVI cape I have here. -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/6] i2c: bcm-kona: register with subsys_initcall
On Wed, Feb 05, 2014 at 10:08:18AM +0100, Wolfram Sang wrote: On Tue, Feb 04, 2014 at 07:19:07AM -0500, Matt Porter wrote: Voltage regulators are needed very early due to deferred probe being incompatible with built-in USB gadget drivers. What does it need to fix those instead? [added Alan/Felipe for more insight] Discussion on that topic came about from this submission: http://www.spinics.net/lists/linux-usb/msg94217.html End of it is: http://www.spinics.net/lists/linux-usb/msg94731.html We can either add to the many drivers that already do subsys_initcall() for similar reasons...or I can drop this from the series and add gadget probe ordering to my TODO list. In short, it can't be a late_initcall() hack like the original post and really could be solved by converting to a real bus (and letting deferred probe do its job)..but Alan voiced concerns about that. -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH RESEND] ARM: dts: add BeagleBone Audio Cape (Rev A) dtsi
On Wed, Feb 05, 2014 at 08:56:34AM -0600, Nishanth Menon wrote: On 02/05/2014 08:38 AM, Matt Porter wrote: On Wed, Feb 05, 2014 at 08:09:16AM -0600, Nishanth Menon wrote: On 02/05/2014 07:48 AM, Jack Mitchell wrote: [...] + * --- a/arch/arm/boot/dts/am335x-boneblack.dts + * +++ b/arch/arm/boot/dts/am335x-boneblack.dts + * @@ -73,6 +74,6 @@ + * pinctrl-names = default, off; + * pinctrl-0 = nxp_hdmi_bonelt_pins; + * pinctrl-1 = nxp_hdmi_bonelt_off_pins; + * - status = okay; + * + status = disabled; + * }; + * }; + */ + how about making the audio-cape-reva.dts which includes and overrides parameters of boneblack.dts? Yeah, that might be a little cleaner. Black makes things unfortunately messy for these capes that were really intended for BBW :( yes indeed - we might have to live with more dts in such a case. Further, I see a bunch of capes in http://elinux.org/Beagleboard:BeagleBone_Capes Assuming that we dont want to discuss capebus all over again, is this the approach we'd like to consider in the interim? I think that's a fair assumption...I'll note that there is work slowly in progress on a very minimal implementation DT overlays upstream. But that doesn't exist. We are simply interested in a sane way to use the hardware we own in mainline and this approach makes it possible to build a kernel+dtb from mainline that works for this configuration. If there's a better way to support this hardware *today* let's discuss it. One of the big benefits to having this upstream is that it's no longer out of sight out of mind. It should be managed alongside all the other am335x dts data. Incidentally, I'm hoping to contribute a similar patch for the DVI cape I have here. If I am not mistaken, the capes are stackable (within reason), and are not exactly hotpluggable.. question pops up as to how do we handle multiple cape descriptions on the same board without having the user to create custom dts which includes each relevant cape dts he has on his/her bone? I wonder(without proper research, just thinking aloud) if u-boot can do some sort of merge of dtbs - assuming ofcourse eeprom data is used to detect the capes plugged on board? Well covered in the original discussion. gcl summarizes options in https://lkml.org/lkml/2012/11/5/615 Since then, the basic overlay support for the kernel is pretty much a done deal. It has a wide variety of users (FPGA folks) beyond this board specific case. The problem you describe about resource management and conflicts would probably need to be built on top of that. Pantelis had a PoC implementation with capebus/not-a-capebus but that's not part of what is being upstreamed. I'm not sure if there's anybody with enough time out of the Beagleboard community to upstream a resource manager on top of the basic overlay support that's in progress. However, it might make a nice GSoC2014 project. :) -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/6] i2c: bcm-kona: register with subsys_initcall
On Wed, Feb 05, 2014 at 10:30:29AM -0500, Alan Stern wrote: On Wed, 5 Feb 2014, Matt Porter wrote: On Wed, Feb 05, 2014 at 10:08:18AM +0100, Wolfram Sang wrote: On Tue, Feb 04, 2014 at 07:19:07AM -0500, Matt Porter wrote: Voltage regulators are needed very early due to deferred probe being incompatible with built-in USB gadget drivers. What does it need to fix those instead? [added Alan/Felipe for more insight] Discussion on that topic came about from this submission: http://www.spinics.net/lists/linux-usb/msg94217.html End of it is: http://www.spinics.net/lists/linux-usb/msg94731.html We can either add to the many drivers that already do subsys_initcall() for similar reasons...or I can drop this from the series and add gadget probe ordering to my TODO list. In short, it can't be a late_initcall() hack like the original post and really could be solved by converting to a real bus (and letting deferred probe do its job)..but Alan voiced concerns about that. Don't worry too much about what I said. If adding a gadget bus will solve the problem in an appropriate way, and if nobody else objects (particularly Felipe, who is on vacation now), then go for it. Ok, I'll take a look at what can be done and restart the conversation when Felipe returns. Wolfram: given this, as I mentioned, I'll simply drop this patch from the series and work around it for now. This will probably make Lee and Mark happy to not see subsys_initcall() in the MFD/regulator drivers as well. -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 5/6] pwm: enable TI PWMSS if the IIO tiecap driver is selected
The IIO TI ECAP driver depends on the TI PWMSS management driver in this subsystem. Enable PWMSS when the IIO TI ECAP driver is selected. Signed-off-by: Matt Porter mpor...@linaro.org --- drivers/pwm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 22f2f28..bd3cc65 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -219,7 +219,7 @@ config PWM_TIEHRPWM config PWM_TIPWMSS bool - default y if SOC_AM33XX (PWM_TIECAP || PWM_TIEHRPWM) + default y if SOC_AM33XX (IIO_TIECAP || PWM_TIECAP || PWM_TIEHRPWM) help PWM Subsystem driver support for AM33xx SOC. -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 2/6] iio: pulse: add TI ECAP driver
Adds support for capturing PWM signals using the TI ECAP peripheral. This driver supports triggered buffer capture of pulses on multiple ECAP instances. In addition, the driver supports configurable polarity of the signal to be captured. Signed-off-by: Matt Porter mpor...@linaro.org --- drivers/iio/pulse/Kconfig | 20 ++ drivers/iio/pulse/Makefile | 6 + drivers/iio/pulse/tiecap.c | 491 + 3 files changed, 517 insertions(+) create mode 100644 drivers/iio/pulse/Kconfig create mode 100644 drivers/iio/pulse/Makefile create mode 100644 drivers/iio/pulse/tiecap.c diff --git a/drivers/iio/pulse/Kconfig b/drivers/iio/pulse/Kconfig new file mode 100644 index 000..9864d4b --- /dev/null +++ b/drivers/iio/pulse/Kconfig @@ -0,0 +1,20 @@ +# +# Pulse Capture Devices +# +# When adding new entries keep the list in alphabetical order + +menu Pulse Capture Devices + +config IIO_TIECAP + tristate TI ECAP Pulse Capture + depends on SOC_AM33XX + select IIO_BUFFER + select IIO_TRIGGERED_BUFFER + help +If you say yes here you get support for the TI ECAP peripheral +in pulse capture mode. + +This driver can also be built as a module. If so, the module +will be called tiecap + +endmenu diff --git a/drivers/iio/pulse/Makefile b/drivers/iio/pulse/Makefile new file mode 100644 index 000..94d4b00 --- /dev/null +++ b/drivers/iio/pulse/Makefile @@ -0,0 +1,6 @@ +# +# Makefile for IIO PWM Capture Devices +# + +# When adding new entries keep the list in alphabetical order +obj-$(CONFIG_IIO_TIECAP) += tiecap.o diff --git a/drivers/iio/pulse/tiecap.c b/drivers/iio/pulse/tiecap.c new file mode 100644 index 000..fd96745 --- /dev/null +++ b/drivers/iio/pulse/tiecap.c @@ -0,0 +1,491 @@ +/* + * ECAP IIO pulse capture driver + * + * Copyright (C) 2014 Linaro Limited + * Author: Matt Porter mpor...@linaro.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include linux/clk.h +#include linux/err.h +#include linux/iio/buffer.h +#include linux/iio/iio.h +#include linux/iio/sysfs.h +#include linux/iio/trigger.h +#include linux/iio/trigger_consumer.h +#include linux/iio/triggered_buffer.h +#include linux/io.h +#include linux/interrupt.h +#include linux/irq.h +#include linux/module.h +#include linux/of_device.h +#include linux/platform_device.h +#include linux/pm_runtime.h + +#include ../../pwm/pwm-tipwmss.h + +/* ECAP regs and bits */ +#define CAP1 0x08 +#define CAP2 0x0c +#define ECCTL1 0x28 +#define ECCTL1_RUN_FREEBIT(15) +#define ECCTL1_CAPLDEN BIT(8) +#define ECCTL1_CAP2POL BIT(2) +#define ECCTL1_CTRRST1 BIT(1) +#define ECCTL1_CAP1POL BIT(0) +#define ECCTL2 0x2a +#define ECCTL2_SYNCO_SEL_DIS BIT(7) +#define ECCTL2_TSCTR_FREERUN BIT(4) +#define ECCTL2_REARM BIT(3) +#define ECCTL2_STOP_WRAP_2 BIT(1) +#define ECEINT 0x2c +#define ECFLG 0x2e +#define ECCLR 0x30 +#define ECINT_CTRCMP BIT(7) +#define ECINT_CTRPRD BIT(6) +#define ECINT_CTROVF BIT(5) +#define ECINT_CEVT4BIT(4) +#define ECINT_CEVT3BIT(3) +#define ECINT_CEVT2BIT(2) +#define ECINT_CEVT1BIT(1) +#define ECINT_ALL (ECINT_CTRCMP | \ + ECINT_CTRPRD | \ + ECINT_CTROVF | \ + ECINT_CEVT4 | \ + ECINT_CEVT3 | \ + ECINT_CEVT2 | \ + ECINT_CEVT1) + +/* ECAP driver flags */ +#define ECAP_POLARITY_HIGH BIT(1) +#define ECAP_ENABLED BIT(0) + +struct ecap_context { + u32 cap1; + u32 cap2; + u16 ecctl1; + u16 ecctl2; + u16 eceint; +}; + +struct ecap_state { + unsigned long flags; + unsigned intclk_rate; + void __iomem*regs; + u32 *buf; + struct ecap_context ctx; +}; + +#define dev_to_ecap_state(d) iio_priv(dev_to_iio_dev(d)) + +static const struct iio_chan_spec ecap_channels[] = { + { + .type = IIO_PULSE, + .info_mask_separate = + BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), + .scan_index = 0, + .scan_type = { + .sign = 'u', + .realbits = 32, + .storagebits= 32, + .endianness = IIO_LE
[PATCH v3 0/6] IIO pulse capture support for TI ECAP
Changes since v2: - Remove various unneeded field initialization - Call iio_triggered_buffer_cleanup() on remove Changes since v1: - Rebased to 3.14-rc1 - Renamed in_pulse_polarity to pulse_polarity - Added ABI entries for pulse devices and TI ECAP This series adds support for PWM capture devices within IIO and adds a TI ECAP IIO driver. PWM capture devices are supported using a new IIO pulse channel type. The IIO ECAP driver implements interrupt driven triggered buffer capture only as raw sample reads are not applicable to this hardware. Initially, the driver supports a single pulse width measurement with configurable polarity. The ECAP hardware can support measurement of a complete period and duty cycle but this is not yet implemented. Matt Porter (6): iio: add support for pulse width capture devices iio: pulse: add TI ECAP driver iio: enable selection and build of pulse drivers iio: Add ABI docs for pulse capture devices pwm: enable TI PWMSS if the IIO tiecap driver is selected ARM: dts: AM33XX: Add ecap interrupt properties Documentation/ABI/testing/sysfs-bus-iio| 18 + .../ABI/testing/sysfs-bus-iio-pulse-tiecap | 9 + arch/arm/boot/dts/am33xx.dtsi | 6 + drivers/iio/Kconfig| 1 + drivers/iio/Makefile | 1 + drivers/iio/industrialio-core.c| 1 + drivers/iio/pulse/Kconfig | 20 + drivers/iio/pulse/Makefile | 6 + drivers/iio/pulse/tiecap.c | 491 + drivers/pwm/Kconfig| 2 +- include/linux/iio/types.h | 1 + 11 files changed, 555 insertions(+), 1 deletion(-) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap create mode 100644 drivers/iio/pulse/Kconfig create mode 100644 drivers/iio/pulse/Makefile create mode 100644 drivers/iio/pulse/tiecap.c -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 3/6] iio: enable selection and build of pulse drivers
Add the pulse driver subdirectory when configuring and building IIO. Signed-off-by: Matt Porter mpor...@linaro.org --- drivers/iio/Kconfig | 1 + drivers/iio/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iio/Kconfig b/drivers/iio/Kconfig index 5dd0e12..286acc3 100644 --- a/drivers/iio/Kconfig +++ b/drivers/iio/Kconfig @@ -74,6 +74,7 @@ if IIO_TRIGGER source drivers/iio/trigger/Kconfig endif #IIO_TRIGGER source drivers/iio/pressure/Kconfig +source drivers/iio/pulse/Kconfig source drivers/iio/temperature/Kconfig endif # IIO diff --git a/drivers/iio/Makefile b/drivers/iio/Makefile index 887d390..9a953c9 100644 --- a/drivers/iio/Makefile +++ b/drivers/iio/Makefile @@ -24,5 +24,6 @@ obj-y += light/ obj-y += magnetometer/ obj-y += orientation/ obj-y += pressure/ +obj-y += pulse/ obj-y += temperature/ obj-y += trigger/ -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 4/6] iio: Add ABI docs for pulse capture devices
Add standard ABI entries for pulse capture devices. Also add a separate ABI entry for the TI ECAP driver polarity option. Signed-off-by: Matt Porter mpor...@linaro.org --- Documentation/ABI/testing/sysfs-bus-iio | 18 ++ Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap | 9 + 2 files changed, 27 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 6e02c50..918a201 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -210,6 +210,14 @@ Contact: linux-...@vger.kernel.org Description: Scaled humidity measurement in milli percent. +What: /sys/bus/iio/devices/iio:deviceX/in_pulseY_raw +What: /sys/bus/iio/devices/iio:deviceX/in_pulse_raw +KernelVersion: 3.15 +Contact: linux-...@vger.kernel.org +Description: + Raw pulse measurement from channel Y. Units after + application of scale and offset are nanoseconds. + What: /sys/bus/iio/devices/iio:deviceX/in_accel_offset What: /sys/bus/iio/devices/iio:deviceX/in_accel_x_offset What: /sys/bus/iio/devices/iio:deviceX/in_accel_y_offset @@ -220,6 +228,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_tempY_offset What: /sys/bus/iio/devices/iio:deviceX/in_temp_offset What: /sys/bus/iio/devices/iio:deviceX/in_pressureY_offset What: /sys/bus/iio/devices/iio:deviceX/in_pressure_offset +What: /sys/bus/iio/devices/iio:deviceX/in_pulseY_offset +What: /sys/bus/iio/devices/iio:deviceX/in_pulse_offset KernelVersion: 2.6.35 Contact: linux-...@vger.kernel.org Description: @@ -251,6 +261,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_magn_y_scale What: /sys/bus/iio/devices/iio:deviceX/in_magn_z_scale What: /sys/bus/iio/devices/iio:deviceX/in_pressureY_scale What: /sys/bus/iio/devices/iio:deviceX/in_pressure_scale +What: /sys/bus/iio/devices/iio:deviceX/in_pulseY_scale +What: /sys/bus/iio/devices/iio:deviceX/in_pulse_scale KernelVersion: 2.6.35 Contact: linux-...@vger.kernel.org Description: @@ -784,6 +796,8 @@ What: /sys/.../iio:deviceX/scan_elements/in_incli_x_en What: /sys/.../iio:deviceX/scan_elements/in_incli_y_en What: /sys/.../iio:deviceX/scan_elements/in_pressureY_en What: /sys/.../iio:deviceX/scan_elements/in_pressure_en +What: /sys/.../iio:deviceX/scan_elements/in_pulseY_en +What: /sys/.../iio:deviceX/scan_elements/in_pulse_en KernelVersion: 2.6.37 Contact: linux-...@vger.kernel.org Description: @@ -799,6 +813,8 @@ What: /sys/.../iio:deviceX/scan_elements/in_voltageY_supply_type What: /sys/.../iio:deviceX/scan_elements/in_timestamp_type What: /sys/.../iio:deviceX/scan_elements/in_pressureY_type What: /sys/.../iio:deviceX/scan_elements/in_pressure_type +What: /sys/.../iio:deviceX/scan_elements/in_pulseY_type +What: /sys/.../iio:deviceX/scan_elements/in_pulse_type KernelVersion: 2.6.37 Contact: linux-...@vger.kernel.org Description: @@ -845,6 +861,8 @@ What: /sys/.../iio:deviceX/scan_elements/in_incli_y_index What: /sys/.../iio:deviceX/scan_elements/in_timestamp_index What: /sys/.../iio:deviceX/scan_elements/in_pressureY_index What: /sys/.../iio:deviceX/scan_elements/in_pressure_index +What: /sys/.../iio:deviceX/scan_elements/in_pulseY_index +What: /sys/.../iio:deviceX/scan_elements/in_pulse_index KernelVersion: 2.6.37 Contact: linux-...@vger.kernel.org Description: diff --git a/Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap b/Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap new file mode 100644 index 000..a9e4a9f --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap @@ -0,0 +1,9 @@ +What: /sys/bus/iio/devices/iio:deviceX/pulse_polarityY +What: /sys/bus/iio/devices/iio:deviceX/pulse_polarity +Date: January 2014 +KernelVersion: 3.15 +Contact: Matt Porter mpor...@linaro.org +Description: + Get and set the polarity of the pulse signal to be captured + for channel Y. 1 indicates a high pulse signal and 0 + indicates a low pulse signal. -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 1/6] iio: add support for pulse width capture devices
Add a channel type to support pulse width capture devices. These devices capture the timing of a PWM signal based on a configurable trigger Signed-off-by: Matt Porter mpor...@linaro.org --- drivers/iio/industrialio-core.c | 1 + include/linux/iio/types.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index acc911a..6ea0cf8 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -70,6 +70,7 @@ static const char * const iio_chan_type_name_spec[] = { [IIO_CCT] = cct, [IIO_PRESSURE] = pressure, [IIO_HUMIDITYRELATIVE] = humidityrelative, + [IIO_PULSE] = pulse, }; static const char * const iio_modifier_names[] = { diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 084d882..4fa8840 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h @@ -30,6 +30,7 @@ enum iio_chan_type { IIO_CCT, IIO_PRESSURE, IIO_HUMIDITYRELATIVE, + IIO_PULSE, }; enum iio_modifier { -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 6/6] ARM: dts: AM33XX: Add ecap interrupt properties
Add missing interrupt properties to the ecap0, ecap1, and ecap2 nodes. Signed-off-by: Matt Porter mpor...@linaro.org --- arch/arm/boot/dts/am33xx.dtsi | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi index 6d95d3d..b4139ba 100644 --- a/arch/arm/boot/dts/am33xx.dtsi +++ b/arch/arm/boot/dts/am33xx.dtsi @@ -582,6 +582,8 @@ compatible = ti,am33xx-ecap; #pwm-cells = 3; reg = 0x48300100 0x80; + interrupts = 31; + interrupt-names = ecap0; ti,hwmods = ecap0; status = disabled; }; @@ -610,6 +612,8 @@ compatible = ti,am33xx-ecap; #pwm-cells = 3; reg = 0x48302100 0x80; + interrupts = 47; + interrupt-names = ecap1; ti,hwmods = ecap1; status = disabled; }; @@ -638,6 +642,8 @@ compatible = ti,am33xx-ecap; #pwm-cells = 3; reg = 0x48304100 0x80; + interrupts = 61; + interrupt-names = ecap2; ti,hwmods = ecap2; status = disabled; }; -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 1/2] iio:as3935: Add DT binding docs for AS3935 driver
On Tue, Feb 04, 2014 at 08:52:26PM -0800, Matt Ranostay Matt Ranostay wrote: > On Tue, Feb 4, 2014 at 8:43 PM, Matt Porter wrote: > > On Tue, Feb 04, 2014 at 07:14:55PM -0800, Matt Ranostay Matt Ranostay wrote: > >> Document compatible string, required and optional DT properties for > >> AS3935 chipset driver. > >> > >> Signed-off-by: Matt Ranostay > >> --- > >> .../devicetree/bindings/iio/proximity/as3935.txt | 25 > >> ++ > >> 1 file changed, 25 insertions(+) > >> create mode 100644 > >> Documentation/devicetree/bindings/iio/proximity/as3935.txt > >> > >> diff --git a/Documentation/devicetree/bindings/iio/proximity/as3935.txt > >> b/Documentation/devicetree/bindings/iio/proximity/as3935.txt > >> new file mode 100644 > >> index 000..7e117cd > >> --- /dev/null > >> +++ b/Documentation/devicetree/bindings/iio/proximity/as3935.txt > >> @@ -0,0 +1,25 @@ > >> +Austrian Microsystems AS3935 Franklin lightning sensor device driver > >> + > >> +Required properties: > >> + - compatible: must be "ams,as3935" > > > > Change this to "amstaos,as3935" > > > > amstaos (AMS bought Taos) is already a registered vendor prefix in > > vendor-prefixes.txt > > > >> + - reg: SPI chip select number for the device > >> + - spi-cpha: SPI Mode 1 > > > > When using generic binding properties, please reference the binding > > being used. Like: > > > > - spi-cpha: SPI Mode 1. Refer to spi/spi-bus.txt for generic SPI > > slave node bindings. > > > Noted. > > >> + - interrupt-parent : should be the phandle for the interrupt > >> controller > >> + - interrupts : interrupt mapping for GPIO IRQ > > > > Refer to interrupt-controller/interrupts.txt for generic > > interrupt client node bindings. > > > Noted. > > >> + > >> +Optional properties: > >> + - ams,tune-cap: Calibration tuning capacitor stepping value 0 - 15. > >> + Range of 0 to 120 pF, 8pF steps. This will require using the > >> + calibration data from the manufacturer. > >> + > >> + > >> +Example: > >> + > >> +as3935@0 { > >> + compatible = "ams,as3935"; > >> + reg = <0>; > >> + spi-cpha; > >> + interrupt-parent = <>; > >> + interrupts = <16 1>; > >> + ams,tune-cap = /bits/ 8 <10>; > > > > What is this? Why not just ams,tune-cap = <10>; ? > > > > It's a value between 0-15, right? > > Correct but it is using of_property_read_u8() so that requires the > /bits/ statement. > Should this just be a u32 value? Do you really need a u8? If not just read_u32() into an int and keep this syntax simple. -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 1/2] iio:as3935: Add DT binding docs for AS3935 driver
On Tue, Feb 04, 2014 at 07:14:55PM -0800, Matt Ranostay Matt Ranostay wrote: > Document compatible string, required and optional DT properties for > AS3935 chipset driver. > > Signed-off-by: Matt Ranostay > --- > .../devicetree/bindings/iio/proximity/as3935.txt | 25 > ++ > 1 file changed, 25 insertions(+) > create mode 100644 Documentation/devicetree/bindings/iio/proximity/as3935.txt > > diff --git a/Documentation/devicetree/bindings/iio/proximity/as3935.txt > b/Documentation/devicetree/bindings/iio/proximity/as3935.txt > new file mode 100644 > index 000..7e117cd > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/proximity/as3935.txt > @@ -0,0 +1,25 @@ > +Austrian Microsystems AS3935 Franklin lightning sensor device driver > + > +Required properties: > + - compatible: must be "ams,as3935" Change this to "amstaos,as3935" amstaos (AMS bought Taos) is already a registered vendor prefix in vendor-prefixes.txt > + - reg: SPI chip select number for the device > + - spi-cpha: SPI Mode 1 When using generic binding properties, please reference the binding being used. Like: - spi-cpha: SPI Mode 1. Refer to spi/spi-bus.txt for generic SPI slave node bindings. > + - interrupt-parent : should be the phandle for the interrupt controller > + - interrupts : interrupt mapping for GPIO IRQ Refer to interrupt-controller/interrupts.txt for generic interrupt client node bindings. > + > +Optional properties: > + - ams,tune-cap: Calibration tuning capacitor stepping value 0 - 15. > + Range of 0 to 120 pF, 8pF steps. This will require using the > + calibration data from the manufacturer. > + > + > +Example: > + > +as3935@0 { > + compatible = "ams,as3935"; > + reg = <0>; > + spi-cpha; > + interrupt-parent = <>; > + interrupts = <16 1>; > + ams,tune-cap = /bits/ 8 <10>; What is this? Why not just ams,tune-cap = <10>; ? It's a value between 0-15, right? -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/6] regulator: add bcm59056 regulator driver
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 regulator_dev *dev, unsigned int mode) > > +{ > > + if (mode == REGULATOR_MODE_NORMAL) > > + return 0; > > + else > > + return -EINVAL; > > +} > > These do nothing, don't implement them. Will remove. Maybe some day. > > + if (bcm59056->dev->of_node) > > + pmu_data = bcm59056_parse_dt_reg_data(pdev, > > + _reg_matches); > > It'd seem a bit neater to put the OF check into the parse function but > meh. On second look, I'd agree. Easy enough to clean up. > > + if (!pmu_data) { > > + dev_err(>dev, "Platform data not found\n"); > > + return -EINVAL; > > + } > > Like I said when reviewing the binding this should not cause the driver > to fail to load. Will fix. > > + /* > > +* Regulator API handles empty constraints but not NULL > > +* constraints > > +*/ > > + if (!reg_data) > > + continue; > > It should do... if not then make it so since that'd mean most drivers > are buggy. Ahh, I see there is a check for NULL in the core. Will drop. -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/6] regulator: add bcm59056 pmu DT binding
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 functions? It's your average multi-function device with other functions as you are suspecting. Buried in the the MFD driver comments is me admitting that I need to split this into two bindings. The base device, "bcm59056" and then "bcm59056-reg". So point noted, I'll updated with the appropriate binding for each. > > +- regulators: This is the list of child nodes that specify the regulator > > + initialization data for defined regulators. Generic regulator bindings > > + are described in regulator/regulator.txt. > > The regulators property should always be optional, the driver should be > able to start up and read back the hardware state without any further > configuration. Ahh, ok. I will make it so. Thanks, Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/6] mfd: add bcm59056 pmu driver
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. > > > > > > > > Signed-off-by: Matt Porter > > > > Reviewed-by: Tim Kryger > > > > Reviewed-by: Markus Mayer > > > > --- > > > > drivers/mfd/Kconfig | 8 +++ > > > > drivers/mfd/Makefile | 1 + > > > > drivers/mfd/bcm59056.c | 119 > > > > +++ > > > > include/linux/mfd/bcm59056.h | 35 + > > > > 4 files changed, 163 insertions(+) > > > > create mode 100644 drivers/mfd/bcm59056.c > > > > create mode 100644 include/linux/mfd/bcm59056.h > > > > > > I thought this was a DT only driver? If so, you probably want to use > > > of_match_device() instead. > > > > Correct, I'll use of_match_device() > > If you're going to use this ... > > > > > > You've gone to the trouble of setting a device version here, but you > > > don't seem to use it? > > > > I'll drop the device version > > ... 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"}, { } }; > > > > +static const struct i2c_device_id bcm59056_i2c_id[] = { > > > > + { "bcm59056", BCM59056 }, > > > > + { } > > > > +}; > > > > > > Ah, I guess this is where id->driver comes from. > > > > > > It's pretty silly that the I2C subsystem demands the presence of this > > > table, despite not using it if an of_device_id table is present. > > > > It does make it very difficult to follow DT enabled I2C client drivers > > :( I'll drop the BCM59056 too. > > And I don't think you can drop this, as the I2C subsystem still > insists on it. Agreed. I'm just dropping explicit population of the driver_data field here. static const struct i2c_device_id bcm59056_i2c_id[] = { { "bcm59056" }, { } }; > > > > > +/* chip id */ > > > > +#define BCM59056 0 > > > > > > Lonely, oh so lonely! > > > > Understood. Will remove. > > I think you need to keep this to supply the silly I2C ID table. > > I would just omit the '.data = (void *) VERSION' from the > of_match_table until you require it. Well, it's not even necessary for I2C ID table. the I2C subsystem is happy with just a matching entry on the i2c_device_id name field and NULL driver_data. palmas is implemented in this manner. -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 0/6] BCM59056 PMU regulator support
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 of regulators on the otg and sdhci peripherals. > > > > Matt Porter (6): > > i2c: bcm-kona: register with subsys_initcall > > regulator: add bcm59056 pmu DT binding > > mfd: add bcm59056 pmu driver > > regulator: add bcm59056 regulator driver > > ARM: configs: bcm_defconfig: enable bcm59056 regulator support > > ARM: dts: add bcm59056 pmu support and enable for bcm28155-ap > > > > .../devicetree/bindings/regulator/bcm59056.txt | 37 ++ > > arch/arm/boot/dts/bcm28155-ap.dts | 41 ++ > > arch/arm/boot/dts/bcm59056.dtsi| 158 > > arch/arm/configs/bcm_defconfig | 7 + > > drivers/i2c/busses/i2c-bcm-kona.c | 14 +- > > drivers/mfd/Kconfig| 8 + > > drivers/mfd/Makefile | 1 + > > drivers/mfd/bcm59056.c | 119 ++ > > drivers/regulator/Kconfig | 8 + > > drivers/regulator/Makefile | 1 + > > drivers/regulator/bcm59056-regulator.c | 445 > > + > > include/linux/mfd/bcm59056.h | 35 ++ > > 12 files changed, 873 insertions(+), 1 deletion(-) > > create mode 100644 Documentation/devicetree/bindings/regulator/bcm59056.txt > > create mode 100644 arch/arm/boot/dts/bcm59056.dtsi > > create mode 100644 drivers/mfd/bcm59056.c > > create mode 100644 drivers/regulator/bcm59056-regulator.c > > create mode 100644 include/linux/mfd/bcm59056.h > > FYI: Mark's email address is not correct. Not sure where you pulled > this one up from, but he doesn't have access to it anymore. Thanks, I already updated (it was a stale .mutt/aliases entry here) it after the bounces. -Matt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/6] mfd: add bcm59056 pmu driver
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 > > Reviewed-by: Tim Kryger > > Reviewed-by: Markus Mayer > > --- > > drivers/mfd/Kconfig | 8 +++ > > drivers/mfd/Makefile | 1 + > > drivers/mfd/bcm59056.c | 119 > > +++ > > include/linux/mfd/bcm59056.h | 35 + > > 4 files changed, 163 insertions(+) > > create mode 100644 drivers/mfd/bcm59056.c > > create mode 100644 include/linux/mfd/bcm59056.h > > > > > +static struct mfd_cell bcm59056s[] = { > > + { > > + .name = "bcm59056-pmu", > > If you plan to use *->of_node in the PMU driver, which it looks like > you do, you should set the compatible string here. Ok. I missed that..I'll split bindings to reflect this as well. There's an error in that the regulator properties are all defined in the base compatible of brcm,bcm59056 atm and they'll need to be in brcm,bcm59056-pmu's binding. > > + }, > > +}; > > + > > +static const struct regmap_config bcm59056_regmap_config = { > > + .reg_bits = 8, > > + .val_bits = 8, > > + .max_register = BCM59056_MAX_REGISTER - 1, > > If you've just set this manually i.e. it's not part of an enum table, > can't you set it a value you don't need to do math on? It's not used > anywhere else is it? Yes, I'll update this. It's not used elsewhere. > > > + .cache_type = REGCACHE_RBTREE, > > +}; > > + > > +static int bcm59056_i2c_probe(struct i2c_client *i2c, > > + const struct i2c_device_id *id) > > +{ > > + struct bcm59056 *bcm59056; > > + int chip_id = id->driver_data; > > I thought this was a DT only driver? If so, you probably want to use > of_match_device() instead. Correct, I'll use of_match_device() > > + int ret = 0; > > + > > + bcm59056 = devm_kzalloc(>dev, sizeof(*bcm59056), GFP_KERNEL); > > + if (!bcm59056) > > + return -ENOMEM; > > + > > + i2c_set_clientdata(i2c, bcm59056); > > + bcm59056->dev = >dev; > > + bcm59056->i2c_client = i2c; > > + bcm59056->id = chip_id; > > + > > + bcm59056->regmap = devm_regmap_init_i2c(i2c, _regmap_config); > > + if (IS_ERR(bcm59056->regmap)) { > > + ret = PTR_ERR(bcm59056->regmap); > > + dev_err(>dev, "regmap initialization failed: %d\n", ret); > > + return ret; > > + } > > + > > + ret = mfd_add_devices(bcm59056->dev, -1, > > + bcm59056s, ARRAY_SIZE(bcm59056s), > > + NULL, 0, NULL); > > Are you sure you need all of your #includes? > > I notice that irqdomain is there, but you don't actually have one? Right, I'll do a sweep on them. In that particular case, I don't yet have a need to implement interrupt support so it needs to go. > > > + if (ret < 0) > > + dev_err(>dev, "mfd_add_devices failed: %d\n", ret); > > What if we change the name of the function? Probably better to say > something like "device registration failed" or thelike. Will do. > > > + return ret; > > +} > > + > > +static int bcm59056_i2c_remove(struct i2c_client *i2c) > > +{ > > + struct bcm59056 *bcm59056 = i2c_get_clientdata(i2c); > > + > > + mfd_remove_devices(bcm59056->dev); > > + > > + return 0; > > +} > > + > > +static const struct of_device_id bcm59056_of_match[] = { > > + { .compatible = "brcm,bcm59056", .data = (void *)BCM59056 }, > > You've gone to the trouble of setting a device version here, but you > don't seem to use it? I'll drop the device version > > + { } > > +}; > > + > > +static const struct i2c_device_id bcm59056_i2c_id[] = { > > + { "bcm59056", BCM59056 }, > > + { } > > +}; > > Ah, I guess this is where id->driver comes from. > > It's pretty silly that the I2C subsystem demands the presence of this > table, despite not using it if an of_device_id table is present. It does make it very difficult to follow DT enabled I2C client drivers :( I'll drop the BCM59056 too. > > +MODULE_DEVICE_TABLE(i2c, bcm59056_i2c_id); > > + > > +static struct i2c_driver bcm59056_i2c_driver = { > >
[PATCH 1/6] i2c: bcm-kona: register with subsys_initcall
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 --- drivers/i2c/busses/i2c-bcm-kona.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-bcm-kona.c b/drivers/i2c/busses/i2c-bcm-kona.c index 18a74a6..bfd4056 100644 --- a/drivers/i2c/busses/i2c-bcm-kona.c +++ b/drivers/i2c/busses/i2c-bcm-kona.c @@ -901,7 +901,19 @@ static struct platform_driver bcm_kona_i2c_driver = { .probe = bcm_kona_i2c_probe, .remove = bcm_kona_i2c_remove, }; -module_platform_driver(bcm_kona_i2c_driver); + +static int __init bcm_kona_i2c_init_driver(void) +{ + return platform_driver_register(_kona_i2c_driver); +} +/* PMU access is needed early so use subsys init */ +subsys_initcall(bcm_kona_i2c_init_driver); + +static void __exit bcm_kona_i2c_exit_driver(void) +{ + platform_driver_unregister(_kona_i2c_driver); +} +module_exit(bcm_kona_i2c_exit_driver); MODULE_AUTHOR("Tim Kryger "); MODULE_DESCRIPTION("Broadcom Kona I2C Driver"); -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/6] regulator: add bcm59056 pmu DT binding
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(+) create mode 100644 Documentation/devicetree/bindings/regulator/bcm59056.txt diff --git a/Documentation/devicetree/bindings/regulator/bcm59056.txt b/Documentation/devicetree/bindings/regulator/bcm59056.txt new file mode 100644 index 000..bf6b633 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/bcm59056.txt @@ -0,0 +1,37 @@ +BCM59056 Power Management Unit + +Required properties: +- compatible: "brcm,bcm59056" +- reg: I2C slave address +- interrupts: interrupt for the PMU. Generic interrupt client node bindings + are described in interrupt-controller/interrupts.txt +- regulators: This is the list of child nodes that specify the regulator + initialization data for defined regulators. Generic regulator bindings + are described in regulator/regulator.txt. + + The valid regulator-compatible values are: + rfldo, camldo1, camldo2, simldo1, simlso2, sdldo, sdxldo, + mmcldo1, mmcldo2, audldo, micldo, usbldo, vibldo, + csr, iosr1, iosr2, msr, sdsr1, sdsr2, vsr + +Example: + pmu: bcm59056@8 { + compatible = "brcm,bcm59056"; + reg = <0x08>; + interrupts = ; + regulators { + #address-cells = <1>; + #size-cells = <0>; + + rfldo_reg: regulator@0 { + reg = <0>; + regulator-compatible = "rfldo"; + regulator-min-microvolt = <120>; + regulator-max-microvolt = <330>; + regulator-always-on; + regulator-boot-on; + }; + + ... + }; + }; -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 5/6] ARM: configs: bcm_defconfig: enable bcm59056 regulator support
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_defconfig b/arch/arm/configs/bcm_defconfig index 2519d6d..35752cc 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig @@ -79,6 +79,13 @@ CONFIG_HW_RANDOM=y CONFIG_I2C=y CONFIG_I2C_CHARDEV=y # CONFIG_HWMON is not set +CONFIG_MFD_BCM59056=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_VIRTUAL_CONSUMER=y +CONFIG_REGULATOR_USERSPACE_CONSUMER=y +CONFIG_REGULATOR_BCM59056=y + CONFIG_VIDEO_OUTPUT_CONTROL=y CONFIG_FB=y CONFIG_BACKLIGHT_LCD_SUPPORT=y -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 6/6] ARM: dts: add bcm59056 pmu support and enable for bcm28155-ap
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/bcm59056.dtsi | 158 ++ 2 files changed, 199 insertions(+) create mode 100644 arch/arm/boot/dts/bcm59056.dtsi diff --git a/arch/arm/boot/dts/bcm28155-ap.dts b/arch/arm/boot/dts/bcm28155-ap.dts index 5ff2382..1240f42 100644 --- a/arch/arm/boot/dts/bcm28155-ap.dts +++ b/arch/arm/boot/dts/bcm28155-ap.dts @@ -47,6 +47,10 @@ i2c@3500d000 { status="okay"; clock-frequency = <40>; + + pmu: pmu@8 { + reg = <0x08>; + }; }; sdio1: sdio@3f18 { @@ -57,16 +61,22 @@ sdio2: sdio@3f19 { non-removable; max-frequency = <4800>; + vmmc-supply = <_reg>; + vqmmc-supply = <_reg>; status = "okay"; }; sdio4: sdio@3f1b { max-frequency = <4800>; cd-gpios = < 14 GPIO_ACTIVE_LOW>; + vmmc-supply = <_reg>; + vqmmc-supply = <_reg>; status = "okay"; }; usbotg: usb@3f12 { + vusb_d-supply = <_reg>; + vusb_a-supply = <_reg>; status = "okay"; }; @@ -74,3 +84,34 @@ status = "okay"; }; }; + +#include "bcm59056.dtsi" + + { + interrupts = ; + status = "okay"; + + regulators { + camldo1_reg: regulator@1 { + regulator-min-microvolt = <330>; + regulator-max-microvolt = <330>; + }; + + sdldo_reg: regulator@5 { + regulator-min-microvolt = <300>; + regulator-max-microvolt = <300>; + }; + + usbldo_reg: regulator@11 { + regulator-min-microvolt = <330>; + regulator-max-microvolt = <330>; + regulator-always-on; + }; + + iosr1_reg: regulator@14 { + regulator-min-microvolt = <180>; + regulator-max-microvolt = <180>; + regulator-always-on; + }; + }; +}; diff --git a/arch/arm/boot/dts/bcm59056.dtsi b/arch/arm/boot/dts/bcm59056.dtsi new file mode 100644 index 000..08ea3da --- /dev/null +++ b/arch/arm/boot/dts/bcm59056.dtsi @@ -0,0 +1,158 @@ +/* + * Copyright 2014 Linaro Limited + * Author: Matt Porter + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + + { + compatible = "brcm,bcm59056"; + + regulators { + #address-cells = <1>; + #size-cells = <0>; + + rfldo_reg: regulator@0 { + reg = <0>; + regulator-compatible = "rfldo"; + regulator-min-microvolt = <120>; + regulator-max-microvolt = <330>; + }; + + camldo1_reg: regulator@1 { + reg = <1>; + regulator-compatible = "camldo1"; + regulator-min-microvolt = <180>; + regulator-max-microvolt = <330>; + }; + + camldo2_reg: regulator@2 { + reg = <2>; + regulator-compatible = "camldo2"; + regulator-min-microvolt = <180>; + regulator-max-microvolt = <330>; + }; + + simldo1_reg: regulator@3 { + reg = <3>; + regulator-compatible = "simldo1"; + regulator-min-microvolt = <120>; + regulator-max-microvolt = <330>; + }; + + simldo2_reg: regulator@4 { + reg = <4>; + regulator-compatible = "simldo2"; + regulator-min-microvolt = <120>; + regulator-max-microvolt = <330>; + }; + +
[PATCH 3/6] mfd: add bcm59056 pmu driver
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 | 8 +++ drivers/mfd/Makefile | 1 + drivers/mfd/bcm59056.c | 119 +++ include/linux/mfd/bcm59056.h | 35 + 4 files changed, 163 insertions(+) create mode 100644 drivers/mfd/bcm59056.c create mode 100644 include/linux/mfd/bcm59056.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 49bb445..36e96c2 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -59,6 +59,14 @@ config MFD_AAT2870_CORE additional drivers must be enabled in order to use the functionality of the device. +config MFD_BCM59056 + bool "Broadcom BCM59056 PMU" + select MFD_CORE + select REGMAP_I2C + depends on I2C=y + help + Support for the BCM59056 PMU from Broadcom + config MFD_CROS_EC tristate "ChromeOS Embedded Controller" select MFD_CORE diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 5aea5ef..8d7e110 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -8,6 +8,7 @@ obj-$(CONFIG_MFD_88PM800) += 88pm800.o 88pm80x.o obj-$(CONFIG_MFD_88PM805) += 88pm805.o 88pm80x.o obj-$(CONFIG_MFD_SM501)+= sm501.o obj-$(CONFIG_MFD_ASIC3)+= asic3.o tmio_core.o +obj-$(CONFIG_MFD_BCM59056) += bcm59056.o obj-$(CONFIG_MFD_CROS_EC) += cros_ec.o obj-$(CONFIG_MFD_CROS_EC_I2C) += cros_ec_i2c.o obj-$(CONFIG_MFD_CROS_EC_SPI) += cros_ec_spi.o diff --git a/drivers/mfd/bcm59056.c b/drivers/mfd/bcm59056.c new file mode 100644 index 000..f193bfb --- /dev/null +++ b/drivers/mfd/bcm59056.c @@ -0,0 +1,119 @@ +/* + * Broadcom BCM59056 PMU + * + * Copyright 2014 Linaro Limited + * Author: Matt Porter + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct mfd_cell bcm59056s[] = { + { + .name = "bcm59056-pmu", + }, +}; + +static const struct regmap_config bcm59056_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .max_register = BCM59056_MAX_REGISTER - 1, + .cache_type = REGCACHE_RBTREE, +}; + +static int bcm59056_i2c_probe(struct i2c_client *i2c, + const struct i2c_device_id *id) +{ + struct bcm59056 *bcm59056; + int chip_id = id->driver_data; + int ret = 0; + + bcm59056 = devm_kzalloc(>dev, sizeof(*bcm59056), GFP_KERNEL); + if (!bcm59056) + return -ENOMEM; + + i2c_set_clientdata(i2c, bcm59056); + bcm59056->dev = >dev; + bcm59056->i2c_client = i2c; + bcm59056->id = chip_id; + + bcm59056->regmap = devm_regmap_init_i2c(i2c, _regmap_config); + if (IS_ERR(bcm59056->regmap)) { + ret = PTR_ERR(bcm59056->regmap); + dev_err(>dev, "regmap initialization failed: %d\n", ret); + return ret; + } + + ret = mfd_add_devices(bcm59056->dev, -1, + bcm59056s, ARRAY_SIZE(bcm59056s), + NULL, 0, NULL); + if (ret < 0) + dev_err(>dev, "mfd_add_devices failed: %d\n", ret); + + return ret; +} + +static int bcm59056_i2c_remove(struct i2c_client *i2c) +{ + struct bcm59056 *bcm59056 = i2c_get_clientdata(i2c); + + mfd_remove_devices(bcm59056->dev); + + return 0; +} + +static const struct of_device_id bcm59056_of_match[] = { + { .compatible = "brcm,bcm59056", .data = (void *)BCM59056 }, + { } +}; + +static const struct i2c_device_id bcm59056_i2c_id[] = { + { "bcm59056", BCM59056 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, bcm59056_i2c_id); + +static struct i2c_driver bcm59056_i2c_driver = { + .driver = { + .name = "bcm59056", + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(bcm59056_of_match), + }, + .probe = bcm59056_i2c_probe, + .remove = bcm59056_i2c_remove, + .id_table = bcm59056_i2c_id, +}; + +static int __init bcm59056_init(void) +{ + return i2c_add_driver(_i2c_driver); +} +subsys_initcall(bcm59056_init); + +static void __exit bcm59056_exit(void) +{ + i2c_del_driver(_i2c_driver); +} +module_exit(bcm590
[PATCH 0/6] BCM59056 PMU regulator support
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: bcm-kona: register with subsys_initcall regulator: add bcm59056 pmu DT binding mfd: add bcm59056 pmu driver regulator: add bcm59056 regulator driver ARM: configs: bcm_defconfig: enable bcm59056 regulator support ARM: dts: add bcm59056 pmu support and enable for bcm28155-ap .../devicetree/bindings/regulator/bcm59056.txt | 37 ++ arch/arm/boot/dts/bcm28155-ap.dts | 41 ++ arch/arm/boot/dts/bcm59056.dtsi| 158 arch/arm/configs/bcm_defconfig | 7 + drivers/i2c/busses/i2c-bcm-kona.c | 14 +- drivers/mfd/Kconfig| 8 + drivers/mfd/Makefile | 1 + drivers/mfd/bcm59056.c | 119 ++ drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/bcm59056-regulator.c | 445 + include/linux/mfd/bcm59056.h | 35 ++ 12 files changed, 873 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/regulator/bcm59056.txt create mode 100644 arch/arm/boot/dts/bcm59056.dtsi create mode 100644 drivers/mfd/bcm59056.c create mode 100644 drivers/regulator/bcm59056-regulator.c create mode 100644 include/linux/mfd/bcm59056.h -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/6] regulator: add bcm59056 regulator driver
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 | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/bcm59056-regulator.c | 445 + 3 files changed, 454 insertions(+) create mode 100644 drivers/regulator/bcm59056-regulator.c diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 6a79328..e09c9ea5 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -139,6 +139,14 @@ config REGULATOR_AS3722 AS3722 PMIC. This will enable support for all the software controllable DCDC/LDO regulators. +config REGULATOR_BCM59056 + tristate "Broadcom BCM59056 PMU Regulators" + depends on MFD_BCM59056 + help + This driver provides support for the voltage regulators on the + BCM59056 PMU. This will enable support for the software + controllable LDO/Switching regulators. + config REGULATOR_DA903X tristate "Dialog Semiconductor DA9030/DA9034 regulators" depends on PMIC_DA903X diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index 979f9dd..bb65035 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o obj-$(CONFIG_REGULATOR_ARIZONA) += arizona-micsupp.o arizona-ldo1.o obj-$(CONFIG_REGULATOR_AS3711) += as3711-regulator.o obj-$(CONFIG_REGULATOR_AS3722) += as3722-regulator.o +obj-$(CONFIG_REGULATOR_BCM59056) += bcm59056-regulator.o obj-$(CONFIG_REGULATOR_DA903X) += da903x.o obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o obj-$(CONFIG_REGULATOR_DA9055) += da9055-regulator.o diff --git a/drivers/regulator/bcm59056-regulator.c b/drivers/regulator/bcm59056-regulator.c new file mode 100644 index 000..3fbc1d5 --- /dev/null +++ b/drivers/regulator/bcm59056-regulator.c @@ -0,0 +1,445 @@ +/* + * Broadcom BCM59056 regulator driver + * + * Copyright 2014 Linaro Limited + * Author: Matt Porter + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Register defs */ +#define BCM59056_RFLDOPMCTRL1 0x60 +#define BCM59056_IOSR1PMCTRL1 0x7a +#define BCM59056_IOSR2PMCTRL1 0x7c +#define BCM59056_CSRPMCTRL10x7e +#define BCM59056_SDSR1PMCTRL1 0x82 +#define BCM59056_SDSR2PMCTRL1 0x86 +#define BCM59056_MSRPMCTRL10x8a +#define BCM59056_VSRPMCTRL10x8e +#define BCM59056_REG_ENABLEBIT(7) + +#define BCM59056_RFLDOCTRL 0x96 +#define BCM59056_CSRVOUT1 0xc0 +#define BCM59056_LDO_VSEL_MASK GENMASK(5, 3) +#define BCM59056_SR_VSEL_MASK GENMASK(5, 0) + +/* LDO regulator IDs */ +#define BCM59056_REG_RFLDO 0 +#define BCM59056_REG_CAMLDO1 1 +#define BCM59056_REG_CAMLDO2 2 +#define BCM59056_REG_SIMLDO1 3 +#define BCM59056_REG_SIMLDO2 4 +#define BCM59056_REG_SDLDO 5 +#define BCM59056_REG_SDXLDO6 +#define BCM59056_REG_MMCLDO1 7 +#define BCM59056_REG_MMCLDO2 8 +#define BCM59056_REG_AUDLDO9 +#define BCM59056_REG_MICLDO10 +#define BCM59056_REG_USBLDO11 +#define BCM59056_REG_VIBLDO12 + +/* DCDC regulator IDs */ +#define BCM59056_REG_CSR 13 +#define BCM59056_REG_IOSR1 14 +#define BCM59056_REG_IOSR2 15 +#define BCM59056_REG_MSR 16 +#define BCM59056_REG_SDSR1 17 +#define BCM59056_REG_SDSR2 18 +#define BCM59056_REG_VSR 19 + +#define BCM59056_NUM_REGS 20 + +#define BCM59056_REG_IS_LDO(n) (n < BCM59056_REG_CSR) + +struct bcm59056_board { + struct regulator_init_data *bcm59056_pmu_init_data[BCM59056_NUM_REGS]; +}; + +/* LDO group A: supported voltages in microvolts */ +static const unsigned int ldo_a_table[] = { + 120, 180, 250, 270, 280, + 290, 300, 330, +}; + +/* LDO group C: supported voltages in microvolts */ +static const unsigned int ldo_c_table[] = { + 310, 180, 250, 270, 280, + 290, 300, 330, +}; + +/* DCDC group CSR: supported voltages in microvolts */ +static const struct regulator_linear_range dcdc_csr_ranges[] = { + REGULATOR_LINEAR_RANGE(86, 2, 50, 1), + REGULATOR_LINEAR_RANGE(136, 51, 55, 2), + REGULATOR_LINEAR_RANGE(90, 56, 63, 0), +}; + +/* DCDC group IOSR1: supported voltages in microvolts */ +static const struct regulator_linear_range dcdc_iosr1_ranges[] = { + REGULATOR_LINEAR_RANGE(86, 2, 51, 1), + REGULAT
[PATCH 0/6] BCM59056 PMU regulator support
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: bcm-kona: register with subsys_initcall regulator: add bcm59056 pmu DT binding mfd: add bcm59056 pmu driver regulator: add bcm59056 regulator driver ARM: configs: bcm_defconfig: enable bcm59056 regulator support ARM: dts: add bcm59056 pmu support and enable for bcm28155-ap .../devicetree/bindings/regulator/bcm59056.txt | 37 ++ arch/arm/boot/dts/bcm28155-ap.dts | 41 ++ arch/arm/boot/dts/bcm59056.dtsi| 158 arch/arm/configs/bcm_defconfig | 7 + drivers/i2c/busses/i2c-bcm-kona.c | 14 +- drivers/mfd/Kconfig| 8 + drivers/mfd/Makefile | 1 + drivers/mfd/bcm59056.c | 119 ++ drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/bcm59056-regulator.c | 445 + include/linux/mfd/bcm59056.h | 35 ++ 12 files changed, 873 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/regulator/bcm59056.txt create mode 100644 arch/arm/boot/dts/bcm59056.dtsi create mode 100644 drivers/mfd/bcm59056.c create mode 100644 drivers/regulator/bcm59056-regulator.c create mode 100644 include/linux/mfd/bcm59056.h -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/6] regulator: add bcm59056 regulator driver
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 mpor...@linaro.org Reviewed-by: Tim Kryger tim.kry...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/bcm59056-regulator.c | 445 + 3 files changed, 454 insertions(+) create mode 100644 drivers/regulator/bcm59056-regulator.c diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index 6a79328..e09c9ea5 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -139,6 +139,14 @@ config REGULATOR_AS3722 AS3722 PMIC. This will enable support for all the software controllable DCDC/LDO regulators. +config REGULATOR_BCM59056 + tristate Broadcom BCM59056 PMU Regulators + depends on MFD_BCM59056 + help + This driver provides support for the voltage regulators on the + BCM59056 PMU. This will enable support for the software + controllable LDO/Switching regulators. + config REGULATOR_DA903X tristate Dialog Semiconductor DA9030/DA9034 regulators depends on PMIC_DA903X diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index 979f9dd..bb65035 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -20,6 +20,7 @@ obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o obj-$(CONFIG_REGULATOR_ARIZONA) += arizona-micsupp.o arizona-ldo1.o obj-$(CONFIG_REGULATOR_AS3711) += as3711-regulator.o obj-$(CONFIG_REGULATOR_AS3722) += as3722-regulator.o +obj-$(CONFIG_REGULATOR_BCM59056) += bcm59056-regulator.o obj-$(CONFIG_REGULATOR_DA903X) += da903x.o obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o obj-$(CONFIG_REGULATOR_DA9055) += da9055-regulator.o diff --git a/drivers/regulator/bcm59056-regulator.c b/drivers/regulator/bcm59056-regulator.c new file mode 100644 index 000..3fbc1d5 --- /dev/null +++ b/drivers/regulator/bcm59056-regulator.c @@ -0,0 +1,445 @@ +/* + * Broadcom BCM59056 regulator driver + * + * Copyright 2014 Linaro Limited + * Author: Matt Porter mpor...@linaro.org + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include linux/err.h +#include linux/init.h +#include linux/kernel.h +#include linux/mfd/bcm59056.h +#include linux/module.h +#include linux/of.h +#include linux/platform_device.h +#include linux/regulator/driver.h +#include linux/regulator/machine.h +#include linux/regulator/of_regulator.h +#include linux/slab.h + +/* Register defs */ +#define BCM59056_RFLDOPMCTRL1 0x60 +#define BCM59056_IOSR1PMCTRL1 0x7a +#define BCM59056_IOSR2PMCTRL1 0x7c +#define BCM59056_CSRPMCTRL10x7e +#define BCM59056_SDSR1PMCTRL1 0x82 +#define BCM59056_SDSR2PMCTRL1 0x86 +#define BCM59056_MSRPMCTRL10x8a +#define BCM59056_VSRPMCTRL10x8e +#define BCM59056_REG_ENABLEBIT(7) + +#define BCM59056_RFLDOCTRL 0x96 +#define BCM59056_CSRVOUT1 0xc0 +#define BCM59056_LDO_VSEL_MASK GENMASK(5, 3) +#define BCM59056_SR_VSEL_MASK GENMASK(5, 0) + +/* LDO regulator IDs */ +#define BCM59056_REG_RFLDO 0 +#define BCM59056_REG_CAMLDO1 1 +#define BCM59056_REG_CAMLDO2 2 +#define BCM59056_REG_SIMLDO1 3 +#define BCM59056_REG_SIMLDO2 4 +#define BCM59056_REG_SDLDO 5 +#define BCM59056_REG_SDXLDO6 +#define BCM59056_REG_MMCLDO1 7 +#define BCM59056_REG_MMCLDO2 8 +#define BCM59056_REG_AUDLDO9 +#define BCM59056_REG_MICLDO10 +#define BCM59056_REG_USBLDO11 +#define BCM59056_REG_VIBLDO12 + +/* DCDC regulator IDs */ +#define BCM59056_REG_CSR 13 +#define BCM59056_REG_IOSR1 14 +#define BCM59056_REG_IOSR2 15 +#define BCM59056_REG_MSR 16 +#define BCM59056_REG_SDSR1 17 +#define BCM59056_REG_SDSR2 18 +#define BCM59056_REG_VSR 19 + +#define BCM59056_NUM_REGS 20 + +#define BCM59056_REG_IS_LDO(n) (n BCM59056_REG_CSR) + +struct bcm59056_board { + struct regulator_init_data *bcm59056_pmu_init_data[BCM59056_NUM_REGS]; +}; + +/* LDO group A: supported voltages in microvolts */ +static const unsigned int ldo_a_table[] = { + 120, 180, 250, 270, 280, + 290, 300, 330, +}; + +/* LDO group C: supported voltages in microvolts */ +static const unsigned int ldo_c_table[] = { + 310, 180, 250, 270, 280, + 290, 300, 330, +}; + +/* DCDC group CSR: supported voltages in microvolts */ +static const struct regulator_linear_range dcdc_csr_ranges[] = { + REGULATOR_LINEAR_RANGE(86, 2, 50, 1), + REGULATOR_LINEAR_RANGE(136, 51, 55, 2
[PATCH 3/6] mfd: add bcm59056 pmu driver
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 mpor...@linaro.org Reviewed-by: Tim Kryger tim.kry...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- drivers/mfd/Kconfig | 8 +++ drivers/mfd/Makefile | 1 + drivers/mfd/bcm59056.c | 119 +++ include/linux/mfd/bcm59056.h | 35 + 4 files changed, 163 insertions(+) create mode 100644 drivers/mfd/bcm59056.c create mode 100644 include/linux/mfd/bcm59056.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 49bb445..36e96c2 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -59,6 +59,14 @@ config MFD_AAT2870_CORE additional drivers must be enabled in order to use the functionality of the device. +config MFD_BCM59056 + bool Broadcom BCM59056 PMU + select MFD_CORE + select REGMAP_I2C + depends on I2C=y + help + Support for the BCM59056 PMU from Broadcom + config MFD_CROS_EC tristate ChromeOS Embedded Controller select MFD_CORE diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 5aea5ef..8d7e110 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -8,6 +8,7 @@ obj-$(CONFIG_MFD_88PM800) += 88pm800.o 88pm80x.o obj-$(CONFIG_MFD_88PM805) += 88pm805.o 88pm80x.o obj-$(CONFIG_MFD_SM501)+= sm501.o obj-$(CONFIG_MFD_ASIC3)+= asic3.o tmio_core.o +obj-$(CONFIG_MFD_BCM59056) += bcm59056.o obj-$(CONFIG_MFD_CROS_EC) += cros_ec.o obj-$(CONFIG_MFD_CROS_EC_I2C) += cros_ec_i2c.o obj-$(CONFIG_MFD_CROS_EC_SPI) += cros_ec_spi.o diff --git a/drivers/mfd/bcm59056.c b/drivers/mfd/bcm59056.c new file mode 100644 index 000..f193bfb --- /dev/null +++ b/drivers/mfd/bcm59056.c @@ -0,0 +1,119 @@ +/* + * Broadcom BCM59056 PMU + * + * Copyright 2014 Linaro Limited + * Author: Matt Porter mpor...@linaro.org + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include linux/err.h +#include linux/i2c.h +#include linux/init.h +#include linux/interrupt.h +#include linux/irq.h +#include linux/irqdomain.h +#include linux/mfd/bcm59056.h +#include linux/mfd/core.h +#include linux/module.h +#include linux/moduleparam.h +#include linux/of.h +#include linux/of_device.h +#include linux/regmap.h +#include linux/slab.h + +static struct mfd_cell bcm59056s[] = { + { + .name = bcm59056-pmu, + }, +}; + +static const struct regmap_config bcm59056_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .max_register = BCM59056_MAX_REGISTER - 1, + .cache_type = REGCACHE_RBTREE, +}; + +static int bcm59056_i2c_probe(struct i2c_client *i2c, + const struct i2c_device_id *id) +{ + struct bcm59056 *bcm59056; + int chip_id = id-driver_data; + int ret = 0; + + bcm59056 = devm_kzalloc(i2c-dev, sizeof(*bcm59056), GFP_KERNEL); + if (!bcm59056) + return -ENOMEM; + + i2c_set_clientdata(i2c, bcm59056); + bcm59056-dev = i2c-dev; + bcm59056-i2c_client = i2c; + bcm59056-id = chip_id; + + bcm59056-regmap = devm_regmap_init_i2c(i2c, bcm59056_regmap_config); + if (IS_ERR(bcm59056-regmap)) { + ret = PTR_ERR(bcm59056-regmap); + dev_err(i2c-dev, regmap initialization failed: %d\n, ret); + return ret; + } + + ret = mfd_add_devices(bcm59056-dev, -1, + bcm59056s, ARRAY_SIZE(bcm59056s), + NULL, 0, NULL); + if (ret 0) + dev_err(i2c-dev, mfd_add_devices failed: %d\n, ret); + + return ret; +} + +static int bcm59056_i2c_remove(struct i2c_client *i2c) +{ + struct bcm59056 *bcm59056 = i2c_get_clientdata(i2c); + + mfd_remove_devices(bcm59056-dev); + + return 0; +} + +static const struct of_device_id bcm59056_of_match[] = { + { .compatible = brcm,bcm59056, .data = (void *)BCM59056 }, + { } +}; + +static const struct i2c_device_id bcm59056_i2c_id[] = { + { bcm59056, BCM59056 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, bcm59056_i2c_id); + +static struct i2c_driver bcm59056_i2c_driver = { + .driver = { + .name = bcm59056, + .owner = THIS_MODULE, + .of_match_table = of_match_ptr(bcm59056_of_match), + }, + .probe = bcm59056_i2c_probe, + .remove = bcm59056_i2c_remove, + .id_table = bcm59056_i2c_id, +}; + +static int __init bcm59056_init(void) +{ + return i2c_add_driver
[PATCH 6/6] ARM: dts: add bcm59056 pmu support and enable for bcm28155-ap
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 tim.kry...@linaro.org Signed-off-by: Matt Porter mpor...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- arch/arm/boot/dts/bcm28155-ap.dts | 41 ++ arch/arm/boot/dts/bcm59056.dtsi | 158 ++ 2 files changed, 199 insertions(+) create mode 100644 arch/arm/boot/dts/bcm59056.dtsi diff --git a/arch/arm/boot/dts/bcm28155-ap.dts b/arch/arm/boot/dts/bcm28155-ap.dts index 5ff2382..1240f42 100644 --- a/arch/arm/boot/dts/bcm28155-ap.dts +++ b/arch/arm/boot/dts/bcm28155-ap.dts @@ -47,6 +47,10 @@ i2c@3500d000 { status=okay; clock-frequency = 40; + + pmu: pmu@8 { + reg = 0x08; + }; }; sdio1: sdio@3f18 { @@ -57,16 +61,22 @@ sdio2: sdio@3f19 { non-removable; max-frequency = 4800; + vmmc-supply = camldo1_reg; + vqmmc-supply = iosr1_reg; status = okay; }; sdio4: sdio@3f1b { max-frequency = 4800; cd-gpios = gpio 14 GPIO_ACTIVE_LOW; + vmmc-supply = sdldo_reg; + vqmmc-supply = sdxldo_reg; status = okay; }; usbotg: usb@3f12 { + vusb_d-supply = usbldo_reg; + vusb_a-supply = iosr1_reg; status = okay; }; @@ -74,3 +84,34 @@ status = okay; }; }; + +#include bcm59056.dtsi + +pmu { + interrupts = GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH; + status = okay; + + regulators { + camldo1_reg: regulator@1 { + regulator-min-microvolt = 330; + regulator-max-microvolt = 330; + }; + + sdldo_reg: regulator@5 { + regulator-min-microvolt = 300; + regulator-max-microvolt = 300; + }; + + usbldo_reg: regulator@11 { + regulator-min-microvolt = 330; + regulator-max-microvolt = 330; + regulator-always-on; + }; + + iosr1_reg: regulator@14 { + regulator-min-microvolt = 180; + regulator-max-microvolt = 180; + regulator-always-on; + }; + }; +}; diff --git a/arch/arm/boot/dts/bcm59056.dtsi b/arch/arm/boot/dts/bcm59056.dtsi new file mode 100644 index 000..08ea3da --- /dev/null +++ b/arch/arm/boot/dts/bcm59056.dtsi @@ -0,0 +1,158 @@ +/* + * Copyright 2014 Linaro Limited + * Author: Matt Porter mpor...@linaro.org + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +pmu { + compatible = brcm,bcm59056; + + regulators { + #address-cells = 1; + #size-cells = 0; + + rfldo_reg: regulator@0 { + reg = 0; + regulator-compatible = rfldo; + regulator-min-microvolt = 120; + regulator-max-microvolt = 330; + }; + + camldo1_reg: regulator@1 { + reg = 1; + regulator-compatible = camldo1; + regulator-min-microvolt = 180; + regulator-max-microvolt = 330; + }; + + camldo2_reg: regulator@2 { + reg = 2; + regulator-compatible = camldo2; + regulator-min-microvolt = 180; + regulator-max-microvolt = 330; + }; + + simldo1_reg: regulator@3 { + reg = 3; + regulator-compatible = simldo1; + regulator-min-microvolt = 120; + regulator-max-microvolt = 330; + }; + + simldo2_reg: regulator@4 { + reg = 4; + regulator-compatible = simldo2; + regulator-min-microvolt = 120; + regulator-max-microvolt = 330; + }; + + sdldo_reg: regulator@5 { + reg = 5; + regulator-compatible = sdldo; + regulator-min-microvolt = 180; + regulator-max-microvolt = 330; + }; + + sdxldo_reg: regulator@6
[PATCH 5/6] ARM: configs: bcm_defconfig: enable bcm59056 regulator support
Enable BCM59056 MFD and regulator drivers to manage voltage regulators on BCM281xx platforms. Signed-off-by: Tim Kryger tim.kry...@linaro.org Signed-off-by: Matt Porter mpor...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- arch/arm/configs/bcm_defconfig | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig index 2519d6d..35752cc 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig @@ -79,6 +79,13 @@ CONFIG_HW_RANDOM=y CONFIG_I2C=y CONFIG_I2C_CHARDEV=y # CONFIG_HWMON is not set +CONFIG_MFD_BCM59056=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_VIRTUAL_CONSUMER=y +CONFIG_REGULATOR_USERSPACE_CONSUMER=y +CONFIG_REGULATOR_BCM59056=y + CONFIG_VIDEO_OUTPUT_CONTROL=y CONFIG_FB=y CONFIG_BACKLIGHT_LCD_SUPPORT=y -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/6] regulator: add bcm59056 pmu DT binding
Add a DT binding for the BCM59056 PMU. The binding inherits from the generic regulator bindings. Signed-off-by: Matt Porter mpor...@linaro.org Reviewed-by: Tim Kryger tim.kry...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- .../devicetree/bindings/regulator/bcm59056.txt | 37 ++ 1 file changed, 37 insertions(+) create mode 100644 Documentation/devicetree/bindings/regulator/bcm59056.txt diff --git a/Documentation/devicetree/bindings/regulator/bcm59056.txt b/Documentation/devicetree/bindings/regulator/bcm59056.txt new file mode 100644 index 000..bf6b633 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/bcm59056.txt @@ -0,0 +1,37 @@ +BCM59056 Power Management Unit + +Required properties: +- compatible: brcm,bcm59056 +- reg: I2C slave address +- interrupts: interrupt for the PMU. Generic interrupt client node bindings + are described in interrupt-controller/interrupts.txt +- regulators: This is the list of child nodes that specify the regulator + initialization data for defined regulators. Generic regulator bindings + are described in regulator/regulator.txt. + + The valid regulator-compatible values are: + rfldo, camldo1, camldo2, simldo1, simlso2, sdldo, sdxldo, + mmcldo1, mmcldo2, audldo, micldo, usbldo, vibldo, + csr, iosr1, iosr2, msr, sdsr1, sdsr2, vsr + +Example: + pmu: bcm59056@8 { + compatible = brcm,bcm59056; + reg = 0x08; + interrupts = GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH; + regulators { + #address-cells = 1; + #size-cells = 0; + + rfldo_reg: regulator@0 { + reg = 0; + regulator-compatible = rfldo; + regulator-min-microvolt = 120; + regulator-max-microvolt = 330; + regulator-always-on; + regulator-boot-on; + }; + + ... + }; + }; -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 1/6] i2c: bcm-kona: register with subsys_initcall
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 mpor...@linaro.org Reviewed-by: Tim Kryger tim.kry...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- drivers/i2c/busses/i2c-bcm-kona.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-bcm-kona.c b/drivers/i2c/busses/i2c-bcm-kona.c index 18a74a6..bfd4056 100644 --- a/drivers/i2c/busses/i2c-bcm-kona.c +++ b/drivers/i2c/busses/i2c-bcm-kona.c @@ -901,7 +901,19 @@ static struct platform_driver bcm_kona_i2c_driver = { .probe = bcm_kona_i2c_probe, .remove = bcm_kona_i2c_remove, }; -module_platform_driver(bcm_kona_i2c_driver); + +static int __init bcm_kona_i2c_init_driver(void) +{ + return platform_driver_register(bcm_kona_i2c_driver); +} +/* PMU access is needed early so use subsys init */ +subsys_initcall(bcm_kona_i2c_init_driver); + +static void __exit bcm_kona_i2c_exit_driver(void) +{ + platform_driver_unregister(bcm_kona_i2c_driver); +} +module_exit(bcm_kona_i2c_exit_driver); MODULE_AUTHOR(Tim Kryger tkry...@broadcom.com); MODULE_DESCRIPTION(Broadcom Kona I2C Driver); -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/6] mfd: add bcm59056 pmu driver
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 mpor...@linaro.org Reviewed-by: Tim Kryger tim.kry...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- drivers/mfd/Kconfig | 8 +++ drivers/mfd/Makefile | 1 + drivers/mfd/bcm59056.c | 119 +++ include/linux/mfd/bcm59056.h | 35 + 4 files changed, 163 insertions(+) create mode 100644 drivers/mfd/bcm59056.c create mode 100644 include/linux/mfd/bcm59056.h snip +static struct mfd_cell bcm59056s[] = { + { + .name = bcm59056-pmu, If you plan to use *-of_node in the PMU driver, which it looks like you do, you should set the compatible string here. Ok. I missed that..I'll split bindings to reflect this as well. There's an error in that the regulator properties are all defined in the base compatible of brcm,bcm59056 atm and they'll need to be in brcm,bcm59056-pmu's binding. + }, +}; + +static const struct regmap_config bcm59056_regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .max_register = BCM59056_MAX_REGISTER - 1, If you've just set this manually i.e. it's not part of an enum table, can't you set it a value you don't need to do math on? It's not used anywhere else is it? Yes, I'll update this. It's not used elsewhere. + .cache_type = REGCACHE_RBTREE, +}; + +static int bcm59056_i2c_probe(struct i2c_client *i2c, + const struct i2c_device_id *id) +{ + struct bcm59056 *bcm59056; + int chip_id = id-driver_data; I thought this was a DT only driver? If so, you probably want to use of_match_device() instead. Correct, I'll use of_match_device() + int ret = 0; + + bcm59056 = devm_kzalloc(i2c-dev, sizeof(*bcm59056), GFP_KERNEL); + if (!bcm59056) + return -ENOMEM; + + i2c_set_clientdata(i2c, bcm59056); + bcm59056-dev = i2c-dev; + bcm59056-i2c_client = i2c; + bcm59056-id = chip_id; + + bcm59056-regmap = devm_regmap_init_i2c(i2c, bcm59056_regmap_config); + if (IS_ERR(bcm59056-regmap)) { + ret = PTR_ERR(bcm59056-regmap); + dev_err(i2c-dev, regmap initialization failed: %d\n, ret); + return ret; + } + + ret = mfd_add_devices(bcm59056-dev, -1, + bcm59056s, ARRAY_SIZE(bcm59056s), + NULL, 0, NULL); Are you sure you need all of your #includes? I notice that irqdomain is there, but you don't actually have one? Right, I'll do a sweep on them. In that particular case, I don't yet have a need to implement interrupt support so it needs to go. + if (ret 0) + dev_err(i2c-dev, mfd_add_devices failed: %d\n, ret); What if we change the name of the function? Probably better to say something like device registration failed or thelike. Will do. + return ret; +} + +static int bcm59056_i2c_remove(struct i2c_client *i2c) +{ + struct bcm59056 *bcm59056 = i2c_get_clientdata(i2c); + + mfd_remove_devices(bcm59056-dev); + + return 0; +} + +static const struct of_device_id bcm59056_of_match[] = { + { .compatible = brcm,bcm59056, .data = (void *)BCM59056 }, You've gone to the trouble of setting a device version here, but you don't seem to use it? I'll drop the device version + { } +}; + +static const struct i2c_device_id bcm59056_i2c_id[] = { + { bcm59056, BCM59056 }, + { } +}; Ah, I guess this is where id-driver comes from. It's pretty silly that the I2C subsystem demands the presence of this table, despite not using it if an of_device_id table is present. It does make it very difficult to follow DT enabled I2C client drivers :( I'll drop the BCM59056 too. +MODULE_DEVICE_TABLE(i2c, bcm59056_i2c_id); + +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() here. Will remove. + }, + .probe = bcm59056_i2c_probe, + .remove = bcm59056_i2c_remove, + .id_table = bcm59056_i2c_id, *grumble* :) Yes, unavoidable for now. +}; + +static int __init bcm59056_init(void) +{ + return i2c_add_driver(bcm59056_i2c_driver); +} +subsys_initcall(bcm59056_init); Really? :( Maybe you'll want to comment this, in case people do not know the back ground and attempts to clean it up. I'll add a comment. This is the old problem of needing regulators really early. It's exasperated by the fact that the USB gadget framework drivers do not use driver probing. This means
Re: [PATCH 0/6] BCM59056 PMU regulator support
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 of regulators on the otg and sdhci peripherals. Matt Porter (6): i2c: bcm-kona: register with subsys_initcall regulator: add bcm59056 pmu DT binding mfd: add bcm59056 pmu driver regulator: add bcm59056 regulator driver ARM: configs: bcm_defconfig: enable bcm59056 regulator support ARM: dts: add bcm59056 pmu support and enable for bcm28155-ap .../devicetree/bindings/regulator/bcm59056.txt | 37 ++ arch/arm/boot/dts/bcm28155-ap.dts | 41 ++ arch/arm/boot/dts/bcm59056.dtsi| 158 arch/arm/configs/bcm_defconfig | 7 + drivers/i2c/busses/i2c-bcm-kona.c | 14 +- drivers/mfd/Kconfig| 8 + drivers/mfd/Makefile | 1 + drivers/mfd/bcm59056.c | 119 ++ drivers/regulator/Kconfig | 8 + drivers/regulator/Makefile | 1 + drivers/regulator/bcm59056-regulator.c | 445 + include/linux/mfd/bcm59056.h | 35 ++ 12 files changed, 873 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/regulator/bcm59056.txt create mode 100644 arch/arm/boot/dts/bcm59056.dtsi create mode 100644 drivers/mfd/bcm59056.c create mode 100644 drivers/regulator/bcm59056-regulator.c create mode 100644 include/linux/mfd/bcm59056.h FYI: Mark's email address is not correct. Not sure where you pulled this one up from, but he doesn't have access to it anymore. Thanks, I already updated (it was a stale .mutt/aliases entry here) it after the bounces. -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/6] mfd: add bcm59056 pmu driver
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. Signed-off-by: Matt Porter mpor...@linaro.org Reviewed-by: Tim Kryger tim.kry...@linaro.org Reviewed-by: Markus Mayer markus.ma...@linaro.org --- drivers/mfd/Kconfig | 8 +++ drivers/mfd/Makefile | 1 + drivers/mfd/bcm59056.c | 119 +++ include/linux/mfd/bcm59056.h | 35 + 4 files changed, 163 insertions(+) create mode 100644 drivers/mfd/bcm59056.c create mode 100644 include/linux/mfd/bcm59056.h snip I thought this was a DT only driver? If so, you probably want to use of_match_device() instead. Correct, I'll use of_match_device() If you're going to use this ... snip You've gone to the trouble of setting a device version here, but you don't seem to use it? I'll drop the device version ... 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}, { } }; +static const struct i2c_device_id bcm59056_i2c_id[] = { + { bcm59056, BCM59056 }, + { } +}; Ah, I guess this is where id-driver comes from. It's pretty silly that the I2C subsystem demands the presence of this table, despite not using it if an of_device_id table is present. It does make it very difficult to follow DT enabled I2C client drivers :( I'll drop the BCM59056 too. And I don't think you can drop this, as the I2C subsystem still insists on it. Agreed. I'm just dropping explicit population of the driver_data field here. static const struct i2c_device_id bcm59056_i2c_id[] = { { bcm59056 }, { } }; +/* chip id */ +#define BCM59056 0 Lonely, oh so lonely! Understood. Will remove. I think you need to keep this to supply the silly I2C ID table. I would just omit the '.data = (void *) VERSION' from the of_match_table until you require it. Well, it's not even necessary for I2C ID table. the I2C subsystem is happy with just a matching entry on the i2c_device_id name field and NULL driver_data. palmas is implemented in this manner. -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2/6] regulator: add bcm59056 pmu DT binding
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 functions? It's your average multi-function device with other functions as you are suspecting. Buried in the the MFD driver comments is me admitting that I need to split this into two bindings. The base device, bcm59056 and then bcm59056-reg. So point noted, I'll updated with the appropriate binding for each. +- regulators: This is the list of child nodes that specify the regulator + initialization data for defined regulators. Generic regulator bindings + are described in regulator/regulator.txt. The regulators property should always be optional, the driver should be able to start up and read back the hardware state without any further configuration. Ahh, ok. I will make it so. Thanks, Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/6] regulator: add bcm59056 regulator driver
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 regulator_dev *dev, unsigned int mode) +{ + if (mode == REGULATOR_MODE_NORMAL) + return 0; + else + return -EINVAL; +} These do nothing, don't implement them. Will remove. Maybe some day. + if (bcm59056-dev-of_node) + pmu_data = bcm59056_parse_dt_reg_data(pdev, + bcm59056_reg_matches); It'd seem a bit neater to put the OF check into the parse function but meh. On second look, I'd agree. Easy enough to clean up. + if (!pmu_data) { + dev_err(pdev-dev, Platform data not found\n); + return -EINVAL; + } Like I said when reviewing the binding this should not cause the driver to fail to load. Will fix. + /* +* Regulator API handles empty constraints but not NULL +* constraints +*/ + if (!reg_data) + continue; It should do... if not then make it so since that'd mean most drivers are buggy. Ahh, I see there is a check for NULL in the core. Will drop. -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 1/2] iio:as3935: Add DT binding docs for AS3935 driver
On Tue, Feb 04, 2014 at 07:14:55PM -0800, Matt Ranostay Matt Ranostay wrote: Document compatible string, required and optional DT properties for AS3935 chipset driver. Signed-off-by: Matt Ranostay mranos...@gmail.com --- .../devicetree/bindings/iio/proximity/as3935.txt | 25 ++ 1 file changed, 25 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/proximity/as3935.txt diff --git a/Documentation/devicetree/bindings/iio/proximity/as3935.txt b/Documentation/devicetree/bindings/iio/proximity/as3935.txt new file mode 100644 index 000..7e117cd --- /dev/null +++ b/Documentation/devicetree/bindings/iio/proximity/as3935.txt @@ -0,0 +1,25 @@ +Austrian Microsystems AS3935 Franklin lightning sensor device driver + +Required properties: + - compatible: must be ams,as3935 Change this to amstaos,as3935 amstaos (AMS bought Taos) is already a registered vendor prefix in vendor-prefixes.txt + - reg: SPI chip select number for the device + - spi-cpha: SPI Mode 1 When using generic binding properties, please reference the binding being used. Like: - spi-cpha: SPI Mode 1. Refer to spi/spi-bus.txt for generic SPI slave node bindings. + - interrupt-parent : should be the phandle for the interrupt controller + - interrupts : interrupt mapping for GPIO IRQ Refer to interrupt-controller/interrupts.txt for generic interrupt client node bindings. + +Optional properties: + - ams,tune-cap: Calibration tuning capacitor stepping value 0 - 15. + Range of 0 to 120 pF, 8pF steps. This will require using the + calibration data from the manufacturer. + + +Example: + +as3935@0 { + compatible = ams,as3935; + reg = 0; + spi-cpha; + interrupt-parent = gpio1; + interrupts = 16 1; + ams,tune-cap = /bits/ 8 10; What is this? Why not just ams,tune-cap = 10; ? It's a value between 0-15, right? -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 1/2] iio:as3935: Add DT binding docs for AS3935 driver
On Tue, Feb 04, 2014 at 08:52:26PM -0800, Matt Ranostay Matt Ranostay wrote: On Tue, Feb 4, 2014 at 8:43 PM, Matt Porter mpor...@linaro.org wrote: On Tue, Feb 04, 2014 at 07:14:55PM -0800, Matt Ranostay Matt Ranostay wrote: Document compatible string, required and optional DT properties for AS3935 chipset driver. Signed-off-by: Matt Ranostay mranos...@gmail.com --- .../devicetree/bindings/iio/proximity/as3935.txt | 25 ++ 1 file changed, 25 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/proximity/as3935.txt diff --git a/Documentation/devicetree/bindings/iio/proximity/as3935.txt b/Documentation/devicetree/bindings/iio/proximity/as3935.txt new file mode 100644 index 000..7e117cd --- /dev/null +++ b/Documentation/devicetree/bindings/iio/proximity/as3935.txt @@ -0,0 +1,25 @@ +Austrian Microsystems AS3935 Franklin lightning sensor device driver + +Required properties: + - compatible: must be ams,as3935 Change this to amstaos,as3935 amstaos (AMS bought Taos) is already a registered vendor prefix in vendor-prefixes.txt + - reg: SPI chip select number for the device + - spi-cpha: SPI Mode 1 When using generic binding properties, please reference the binding being used. Like: - spi-cpha: SPI Mode 1. Refer to spi/spi-bus.txt for generic SPI slave node bindings. Noted. + - interrupt-parent : should be the phandle for the interrupt controller + - interrupts : interrupt mapping for GPIO IRQ Refer to interrupt-controller/interrupts.txt for generic interrupt client node bindings. Noted. + +Optional properties: + - ams,tune-cap: Calibration tuning capacitor stepping value 0 - 15. + Range of 0 to 120 pF, 8pF steps. This will require using the + calibration data from the manufacturer. + + +Example: + +as3935@0 { + compatible = ams,as3935; + reg = 0; + spi-cpha; + interrupt-parent = gpio1; + interrupts = 16 1; + ams,tune-cap = /bits/ 8 10; What is this? Why not just ams,tune-cap = 10; ? It's a value between 0-15, right? Correct but it is using of_property_read_u8() so that requires the /bits/ statement. Should this just be a u32 value? Do you really need a u8? If not just read_u32() into an int and keep this syntax simple. -Matt -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: gadget: s3c-hsotg: fix build on x86 and other architectures
The readsl and writesl I/O accessors are only defined on some architectures. The driver currently depends on CONFIG_ARM because the build breaks on x86, in particular. Switch to use of ioread32_rep and iowrite32_rep to fix build on all architectures and remove the CONFIG_ARM dependency. Also update printk formatting to handle a long long dma_addr_t to avoid warnings on !32-bit architectures. Signed-off-by: Matt Porter --- drivers/usb/gadget/Kconfig | 1 - drivers/usb/gadget/s3c-hsotg.c | 12 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 8154165..782f43a 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -301,7 +301,6 @@ config USB_PXA27X gadget drivers to also be dynamically linked. config USB_S3C_HSOTG - depends on ARM tristate "Designware/S3C HS/OtG USB Device controller" help The Designware USB2.0 high-speed gadget controller diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 1172eae..0449b76 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c @@ -617,7 +617,7 @@ static int s3c_hsotg_write_fifo(struct s3c_hsotg *hsotg, to_write = DIV_ROUND_UP(to_write, 4); data = hs_req->req.buf + buf_pos; - writesl(hsotg->regs + EPFIFO(hs_ep->index), data, to_write); + iowrite32_rep(hsotg->regs + EPFIFO(hs_ep->index), data, to_write); return (to_write >= can_write) ? -ENOSPC : 0; } @@ -720,8 +720,8 @@ static void s3c_hsotg_start_req(struct s3c_hsotg *hsotg, ureq->length, ureq->actual); if (0) dev_dbg(hsotg->dev, - "REQ buf %p len %d dma 0x%08x noi=%d zp=%d snok=%d\n", - ureq->buf, length, ureq->dma, + "REQ buf %p len %d dma 0x%08llx noi=%d zp=%d snok=%d\n", + ureq->buf, length, (unsigned long long)ureq->dma, ureq->no_interrupt, ureq->zero, ureq->short_not_ok); maxreq = get_ep_limit(hs_ep); @@ -789,8 +789,8 @@ static void s3c_hsotg_start_req(struct s3c_hsotg *hsotg, dma_reg = dir_in ? DIEPDMA(index) : DOEPDMA(index); writel(ureq->dma, hsotg->regs + dma_reg); - dev_dbg(hsotg->dev, "%s: 0x%08x => 0x%08x\n", - __func__, ureq->dma, dma_reg); + dev_dbg(hsotg->dev, "%s: 0x%08llx => 0x%08x\n", + __func__, (unsigned long long)ureq->dma, dma_reg); } ctrl |= DxEPCTL_EPEna; /* ensure ep enabled */ @@ -1488,7 +1488,7 @@ static void s3c_hsotg_rx_data(struct s3c_hsotg *hsotg, int ep_idx, int size) * note, we might over-write the buffer end by 3 bytes depending on * alignment of the data. */ - readsl(fifo, hs_req->req.buf + read_ptr, to_read); + ioread32_rep(fifo, hs_req->req.buf + read_ptr, to_read); } /** -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 4/6] iio: Add ABI docs for pulse capture devices
Add standard ABI entries for pulse capture devices. Also add a separate ABI entry for the TI ECAP driver polarity option. Signed-off-by: Matt Porter --- Documentation/ABI/testing/sysfs-bus-iio | 18 ++ Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap | 9 + 2 files changed, 27 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio index 6e02c50..918a201 100644 --- a/Documentation/ABI/testing/sysfs-bus-iio +++ b/Documentation/ABI/testing/sysfs-bus-iio @@ -210,6 +210,14 @@ Contact: linux-...@vger.kernel.org Description: Scaled humidity measurement in milli percent. +What: /sys/bus/iio/devices/iio:deviceX/in_pulseY_raw +What: /sys/bus/iio/devices/iio:deviceX/in_pulse_raw +KernelVersion: 3.15 +Contact: linux-...@vger.kernel.org +Description: + Raw pulse measurement from channel Y. Units after + application of scale and offset are nanoseconds. + What: /sys/bus/iio/devices/iio:deviceX/in_accel_offset What: /sys/bus/iio/devices/iio:deviceX/in_accel_x_offset What: /sys/bus/iio/devices/iio:deviceX/in_accel_y_offset @@ -220,6 +228,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_tempY_offset What: /sys/bus/iio/devices/iio:deviceX/in_temp_offset What: /sys/bus/iio/devices/iio:deviceX/in_pressureY_offset What: /sys/bus/iio/devices/iio:deviceX/in_pressure_offset +What: /sys/bus/iio/devices/iio:deviceX/in_pulseY_offset +What: /sys/bus/iio/devices/iio:deviceX/in_pulse_offset KernelVersion: 2.6.35 Contact: linux-...@vger.kernel.org Description: @@ -251,6 +261,8 @@ What: /sys/bus/iio/devices/iio:deviceX/in_magn_y_scale What: /sys/bus/iio/devices/iio:deviceX/in_magn_z_scale What: /sys/bus/iio/devices/iio:deviceX/in_pressureY_scale What: /sys/bus/iio/devices/iio:deviceX/in_pressure_scale +What: /sys/bus/iio/devices/iio:deviceX/in_pulseY_scale +What: /sys/bus/iio/devices/iio:deviceX/in_pulse_scale KernelVersion: 2.6.35 Contact: linux-...@vger.kernel.org Description: @@ -784,6 +796,8 @@ What: /sys/.../iio:deviceX/scan_elements/in_incli_x_en What: /sys/.../iio:deviceX/scan_elements/in_incli_y_en What: /sys/.../iio:deviceX/scan_elements/in_pressureY_en What: /sys/.../iio:deviceX/scan_elements/in_pressure_en +What: /sys/.../iio:deviceX/scan_elements/in_pulseY_en +What: /sys/.../iio:deviceX/scan_elements/in_pulse_en KernelVersion: 2.6.37 Contact: linux-...@vger.kernel.org Description: @@ -799,6 +813,8 @@ What: /sys/.../iio:deviceX/scan_elements/in_voltageY_supply_type What: /sys/.../iio:deviceX/scan_elements/in_timestamp_type What: /sys/.../iio:deviceX/scan_elements/in_pressureY_type What: /sys/.../iio:deviceX/scan_elements/in_pressure_type +What: /sys/.../iio:deviceX/scan_elements/in_pulseY_type +What: /sys/.../iio:deviceX/scan_elements/in_pulse_type KernelVersion: 2.6.37 Contact: linux-...@vger.kernel.org Description: @@ -845,6 +861,8 @@ What: /sys/.../iio:deviceX/scan_elements/in_incli_y_index What: /sys/.../iio:deviceX/scan_elements/in_timestamp_index What: /sys/.../iio:deviceX/scan_elements/in_pressureY_index What: /sys/.../iio:deviceX/scan_elements/in_pressure_index +What: /sys/.../iio:deviceX/scan_elements/in_pulseY_index +What: /sys/.../iio:deviceX/scan_elements/in_pulse_index KernelVersion: 2.6.37 Contact: linux-...@vger.kernel.org Description: diff --git a/Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap b/Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap new file mode 100644 index 000..a9e4a9f --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap @@ -0,0 +1,9 @@ +What: /sys/bus/iio/devices/iio:deviceX/pulse_polarityY +What: /sys/bus/iio/devices/iio:deviceX/pulse_polarity +Date: January 2014 +KernelVersion: 3.15 +Contact: Matt Porter +Description: + Get and set the polarity of the pulse signal to be captured + for channel Y. 1 indicates a high pulse signal and 0 + indicates a low pulse signal. -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 1/6] iio: add support for pulse width capture devices
Add a channel type to support pulse width capture devices. These devices capture the timing of a PWM signal based on a configurable trigger Signed-off-by: Matt Porter --- drivers/iio/industrialio-core.c | 1 + include/linux/iio/types.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index acc911a..6ea0cf8 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/industrialio-core.c @@ -70,6 +70,7 @@ static const char * const iio_chan_type_name_spec[] = { [IIO_CCT] = "cct", [IIO_PRESSURE] = "pressure", [IIO_HUMIDITYRELATIVE] = "humidityrelative", + [IIO_PULSE] = "pulse", }; static const char * const iio_modifier_names[] = { diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h index 084d882..4fa8840 100644 --- a/include/linux/iio/types.h +++ b/include/linux/iio/types.h @@ -30,6 +30,7 @@ enum iio_chan_type { IIO_CCT, IIO_PRESSURE, IIO_HUMIDITYRELATIVE, + IIO_PULSE, }; enum iio_modifier { -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 2/6] iio: pulse: add TI ECAP driver
Adds support for capturing PWM signals using the TI ECAP peripheral. This driver supports triggered buffer capture of pulses on multiple ECAP instances. In addition, the driver supports configurable polarity of the signal to be captured. Signed-off-by: Matt Porter --- drivers/iio/pulse/Kconfig | 20 ++ drivers/iio/pulse/Makefile | 6 + drivers/iio/pulse/tiecap.c | 493 + 3 files changed, 519 insertions(+) create mode 100644 drivers/iio/pulse/Kconfig create mode 100644 drivers/iio/pulse/Makefile create mode 100644 drivers/iio/pulse/tiecap.c diff --git a/drivers/iio/pulse/Kconfig b/drivers/iio/pulse/Kconfig new file mode 100644 index 000..9864d4b --- /dev/null +++ b/drivers/iio/pulse/Kconfig @@ -0,0 +1,20 @@ +# +# Pulse Capture Devices +# +# When adding new entries keep the list in alphabetical order + +menu "Pulse Capture Devices" + +config IIO_TIECAP + tristate "TI ECAP Pulse Capture" + depends on SOC_AM33XX + select IIO_BUFFER + select IIO_TRIGGERED_BUFFER + help +If you say yes here you get support for the TI ECAP peripheral +in pulse capture mode. + +This driver can also be built as a module. If so, the module +will be called tiecap + +endmenu diff --git a/drivers/iio/pulse/Makefile b/drivers/iio/pulse/Makefile new file mode 100644 index 000..94d4b00 --- /dev/null +++ b/drivers/iio/pulse/Makefile @@ -0,0 +1,6 @@ +# +# Makefile for IIO PWM Capture Devices +# + +# When adding new entries keep the list in alphabetical order +obj-$(CONFIG_IIO_TIECAP) += tiecap.o diff --git a/drivers/iio/pulse/tiecap.c b/drivers/iio/pulse/tiecap.c new file mode 100644 index 000..3d21080 --- /dev/null +++ b/drivers/iio/pulse/tiecap.c @@ -0,0 +1,493 @@ +/* + * ECAP IIO pulse capture driver + * + * Copyright (C) 2014 Linaro Limited + * Author: Matt Porter + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../pwm/pwm-tipwmss.h" + +/* ECAP regs and bits */ +#define CAP1 0x08 +#define CAP2 0x0c +#define ECCTL1 0x28 +#define ECCTL1_RUN_FREEBIT(15) +#define ECCTL1_CAPLDEN BIT(8) +#define ECCTL1_CAP2POL BIT(2) +#define ECCTL1_CTRRST1 BIT(1) +#define ECCTL1_CAP1POL BIT(0) +#define ECCTL2 0x2a +#define ECCTL2_SYNCO_SEL_DIS BIT(7) +#define ECCTL2_TSCTR_FREERUN BIT(4) +#define ECCTL2_REARM BIT(3) +#define ECCTL2_STOP_WRAP_2 BIT(1) +#define ECEINT 0x2c +#define ECFLG 0x2e +#define ECCLR 0x30 +#define ECINT_CTRCMP BIT(7) +#define ECINT_CTRPRD BIT(6) +#define ECINT_CTROVF BIT(5) +#define ECINT_CEVT4BIT(4) +#define ECINT_CEVT3BIT(3) +#define ECINT_CEVT2BIT(2) +#define ECINT_CEVT1BIT(1) +#define ECINT_ALL (ECINT_CTRCMP | \ + ECINT_CTRPRD | \ + ECINT_CTROVF | \ + ECINT_CEVT4 | \ + ECINT_CEVT3 | \ + ECINT_CEVT2 | \ + ECINT_CEVT1) + +/* ECAP driver flags */ +#define ECAP_POLARITY_HIGH BIT(1) +#define ECAP_ENABLED BIT(0) + +struct ecap_context { + u32 cap1; + u32 cap2; + u16 ecctl1; + u16 ecctl2; + u16 eceint; +}; + +struct ecap_state { + unsigned long flags; + unsigned intclk_rate; + void __iomem*regs; + u32 *buf; + struct ecap_context ctx; +}; + +#define dev_to_ecap_state(d) iio_priv(dev_to_iio_dev(d)) + +static const struct iio_chan_spec ecap_channels[] = { + { + .type = IIO_PULSE, + .channel= 0, + .info_mask_separate = + BIT(IIO_CHAN_INFO_RAW) | BIT(IIO_CHAN_INFO_SCALE), + .scan_index = 0, + .scan_type = { + .sign = 'u', + .realbits = 32, + .storagebits= 32, + .endianness = IIO_LE, + }, + .modified = 0, + }, + IIO_CHAN_SOFT_TIMESTAMP(1) +}; + +static ssize_t ecap_attr_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct ecap_state *state = dev_to_eca
[PATCH v2 3/6] iio: enable selection and build of pulse drivers
Add the pulse driver subdirectory when configuring and building IIO. Signed-off-by: Matt Porter --- drivers/iio/Kconfig | 1 + drivers/iio/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/iio/Kconfig b/drivers/iio/Kconfig index 5dd0e12..286acc3 100644 --- a/drivers/iio/Kconfig +++ b/drivers/iio/Kconfig @@ -74,6 +74,7 @@ if IIO_TRIGGER source "drivers/iio/trigger/Kconfig" endif #IIO_TRIGGER source "drivers/iio/pressure/Kconfig" +source "drivers/iio/pulse/Kconfig" source "drivers/iio/temperature/Kconfig" endif # IIO diff --git a/drivers/iio/Makefile b/drivers/iio/Makefile index 887d390..9a953c9 100644 --- a/drivers/iio/Makefile +++ b/drivers/iio/Makefile @@ -24,5 +24,6 @@ obj-y += light/ obj-y += magnetometer/ obj-y += orientation/ obj-y += pressure/ +obj-y += pulse/ obj-y += temperature/ obj-y += trigger/ -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 5/6] pwm: enable TI PWMSS if the IIO tiecap driver is selected
The IIO TI ECAP driver depends on the TI PWMSS management driver in this subsystem. Enable PWMSS when the IIO TI ECAP driver is selected. Signed-off-by: Matt Porter --- drivers/pwm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index 22f2f28..bd3cc65 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -219,7 +219,7 @@ config PWM_TIEHRPWM config PWM_TIPWMSS bool - default y if SOC_AM33XX && (PWM_TIECAP || PWM_TIEHRPWM) + default y if SOC_AM33XX && (IIO_TIECAP || PWM_TIECAP || PWM_TIEHRPWM) help PWM Subsystem driver support for AM33xx SOC. -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 6/6] ARM: dts: AM33XX: Add ecap interrupt properties
Add missing interrupt properties to the ecap0, ecap1, and ecap2 nodes. Signed-off-by: Matt Porter --- arch/arm/boot/dts/am33xx.dtsi | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi index 6d95d3d..b4139ba 100644 --- a/arch/arm/boot/dts/am33xx.dtsi +++ b/arch/arm/boot/dts/am33xx.dtsi @@ -582,6 +582,8 @@ compatible = "ti,am33xx-ecap"; #pwm-cells = <3>; reg = <0x48300100 0x80>; + interrupts = <31>; + interrupt-names = "ecap0"; ti,hwmods = "ecap0"; status = "disabled"; }; @@ -610,6 +612,8 @@ compatible = "ti,am33xx-ecap"; #pwm-cells = <3>; reg = <0x48302100 0x80>; + interrupts = <47>; + interrupt-names = "ecap1"; ti,hwmods = "ecap1"; status = "disabled"; }; @@ -638,6 +642,8 @@ compatible = "ti,am33xx-ecap"; #pwm-cells = <3>; reg = <0x48304100 0x80>; + interrupts = <61>; + interrupt-names = "ecap2"; ti,hwmods = "ecap2"; status = "disabled"; }; -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 0/6] IIO pulse capture support for TI ECAP
Changes since v1: - Rebased to 3.14-rc1 - Renamed in_pulse_polarity to pulse_polarity - Added ABI entries for pulse devices and TI ECAP This series adds support for PWM capture devices within IIO and adds a TI ECAP IIO driver. PWM capture devices are supported using a new IIO "pulse" channel type. The IIO ECAP driver implements interrupt driven triggered buffer capture only as raw sample reads are not applicable to this hardware. Initially, the driver supports a single pulse width measurement with configurable polarity. The ECAP hardware can support measurement of a complete period and duty cycle but this is not yet implemented. Matt Porter (6): iio: add support for pulse width capture devices iio: pulse: add TI ECAP driver iio: enable selection and build of pulse drivers iio: Add ABI docs for pulse capture devices pwm: enable TI PWMSS if the IIO tiecap driver is selected ARM: dts: AM33XX: Add ecap interrupt properties Documentation/ABI/testing/sysfs-bus-iio| 18 + .../ABI/testing/sysfs-bus-iio-pulse-tiecap | 9 + arch/arm/boot/dts/am33xx.dtsi | 6 + drivers/iio/Kconfig| 1 + drivers/iio/Makefile | 1 + drivers/iio/industrialio-core.c| 1 + drivers/iio/pulse/Kconfig | 20 + drivers/iio/pulse/Makefile | 6 + drivers/iio/pulse/tiecap.c | 493 + drivers/pwm/Kconfig| 2 +- include/linux/iio/types.h | 1 + 11 files changed, 557 insertions(+), 1 deletion(-) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap create mode 100644 drivers/iio/pulse/Kconfig create mode 100644 drivers/iio/pulse/Makefile create mode 100644 drivers/iio/pulse/tiecap.c -- 1.8.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 6/6] ARM: dts: AM33XX: Add ecap interrupt properties
Add missing interrupt properties to the ecap0, ecap1, and ecap2 nodes. Signed-off-by: Matt Porter mpor...@linaro.org --- arch/arm/boot/dts/am33xx.dtsi | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi index 6d95d3d..b4139ba 100644 --- a/arch/arm/boot/dts/am33xx.dtsi +++ b/arch/arm/boot/dts/am33xx.dtsi @@ -582,6 +582,8 @@ compatible = ti,am33xx-ecap; #pwm-cells = 3; reg = 0x48300100 0x80; + interrupts = 31; + interrupt-names = ecap0; ti,hwmods = ecap0; status = disabled; }; @@ -610,6 +612,8 @@ compatible = ti,am33xx-ecap; #pwm-cells = 3; reg = 0x48302100 0x80; + interrupts = 47; + interrupt-names = ecap1; ti,hwmods = ecap1; status = disabled; }; @@ -638,6 +642,8 @@ compatible = ti,am33xx-ecap; #pwm-cells = 3; reg = 0x48304100 0x80; + interrupts = 61; + interrupt-names = ecap2; ti,hwmods = ecap2; status = disabled; }; -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 0/6] IIO pulse capture support for TI ECAP
Changes since v1: - Rebased to 3.14-rc1 - Renamed in_pulse_polarity to pulse_polarity - Added ABI entries for pulse devices and TI ECAP This series adds support for PWM capture devices within IIO and adds a TI ECAP IIO driver. PWM capture devices are supported using a new IIO pulse channel type. The IIO ECAP driver implements interrupt driven triggered buffer capture only as raw sample reads are not applicable to this hardware. Initially, the driver supports a single pulse width measurement with configurable polarity. The ECAP hardware can support measurement of a complete period and duty cycle but this is not yet implemented. Matt Porter (6): iio: add support for pulse width capture devices iio: pulse: add TI ECAP driver iio: enable selection and build of pulse drivers iio: Add ABI docs for pulse capture devices pwm: enable TI PWMSS if the IIO tiecap driver is selected ARM: dts: AM33XX: Add ecap interrupt properties Documentation/ABI/testing/sysfs-bus-iio| 18 + .../ABI/testing/sysfs-bus-iio-pulse-tiecap | 9 + arch/arm/boot/dts/am33xx.dtsi | 6 + drivers/iio/Kconfig| 1 + drivers/iio/Makefile | 1 + drivers/iio/industrialio-core.c| 1 + drivers/iio/pulse/Kconfig | 20 + drivers/iio/pulse/Makefile | 6 + drivers/iio/pulse/tiecap.c | 493 + drivers/pwm/Kconfig| 2 +- include/linux/iio/types.h | 1 + 11 files changed, 557 insertions(+), 1 deletion(-) create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-pulse-tiecap create mode 100644 drivers/iio/pulse/Kconfig create mode 100644 drivers/iio/pulse/Makefile create mode 100644 drivers/iio/pulse/tiecap.c -- 1.8.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/