* [PATCH 1/4] ARM: dts: Add Freescale SAI ALSA SoC Digital Audio Interface node for VF610.
From: Xiubo Li @ 2014-02-19 5:38 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
shawn.guo-QSEj5FYQhm4dnm+yROfE0A
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-lFZ/pmaqli7XmaaqVzeoHQ,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Xiubo Li
In-Reply-To: <1392788323-6092-1-git-send-email-Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
This patch adds the SAI's edma mux Tx and Rx support.
Signed-off-by: Xiubo Li <Li.Xiubo-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
---
arch/arm/boot/dts/vf610.dtsi | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi
index 91a7757..f08df47 100644
--- a/arch/arm/boot/dts/vf610.dtsi
+++ b/arch/arm/boot/dts/vf610.dtsi
@@ -169,6 +169,9 @@
interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clks VF610_CLK_SAI2>;
clock-names = "sai";
+ dma-names = "tx", "rx";
+ dmas = <&edma0 0 21>,
+ <&edma0 0 20>;
status = "disabled";
};
--
1.8.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related
* [PATCH 0/4] Add audio card support for Vybird-TWR board
From: Xiubo Li @ 2014-02-19 5:38 UTC (permalink / raw)
To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
shawn.guo-QSEj5FYQhm4dnm+yROfE0A
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, linux-lFZ/pmaqli7XmaaqVzeoHQ,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Xiubo Li
Add audio card support for Vybird-TWR board
Xiubo Li (4):
ARM: dts: Add Freescale SAI ALSA SoC Digital Audio Interface node for
VF610.
ARM: dts: Enable SAI ALSA SoC DAI device for Vybrid VF610 TOWER board.
ARM: dts: Enable SGTL5000 codec based audio driver node for VF610
TOWER.
ARM: dts: Add simple-card support for Vybird-TWR board
arch/arm/boot/dts/vf610-twr.dts | 68 +++++++++++++++++++++++++++++++++++++++++
arch/arm/boot/dts/vf610.dtsi | 3 ++
2 files changed, 71 insertions(+)
--
1.8.4
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v7 2/8] clk: sunxi: Implement MMC phase control
From: Mike Turquette @ 2014-02-19 5:21 UTC (permalink / raw)
To: Maxime Ripard, David Lanzendörfer
Cc: devicetree, dinguyen,
Ulf Hansson <ulf.hansson@linaro.org>, Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>, Simon Baatz <gmbnomis@gmail.com>, Hans de Goede <hdegoede@redhat.com>, Emilio López <emilio@elopez.com.ar>, linux-mmc@vger.kernel.org, Chris Ball <chris@printf.net>, linux-kernel@vger.kernel.org, H Hartley Sweeten <hsweeten@visionengravers.com>, linux-sunxi@googlegroups.com, Tejun Heo <tj@kernel.org>, Guennadi Liakhovetski,
linux-arm-kernel
In-Reply-To: <20140218141532.GH3142@lukather>
Quoting Maxime Ripard (2014-02-18 06:15:32)
> Hi,
>
> On Mon, Feb 17, 2014 at 11:02:21AM +0100, David Lanzendörfer wrote:
> > From: Emilio López <emilio@elopez.com.ar>
> >
> > Signed-off-by: Emilio López <emilio@elopez.com.ar>
>
> You're missing your Signed-off-by here too. Remember, for every patch
> you send, your Signed-off-by must be there, regardless wether you're
> the author or not.
>
> A commit log would be very much welcome too.
>
> Now, down to the patch itself, I remember Mike saying that he would
> prefer adding a function in the framework instead of hardcoding
> it. Mike, what's your feeling on this? Would merging this seem
> reasonnable to you as is, or do you want to take this to the
> framework?
Hi Maxime & Emilio,
Maybe something like the following RFC? If it seems sufficient for this
case then I will post to the wider list with an eye towards merging it
for 3.15. I've Cc'd Dinh since this came up on the socfpga thread as
well.
Regards,
Mike
From 56fa297591be5c5e22df6d2ca43fccf285a45636 Mon Sep 17 00:00:00 2001
From: Mike Turquette <mturquette@linaro.org>
Date: Tue, 18 Feb 2014 20:33:50 -0800
Subject: [PATCH] clk: introduce clk_set_phase function & callback
A common operation for a clock signal generator is to shift the phase of
that signal. This patch introduces a new function to the clk.h API to
dynamically adjust the phase of a clock signal. Additionally this patch
introduces support for the new function in the common clock framework
via the .set_phase call back in struct clk_ops.
Signed-off-by: Mike Turquette <mturquette@linaro.org>
---
This patch is totally untested. It may make your board burst into
flames.
drivers/clk/clk.c | 84 +++++++++++++++++++++++++++++++++++++++++---
include/linux/clk-private.h | 1 +
include/linux/clk-provider.h | 5 +++
include/linux/clk.h | 29 +++++++++++++++
4 files changed, 115 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ea2ca9f..635170a 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -106,11 +106,11 @@ static void clk_summary_show_one(struct seq_file *s, struct clk *c, int level)
if (!c)
return;
- seq_printf(s, "%*s%-*s %-11d %-12d %-10lu %-11lu",
+ seq_printf(s, "%*s%-*s %-11d %-12d %-10lu %-11lu %-3d",
level * 3 + 1, "",
30 - level * 3, c->name,
c->enable_count, c->prepare_count, clk_get_rate(c),
- clk_get_accuracy(c));
+ clk_get_accuracy(c), clk_get_phase(c));
seq_printf(s, "\n");
}
@@ -132,8 +132,8 @@ static int clk_summary_show(struct seq_file *s, void *data)
{
struct clk *c;
- seq_printf(s, " clock enable_cnt prepare_cnt rate accuracy\n");
- seq_printf(s, "---------------------------------------------------------------------------------\n");
+ seq_printf(s, " clock enable_cnt prepare_cnt rate accuracy phase\n");
+ seq_printf(s, "-----------------------------------------------------------------------------------------\n");
clk_prepare_lock();
@@ -171,6 +171,7 @@ static void clk_dump_one(struct seq_file *s, struct clk *c, int level)
seq_printf(s, "\"prepare_count\": %d,", c->prepare_count);
seq_printf(s, "\"rate\": %lu", clk_get_rate(c));
seq_printf(s, "\"accuracy\": %lu", clk_get_accuracy(c));
+ seq_printf(s, "\"phase\": %d", clk_get_phase(c));
}
static void clk_dump_subtree(struct seq_file *s, struct clk *c, int level)
@@ -257,6 +258,11 @@ static int clk_debug_create_one(struct clk *clk, struct dentry *pdentry)
if (!d)
goto err_out;
+ d = debugfs_create_u32("clk_phase", S_IRUGO, clk->dentry,
+ (u32 *)&clk->phase);
+ if (!d)
+ goto err_out;
+
d = debugfs_create_x32("clk_flags", S_IRUGO, clk->dentry,
(u32 *)&clk->flags);
if (!d)
@@ -1766,6 +1772,76 @@ out:
EXPORT_SYMBOL_GPL(clk_set_parent);
/**
+ * clk_set_phase - adjust the phase shift of a clock signal
+ * @clk: clock signal source
+ * @degrees: number of degrees the signal is shifted
+ *
+ * Shifts the phase of a clock signal by the specified degrees. Returns 0 on
+ * success, -EERROR otherwise.
+ *
+ * This function makes no distiction about the input or reference signal that
+ * we adjust the clock signal phase against. For example phase locked-loop
+ * clock signal generators we may shift phase with respect to feedback clock
+ * signal input, but for other cases the clock phase may be shifted with
+ * respect to some other, unspecified signal.
+ *
+ * Additionally the concept of phase shift does not propagate through the clock
+ * tree hierarchy, which sets it appart from clock rates and clock accuracy. A
+ * parent clock phase attribute does not have an impact on the phase attribute
+ * of a child clock.
+ */
+int clk_set_phase(struct clk *clk, int degrees)
+{
+ int ret = 0;
+
+ if (!clk)
+ goto out;
+
+ /* sanity check degrees */
+ degrees %= 360;
+ if (degrees < 0)
+ degrees += 360;
+
+ clk_prepare_lock();
+
+ if (!clk->ops->set_phase)
+ goto out_unlock;
+
+ ret = clk->ops->set_phase(clk->hw, degrees);
+
+ if (!ret)
+ clk->phase = degrees;
+
+out_unlock:
+ clk_prepare_unlock();
+
+out:
+ return ret;
+}
+
+/**
+ * clk_get_phase - return the phase shift of a clock signal
+ * @clk: clock signal source
+ *
+ * Returns the phase shift of a clock node in degrees, otherwise returns
+ * -EERROR.
+ */
+int clk_get_phase(struct clk *clk)
+{
+ int ret = 0;
+
+ if (!clk)
+ goto out;
+
+ clk_prepare_lock();
+ ret = clk->phase;
+ clk_prepare_unlock();
+
+out:
+ return ret;
+}
+
+/**
* __clk_init - initialize the data structures in a struct clk
* @dev: device initializing this clk, placeholder for now
* @clk: clk being initialized
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
index efbf70b..845be30 100644
--- a/include/linux/clk-private.h
+++ b/include/linux/clk-private.h
@@ -46,6 +46,7 @@ struct clk {
unsigned int enable_count;
unsigned int prepare_count;
unsigned long accuracy;
+ int phase;
struct hlist_head children;
struct hlist_node child_node;
unsigned int notifier_count;
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 939533d..cc49fb8 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -127,6 +127,10 @@ struct clk_hw;
* separately via calls to .set_parent and .set_rate.
* Returns 0 on success, -EERROR otherwise.
*
+ * @set_phase: Shift the phase this clock signal in degrees specified
+ * by the second argument. Valid values for degrees are
+ * 0-359. Return 0 on success, otherwise -EERROR.
+ *
*
* The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow
* implementations to split any work between atomic (enable) and sleepable
@@ -164,6 +168,7 @@ struct clk_ops {
unsigned long parent_rate, u8 index);
unsigned long (*recalc_accuracy)(struct clk_hw *hw,
unsigned long parent_accuracy);
+ int (*set_phase)(struct clk_hw *hw, int degrees);
void (*init)(struct clk_hw *hw);
};
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 0dd9114..ae2b2f4 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -92,6 +92,25 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb);
*/
long clk_get_accuracy(struct clk *clk);
+/**
+ * clk_set_phase - adjust the phase shift of a clock signal
+ * @clk: clock signal source
+ * @degrees: number of degrees the signal is shifted
+ *
+ * Shifts the phase of a clock signal by the specified degrees. Returns 0 on
+ * success, -EERROR otherwise.
+ */
+int clk_set_phase(struct clk *clk, int degrees);
+
+/**
+ * clk_get_phase - return the phase shift of a clock signal
+ * @clk: clock signal source
+ *
+ * Returns the phase shift of a clock node in degrees, otherwise returns
+ * -EERROR.
+ */
+int clk_get_phase(struct clk *clk);
+
#else
static inline long clk_get_accuracy(struct clk *clk)
@@ -99,6 +118,16 @@ static inline long clk_get_accuracy(struct clk *clk)
return -ENOTSUPP;
}
+static inline long clk_set_phase(struct clk *clk, int phase)
+{
+ return -ENOTSUPP;
+}
+
+static inline long clk_get_phase(struct clk *clk)
+{
+ return -ENOTSUPP;
+}
+
#endif
/**
--
1.8.3.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related
* Re: [PATCH v5 1/3] ARM: dts: vf610-twr: Add ADC support
From: Shawn Guo @ 2014-02-19 5:07 UTC (permalink / raw)
To: Fugang Duan
Cc: jic23-DgEjT+Ai2ygdnm+yROfE0A, sachin.kamat-QSEj5FYQhm4dnm+yROfE0A,
pmeerw-jW+XmwGofnusTnJN9+BGXg, lars-Qo5EllUWu/uELgA04lAiVw,
mark.rutland-5wv7dgnIgG8, linux-iio-u79uwXL29TY76Z2rM5mHXA,
Rob Herring, Grant Likely, Pawel Moll, Ian Campbell, Kumar Gala,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <20140216074850.GA2946-rvtDTF3kK1ictlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
On Sun, Feb 16, 2014 at 03:48:53PM +0800, Shawn Guo wrote:
> Copy more DT folks and lists, as I want to make sure everyone agrees on
> how the fixed regulators should organized in the device tree sources,
> before I apply the patch.
>
> On Sun, Jan 26, 2014 at 01:39:31PM +0800, Fugang Duan wrote:
> > vf610 has two ADC controllers, and vf610-twr board ADC0_SE5 pin connect
> > to sliding rheostat for ADC test, other ADC pins connect to connectors for
> > future use.
> >
> > Add support for ADC0_SE5.
> >
> > CC: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> > CC: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> > CC: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>
> > CC: Otavio Salvador <otavio-fKevB0iiKLMBZ+LybsDmbA@public.gmane.org>
> > CC: Peter Meerwald <pmeerw-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
> > CC: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
> > Signed-off-by: Fugang Duan <B38611-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> > ---
> > arch/arm/boot/dts/vf610-twr.dts | 21 +++++++++++++++++++++
> > arch/arm/boot/dts/vf610.dtsi | 26 ++++++++++++++++++++++++++
> > 2 files changed, 47 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/arm/boot/dts/vf610-twr.dts b/arch/arm/boot/dts/vf610-twr.dts
> > index c8047ca..d867be3 100644
> > --- a/arch/arm/boot/dts/vf610-twr.dts
> > +++ b/arch/arm/boot/dts/vf610-twr.dts
> > @@ -34,6 +34,27 @@
> > };
> > };
> >
> > + regulators {
> > + compatible = "simple-bus";
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + reg_vcc_3v3_mcu: regulator@0 {
> > + compatible = "regulator-fixed";
> > + reg = <0>;
> > + regulator-name = "vcc_3v3_mcu";
> > + regulator-min-microvolt = <3300000>;
> > + regulator-max-microvolt = <3300000>;
> > + };
> > + };
>
> Per discussion [1], Mark Rutland suggests that instead of organizing
> the fixed regulator nodes in a simple-bus container, it should be put
> under root node directly like below.
>
> / {
> reg_vcc_3v3_mcu: regulator_0 {
> compatible = "regulator-fixed";
> regulator-name = "vcc_3v3_mcu";
> regulator-min-microvolt = <3300000>;
> regulator-max-microvolt = <3300000>;
> };
> };
>
> Is this what all DT folks agree on? At least the node name should be
> 'regulator-0' since it's more idiomatic to use '-' than '_' in node
> name?
It looks that Mark is giving up [1]. And we're fine with the original
code then.
Shawn
[1] http://thread.gmane.org/gmane.linux.drivers.devicetree/61894/focus=62405
^ permalink raw reply
* Re: [PATCH v2 3/5] regulator: add bcm590xx regulator driver
From: Mark Brown @ 2014-02-19 4:52 UTC (permalink / raw)
To: Matt Porter
Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
Samuel Ortiz, Lee Jones, Liam Girdwood, Christian Daudt,
Devicetree List, Linux ARM Kernel List, Linux Kernel Mailing List
In-Reply-To: <1392765432-9111-4-git-send-email-mporter-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 837 bytes --]
On Tue, Feb 18, 2014 at 06:17:10PM -0500, Matt Porter wrote:
> +static struct of_device_id bcm590xx_of_match[] = {
> + { .compatible = "brcm,bcm59056-regs", },
> + { }
> +};
This looks pretty much OK however I am in general suspicious of MFDs
that have subdevices like this in the DT - it doesn't seem like this is
a reusable device which can appear anywhere else so you're pretty much
just representing the way that Linux splits things up here rather than a
reusable IP that can reasonably have a separate binding.
If you had a binding which did something like enumerate the individual
IP blocks as individual devices that'd be more interesting, I could see
for example that a different PMIC might have a different set of register
compatible regulator IPs laid out. It looks like that might be doable,
but it's in no way essential.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH v2 1/5] mfd: add bcm590xx pmu DT binding
From: Mark Brown @ 2014-02-19 4:47 UTC (permalink / raw)
To: Matt Porter
Cc: Mark Rutland, Devicetree List, Samuel Ortiz, Pawel Moll,
Ian Campbell, Christian Daudt, Liam Girdwood,
Linux Kernel Mailing List, Rob Herring, Kumar Gala, Lee Jones,
Linux ARM Kernel List
In-Reply-To: <1392765432-9111-2-git-send-email-mporter@linaro.org>
[-- Attachment #1.1: Type: text/plain, Size: 198 bytes --]
On Tue, Feb 18, 2014 at 06:17:08PM -0500, Matt Porter wrote:
> +
> + rfldo_reg: regulator@0 {
> + reg = <0>;
What do these reg values mean, they don't seem to be documented in the
binding?
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH v2 2/5] mfd: add bcm590xx pmu driver
From: Mark Brown @ 2014-02-19 4:46 UTC (permalink / raw)
To: Matt Porter
Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
Samuel Ortiz, Lee Jones, Liam Girdwood, Christian Daudt,
Devicetree List, Linux ARM Kernel List, Linux Kernel Mailing List
In-Reply-To: <1392765432-9111-3-git-send-email-mporter@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 281 bytes --]
On Tue, Feb 18, 2014 at 06:17:09PM -0500, Matt Porter wrote:
> +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
> +
Why does this need to be built in?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH v2 5/5] ARM: dts: add bcm590xx pmu support and enable for bcm28155-ap
From: Mark Brown @ 2014-02-19 4:44 UTC (permalink / raw)
To: Matt Porter
Cc: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
Samuel Ortiz, Lee Jones, Liam Girdwood, Christian Daudt,
Devicetree List, Linux ARM Kernel List, Linux Kernel Mailing List,
Tim Kryger
In-Reply-To: <1392765432-9111-6-git-send-email-mporter@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 526 bytes --]
On Tue, Feb 18, 2014 at 06:17:12PM -0500, Matt Porter wrote:
> + csr_reg: regulator@13 {
> + reg = <13>;
> + regulator-compatible = "csr";
> + regulator-min-microvolt = <860000>;
> + regulator-max-microvolt = <1440000>;
> + };
You should not be setting voltage ranges like this in a .dtsi - you've
no idea if these voltage ranges are in fact valid for any given board so
they can't be set safely. In general I would not expect to see any
configuration at all for regulators in an include file for the chip.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* RE: [PATCH V5 4/8] phy: st-miphy-40lp: Add skeleton driver
From: Mohit KUMAR DCG @ 2014-02-19 4:09 UTC (permalink / raw)
To: Mohit KUMAR DCG, Arnd Bergmann
Cc: Pratyush ANAND, devicetree@vger.kernel.org, spear-devel,
linux-kernel@vger.kernel.org, Kishon Vijay Abraham I, Lee Jones,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <2CC2A0A4A178534D93D5159BF3BCB66189FD2CAD14@EAPEX1MAIL1.st.com>
Hello Arnd,
> -----Original Message-----
> From: Mohit KUMAR [mailto:mohit.kumar@st.com]
> Sent: Wednesday, February 12, 2014 10:22 AM
> To: Arnd Bergmann
> Cc: Pratyush ANAND; Kishon Vijay Abraham I; spear-devel; linux-arm-
> kernel@lists.infradead.org; devicetree@vger.kernel.org; linux-
> kernel@vger.kernel.org; Lee Jones
> Subject: RE: [PATCH V5 4/8] phy: st-miphy-40lp: Add skeleton driver
>
> Hello Arnd,
>
> > -----Original Message-----
> > From: Arnd Bergmann [mailto:arnd@arndb.de]
> > Sent: Tuesday, February 11, 2014 8:09 PM
> > To: Mohit KUMAR DCG
> > Cc: Pratyush ANAND; Kishon Vijay Abraham I; spear-devel; linux-arm-
> > kernel@lists.infradead.org; devicetree@vger.kernel.org; linux-
> > kernel@vger.kernel.org; Lee Jones
> > Subject: Re: [PATCH V5 4/8] phy: st-miphy-40lp: Add skeleton driver
> >
> > On Tuesday 11 February 2014 11:57:46 Mohit KUMAR DCG wrote:
> > >
> > > > Maybe mention that this phy is used inside the spear13xx SoC here
> > > > rather than a standalone phy.
> > >
> > > - Yes, for spear13xx its used internally. Do you think that it
> > > requires to be mentioned here?
> > > We have few prototype boards that uses this as external phy.
> >
> > [adding Lee since he mentioned working on a similar part]
> >
> > I'm a bit confused. Is it actually the same IP block that can be used
> > internally as part of a SoC and as a standalone chip?
> >
> > Since some of the settings of the PHY are controlled through the misc
> > register in case of spear13xx, I assume that part is different on the
> > standalone version. How do you actually select the mode in that case?
> >
> > It would certainly be helpful to explain this somewhere, and the
> > binding might not be the worst place for this.
> >
> > On a related note, the driver in its current shape looks a bit silly
> > since it doesn't contain any of the miphy specific code but only the
> > SoC specific parts (as I suggested you do, so I'm not blaming you :-))
> > and a multiplexer that switches between the two possible
> implementations.
>
> - yes, thats what we were explaining earlier. If it is integrated into some SoC
> Then there are some soc specific configurations. Actual phy reg settings could
> also vary for the different SoCs for the best tuning.
>
> However we agreed to your idea as miphy40lp register definitions would
> remain same across the SoCs.
>
> >
> > What is your plan for the future, do you intend to add the actual
> > miphy code soon, or is that something you just want to leave as an
> > option for the future but have no specific plans to do right now? If
> > not, the driver would probably look nicer if it were split into two
> > separate implementations, one for each spear13xx SoC and with a separate
> set of phy_ops but no multiplexer.
>
> Do you want it to split the code into two different files like phy-
> miphyspear1310.c and phy-miphyspear1340.c ?
- Waiting for your final say about splitting into two different files or any
other comment for the patch series?
Thanks
Mohit
^ permalink raw reply
* Re: [PATCH v5 1/4] ASoC: tlv320aic32x4: Support for master clock
From: Mark Brown @ 2014-02-19 3:54 UTC (permalink / raw)
To: Markus Pargmann
Cc: Liam Girdwood, Lars-Peter Clausen,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
devicetree-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20140218204646.GB10590-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 917 bytes --]
On Tue, Feb 18, 2014 at 09:46:46PM +0100, Markus Pargmann wrote:
> On Tue, Feb 18, 2014 at 10:23:29AM +0900, Mark Brown wrote:
> > Looking at the code the clock isn't physically optional, why not make it
> > mandatory? There's only one mainline user, it looks like it should be
> > straightforward to update with a fixed clock.
> The masterclock is physically optional. There are several modes to use
> this codec without master clock. The PLL can use different clock inputs,
> BCLK, MCLK, etc. and even the PLL is not necessary. Instead BCLK and so
> on can be used as direct codec clock input. However, most of this is not
> supported by the driver yet and I can't test these cases.
Are any of these modes supported by the driver yet? If there's modes
that don't use MCLK supported then I'd expect them to only enable MCLK
if it's actively being used in the current configuration (triggered via
set_sysclk()).
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH 2/2] of: reimplement the matching method for __of_match_node()
From: Kevin Hao @ 2014-02-19 3:09 UTC (permalink / raw)
To: Grant Likely
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, Sebastian Hesselbarth,
Stephen N Chivers, Rob Herring
In-Reply-To: <20140218222918.392D4C40517-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1689 bytes --]
On Tue, Feb 18, 2014 at 10:29:18PM +0000, Grant Likely wrote:
> On Tue, 18 Feb 2014 15:57:30 +0800, Kevin Hao <haokexin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > In the current implementation of __of_match_node(), it will compare
> > each given match entry against all the node's compatible strings
> > with of_device_is_compatible().
> >
> > To achieve multiple compatible strings per node with ordering from
> > specific to generic, this requires given matches to be ordered from
> > specific to generic. For most of the drivers this is not true and
> > also an alphabetical ordering is more sane there.
> >
> > Therefore, we define a following priority order for the match, and
> > then scan all the entries to find the best match.
> > 1. specific compatible && type && name
> > 2. specific compatible && type
> > 3. specific compatible && name
> > 4. specific compatible
> > 5. general compatible && type && name
> > 6. general compatible && type
> > 7. general compatible && name
> > 8. general compatible
> > 9. type && name
> > 10. type
> > 11. name
> >
> > This is based on some pseudo-codes provided by Grant Likely.
>
> The patch looks good, but I wasn't confident applying it directly
> without some validation, so I've written a test case for this function.
> I'll resend the series to the list and cc you. Unfortunately I've found
> one case that is failing on the test cases, but I'm too tired to debug
> it now. Maybe you'd like to take a look. The test case may very well be
> wrong.
The test case looks great. Actually there is a bug in this patch. I will make
new spin to fix it.
Thanks,
Kevin
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* Re: [PATCH v3 1/4] Phytec phyFLEX-i.MX6 : Added USB_OTG Support
From: Shawn Guo @ 2014-02-19 2:23 UTC (permalink / raw)
To: Ashutosh singh
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ, c.hemp-guT5V/WYfQezQB+pC5nmwQ,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, pawel.moll-5wv7dgnIgG8,
mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
galak-sgV2jX0FEOL9JmXXK+q4OQ, festevam-Re5JQEeQqe8AvxtiuMwx3w
In-Reply-To: <1392731185-4885-1-git-send-email-ashutosh.s-mS2nBM426Az/PtFMR13I2A@public.gmane.org>
On Tue, Feb 18, 2014 at 07:16:22PM +0530, Ashutosh singh wrote:
> This patch adds support for USB_OTG on Phytec phyFLEX-i.MX6 Quad module.
>
> Signed-off-by: Ashutosh singh <ashutosh.s-mS2nBM426Az/PtFMR13I2A@public.gmane.org>
Please have the prefix of patch subject be 'ARM: dts: imx6q-phytec: ...'
> ---
> arch/arm/boot/dts/imx6q-phytec-pbab01.dts | 4 ++++
> arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi | 17 +++++++++++++++++
> 2 files changed, 21 insertions(+)
>
> diff --git a/arch/arm/boot/dts/imx6q-phytec-pbab01.dts b/arch/arm/boot/dts/imx6q-phytec-pbab01.dts
> index 7d37ec6..87c3702 100644
> --- a/arch/arm/boot/dts/imx6q-phytec-pbab01.dts
> +++ b/arch/arm/boot/dts/imx6q-phytec-pbab01.dts
> @@ -25,6 +25,10 @@
> status = "okay";
> };
>
> +&usbotg {
> + status = "okay";
> +};
> +
> &usdhc2 {
> status = "okay";
> };
> diff --git a/arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi
> index 1a3b50d..e025ad2 100644
> --- a/arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi
> +++ b/arch/arm/boot/dts/imx6q-phytec-pfla02.dtsi
> @@ -18,6 +18,14 @@
> memory {
> reg = <0x10000000 0x80000000>;
> };
> +
> + reg_usb_otg_vbus: regulator@0 {
You do not have a 'reg' property in the node, so you shouldn't have
'@num' in node name. You may want to name it 'regulator-0'.
> + compatible = "regulator-fixed";
> + regulator-name = "usb_otg_vbus";
> + regulator-min-microvolt = <5000000>;
> + regulator-max-microvolt = <5000000>;
> + gpio = <&gpio4 15 0>;
> + };
> };
>
> &ecspi3 {
> @@ -134,6 +142,7 @@
> MX6QDL_PAD_EIM_D23__GPIO3_IO23 0x80000000
> MX6QDL_PAD_DISP0_DAT3__GPIO4_IO24 0x80000000 /* SPI NOR chipselect */
> MX6QDL_PAD_DI0_PIN15__GPIO4_IO17 0x80000000 /* PMIC interrupt */
> + MX6QDL_PAD_KEY_ROW4__GPIO4_IO15 0x80000000 /* USB_OTG_PWR_EN */
Don't add it into hog group. Define a pinctrl state in above regulator
node for it.
> >;
> };
> };
> @@ -162,6 +171,14 @@
> status = "disabled";
> };
>
> +&usbotg {
> + vbus-supply = <®_usb_otg_vbus>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&pinctrl_usbotg_1>;
pinctrl_usbotg_1 is gone. Please generate the patch against my for-next
branch below.
git://git.linaro.org/people/shawnguo/linux-2.6.git for-next
Shawn
> + disable-over-current;
> + status = "disabled";
> +};
> +
> &usdhc2 {
> pinctrl-names = "default";
> pinctrl-0 = <&pinctrl_usdhc2_2>;
> --
> 1.7.9.5
>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH][v2] powerpc/fsl: Add/update miscellaneous missing bindings
From: Scott Wood @ 2014-02-19 0:20 UTC (permalink / raw)
To: Harninder Rai
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ
In-Reply-To: <1392276554-10368-1-git-send-email-harninder.rai-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
On Thu, 2014-02-13 at 12:59 +0530, Harninder Rai wrote:
> Missing bindings were found on running checkpatch.pl on bsc9132
> device tree. This patch add/update the following
>
> - Add bindings for L2 cache controller
> - Add bindings for memory controller
> - Update bindings for USB controller
>
> Signed-off-by: Harninder Rai <harninder.rai-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> ---
> Changes since base version:
> Incorporated Scott's comments
> - Rename l2cc.txt to l2cache.txt
> - Add information about ePAPR compliance
> - Add missing "cache" in compatible
> - Miscellaneous minors
>
> .../devicetree/bindings/powerpc/fsl/l2cache.txt | 26 ++++++++++++++++++++
> .../devicetree/bindings/powerpc/fsl/mem-ctrlr.txt | 16 ++++++++++++
> Documentation/devicetree/bindings/usb/fsl-usb.txt | 2 +
> 3 files changed, 44 insertions(+), 0 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/l2cache.txt
> create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/mem-ctrlr.txt
>
> diff --git a/Documentation/devicetree/bindings/powerpc/fsl/l2cache.txt b/Documentation/devicetree/bindings/powerpc/fsl/l2cache.txt
> new file mode 100644
> index 0000000..79ef4a1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/powerpc/fsl/l2cache.txt
> @@ -0,0 +1,26 @@
> +Freescale L2 Cache Controller
> +
> +L2 cache is present in Freescale's QorIQ and QorIQ Qonverge platforms.
> +The cache bindings explained below are ePAPR compliant
> +
> +Required Properties:
> +
> +- compatible : Should include "fsl,chip-l2-cache-controller" and "cache"
> + where chip is the processor (bsc9132, npc8572 etc.)
> +- reg : Address and size of L2 cache controller registers
> +- cache-size : Size of the entire L2 cache
> +- interrupts : Error interrupt of L2 controller
> +
> +Optional Properties:
> +
> +- cache-line-size : Size of L2 cache lines
cache-line-size is required as per ePAPR.
> diff --git a/Documentation/devicetree/bindings/powerpc/fsl/mem-ctrlr.txt b/Documentation/devicetree/bindings/powerpc/fsl/mem-ctrlr.txt
> new file mode 100644
> index 0000000..70b42bb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/powerpc/fsl/mem-ctrlr.txt
> @@ -0,0 +1,16 @@
> +Freescale DDR memory controller
> +
> +Properties:
> +
> +- compatible : Should include "fsl,chip-memory-controller" where
> + chip is the processor (bsc9132, mpc8572 etc.)
Please also cover newer device trees that use
"fsl,qoriq-memory-controller" and don't have
"fsl,CHIP-memory-controller" (they also use a variant with the block
version, but since the block version is readable in a register I don't
think it's necessary to specify that here).
> diff --git a/Documentation/devicetree/bindings/usb/fsl-usb.txt b/Documentation/devicetree/bindings/usb/fsl-usb.txt
> index bd5723f..afa5809 100644
> --- a/Documentation/devicetree/bindings/usb/fsl-usb.txt
> +++ b/Documentation/devicetree/bindings/usb/fsl-usb.txt
> @@ -9,6 +9,8 @@ Required properties :
> - compatible : Should be "fsl-usb2-mph" for multi port host USB
> controllers, or "fsl-usb2-dr" for dual role USB controllers
> or "fsl,mpc5121-usb2-dr" for dual role USB controllers of MPC5121
> + Wherever applicable, the IP version of the USB controller should
> + also be mentioned (for eg. fsl-usb2-dr-v2.2 for bsc9132).
Please terminate the previous sentence with a period.
-Scott
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v5 2/4] devicetree: bindings: Document Krait CPU/L1 EDAC
From: Stephen Boyd @ 2014-02-19 0:20 UTC (permalink / raw)
To: Lorenzo Pieralisi
Cc: Borislav Petkov,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-edac-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Mark Rutland,
Kumar Gala, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20140117102109.GA22544-7AyDDHkRsp3ZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
(Sorry, this discussion stalled due to merge window + life events)
On 01/17, Lorenzo Pieralisi wrote:
> On Thu, Jan 16, 2014 at 07:26:17PM +0000, Stephen Boyd wrote:
> > On 01/16, Lorenzo Pieralisi wrote:
> > > On Thu, Jan 16, 2014 at 06:05:05PM +0000, Stephen Boyd wrote:
> > > > On 01/16, Lorenzo Pieralisi wrote:
> > > > > Do we really want to do that ? I am not sure. A cpus node is supposed to
> > > > > be a container node, we should not define this binding just because we
> > > > > know the kernel creates a platform device for it then.
> > > >
> > > > This is just copying more of the ePAPR spec into this document.
> > > > It just so happens that having a compatible field here allows a
> > > > platform device to be created. I don't see why that's a problem.
> > >
> > > I do not see why you cannot define a node like pmu or arch-timer and stick
> > > a compatible property in there. cpus node does not represent a device, and
> > > must not be created as a platform device, that's my opinion.
> > >
> >
> > I had what you're suggesting before in the original revision of
> > this patch. Please take a look at the original patch series[1]. I
> > suppose it could be tweaked slightly to still have a cache node
> > for the L2 interrupt and the next-level-cache pointer from the
> > CPUs.
>
> Ok, sorry, we are running around in circles here, basically you moved
> the node to cpus according to reviews. I still think that treating cpus
> as a device is not a great idea, even though I am in the same
> position with C-states and probably will add C-state tables in the cpus
> node.
>
> http://comments.gmane.org/gmane.linux.power-management.general/41012
>
> I just would like to see under cpus nodes and properties that apply to
> all ARM systems, and avoid defining properties (eg interrupts) that
> have different meanings for different ARM cores.
>
> The question related to why the kernel should create a platform device
> out of cpus is still open. I really do not want to block your series
> for these simple issues but we have to make a decision and stick to that,
> I am fine either way if we have a plan.
>
Do you just want a backup plan in case we don't make a platform
device out of the cpus node? I believe we can always add code
somewhere to create a platform device at runtime if we detect the
cpus node has a compatible string equal to "qcom,krait". We could
probably change this driver's module_init() to scan the DT for
such a compatible string and create the platform device right
there. If we get more than one interrupt in the cpus node we can
add interrupt-names and then have software look for interrupts by
name instead of number.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 01/10] mfd: Add TI LMU driver
From: Milo Kim @ 2014-02-18 23:58 UTC (permalink / raw)
To: Lee Jones
Cc: Jingoo Han, Bryan Wu, Mark Brown,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, Samuel Ortiz
In-Reply-To: <20140218082127.GD20218@lee--X1>
Hi Lee,
On 02/18/2014 05:21 PM, Lee Jones wrote:
>>>> + pdata->en_gpio = of_get_named_gpio(node, "ti,enable-gpio", 0);
>>>
>>> There is a global DT property for this already.
>>
>> I've not found it yet, but I agree it looks like general property.
>> So I'll replace "ti,enable-gpio" with "ti,lmu-en-gpio".
>
> Just re-use "gpio-enable". No need for it to be vendor specific.
>
Got it. Thanks!
This GPIO is used for enabling the device. So, "enable-gpio" is more
appropriate name, isn't it?
Best regards,
Milo
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 0/2] Add Ether DT support for R8A7790/Lager reference board
From: Simon Horman @ 2014-02-18 23:52 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: linux-sh, devicetree, magnus.damm, linux, linux-arm-kernel,
robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak
In-Reply-To: <5303EF5C.4090502@cogentembedded.com>
On Wed, Feb 19, 2014 at 02:40:12AM +0300, Sergei Shtylyov wrote:
> Hello.
>
> On 02/13/2014 09:02 AM, Simon Horman wrote:
>
> >> Here's the set of 2 patches against Simon Horman's 'renesas.git' repo,
> >>'renesas-devel-v3.14-rc1-20140206v2' tag. Here we add the Ether device tree
> >>support working on the R8A7790/Lager reference board. The patchset requires the
> >>'sh_eth' driver device tree support posted earlier in order to work.
>
> >>[1/2] ARM: shmobile: r8a7790: add Ether DT support
> >>[2/2] ARM: shmobile: lager: add Ether DT support
>
> >Thanks. Please repost this series once the bindings have been accepted.
>
> DaveM has just merged the bindings into net-next. Time to repost
> these 2 series?
Yes, I think so.
Congratulations on getting the bindings merged.
^ permalink raw reply
* Re: [PATCH 0/2] Add Ether DT support for R8A7790/Lager reference board
From: Sergei Shtylyov @ 2014-02-18 23:40 UTC (permalink / raw)
To: Simon Horman
Cc: linux-sh, devicetree, magnus.damm, linux, linux-arm-kernel,
robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak
In-Reply-To: <20140213060256.GH17183@verge.net.au>
Hello.
On 02/13/2014 09:02 AM, Simon Horman wrote:
>> Here's the set of 2 patches against Simon Horman's 'renesas.git' repo,
>> 'renesas-devel-v3.14-rc1-20140206v2' tag. Here we add the Ether device tree
>> support working on the R8A7790/Lager reference board. The patchset requires the
>> 'sh_eth' driver device tree support posted earlier in order to work.
>> [1/2] ARM: shmobile: r8a7790: add Ether DT support
>> [2/2] ARM: shmobile: lager: add Ether DT support
> Thanks. Please repost this series once the bindings have been accepted.
DaveM has just merged the bindings into net-next. Time to repost these 2
series?
WBR, Sergei
^ permalink raw reply
* Re: [PATCH v2 2/3] usb: chipidea: msm: Add device tree support
From: Sergei Shtylyov @ 2014-02-18 23:32 UTC (permalink / raw)
To: Courtney Cavin
Cc: Ivan T. Ivanov, Peter Chen, Grant Likely, Rob Herring,
Greg Kroah-Hartman, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-msm@vger.kernel.org
In-Reply-To: <20140218213428.GM1706@sonymobile.com>
Hello.
On 02/19/2014 12:34 AM, Courtney Cavin wrote:
>>>>> From: "Ivan T. Ivanov" <iivanov@mm-sol.com>
>>>>> Allows controller to be specified via device tree.
>>>>> Pass PHY phandle specified in DT to core driver.
>>>>> Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
>>>>> ---
>>>>> drivers/usb/chipidea/ci_hdrc_msm.c | 23 ++++++++++++++++++++++-
>>>>> 1 file changed, 22 insertions(+), 1 deletion(-)
>>>> You also need to describe the binding you're creating in
>>>> Documentation/devicetree/bindings/usb/<file>.txt.
>>> Did you check "[PATCH v2 1/3]"?
>> Did you send it to 'linux-usb'? I just didn't get the patch.
>> (Typically, the bindings are described in the same patch the DT support is
>> added to the driver bu YMMV, of course.)
> Although I would personally agree that this is the most logical method,
> it would appear that the DT guys disagree with us [1]. Lately, they
Thank you for the reference.
> seem to have either given up or are otherwise preoccupied, so perhaps
> you can still slip a few patches by them. ;)
Yeah, I was at last able to get my Ethernet driver bindings applied. :-)
> -Courtney
> [1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/submitting-patches.txt
WBR, Sergei
^ permalink raw reply
* Re: [PATCH v4] gpio: Driver for SYSCON-based GPIOs
From: Olof Johansson @ 2014-02-18 23:25 UTC (permalink / raw)
To: Linus Walleij
Cc: Alexander Shiyan, Arnd Bergmann, Kevin Hilman,
linux-gpio@vger.kernel.org, Alexandre Courbot, Rob Herring,
Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
devicetree@vger.kernel.org
In-Reply-To: <CACRpkdaVn0iNFYKE3HXWxnb4iCJorF0HSVG4Uvz8Q18SiF5PUQ@mail.gmail.com>
On Thu, Jan 30, 2014 at 02:54:36PM +0100, Linus Walleij wrote:
> On Mon, Jan 13, 2014 at 5:56 PM, Alexander Shiyan <shc_work@mail.ru> wrote:
>
> > SYSCON driver was designed for using memory areas (registers)
> > that are used in several subsystems. There are systems (CPUs)
> > which use bits in one register for various purposes and thus
> > should be handled by various kernel subsystems. This driver
> > allows you to use the individual SYSCON bits as GPIOs.
> > ARM CLPS711X SYSFLG1 input lines has been added as first user
> > of this driver.
> >
> > Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
>
> Oh the pain. I am so ambivalent of this patch as it obfuscates
> some stuff about the hardware that the driver should know,
> while at the same time being elegant in a way.
>
> What does the ARM SoC maintainers think about this approach?
>
> Arnd, Olof, Kevin: is this something you'd like to see deployed?
I think the binding needs to be adjusted -- syscon has nothing to do with
the binding, that's a Linux construct.
Really, if this is rephrased it becomes much more clear that this is a useful
driver:
CLPS711X implements a few GPIO lines in a register area that is shared with
other system registers. This is a driver for those GPIO lines, implemented
using the shared syscon infrastructure in the kernel.
And then take out syscon from the name of the driver (and the binding).
If we have more drivers like these down the road we can make a common shared
binding, but until then I don't think there's much point in it.
-Olof
^ permalink raw reply
* [PATCH v2 5/5] ARM: dts: add bcm590xx pmu support and enable for bcm28155-ap
From: Matt Porter @ 2014-02-18 23:17 UTC (permalink / raw)
To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
Samuel Ortiz, Lee Jones, Liam Girdwood, Mark Brown,
Christian Daudt
Cc: Devicetree List, Linux ARM Kernel List, Linux Kernel Mailing List,
Tim Kryger
In-Reply-To: <1392765432-9111-1-git-send-email-mporter@linaro.org>
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.kryger@linaro.org>
Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@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 = <400000>;
+ clock-frequency = <100000>;
+
+ pmu: pmu@8 {
+ reg = <0x08>;
+ };
};
sdio1: sdio@3f180000 {
@@ -57,16 +61,22 @@
sdio2: sdio@3f190000 {
non-removable;
max-frequency = <48000000>;
+ vmmc-supply = <&camldo1_reg>;
+ vqmmc-supply = <&iosr1_reg>;
status = "okay";
};
sdio4: sdio@3f1b0000 {
max-frequency = <48000000>;
cd-gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+ vmmc-supply = <&sdldo_reg>;
+ vqmmc-supply = <&sdxldo_reg>;
status = "okay";
};
usbotg: usb@3f120000 {
+ 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 = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ sdldo_reg: regulator@5 {
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3000000>;
+ };
+
+ usbldo_reg: regulator@11 {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-always-on;
+ };
+
+ iosr1_reg: regulator@14 {
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-always-on;
+ };
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/bcm59056.dtsi b/arch/arm/boot/dts/bcm59056.dtsi
new file mode 100644
index 0000000..b04940b
--- /dev/null
+++ b/arch/arm/boot/dts/bcm59056.dtsi
@@ -0,0 +1,162 @@
+/*
+* Copyright 2014 Linaro Limited
+* Author: Matt Porter <mporter@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 = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ camldo1_reg: regulator@1 {
+ reg = <1>;
+ regulator-compatible = "camldo1";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ camldo2_reg: regulator@2 {
+ reg = <2>;
+ regulator-compatible = "camldo2";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ simldo1_reg: regulator@3 {
+ reg = <3>;
+ regulator-compatible = "simldo1";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ simldo2_reg: regulator@4 {
+ reg = <4>;
+ regulator-compatible = "simldo2";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ sdldo_reg: regulator@5 {
+ reg = <5>;
+ regulator-compatible = "sdldo";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ sdxldo_reg: regulator@6 {
+ reg = <6>;
+ regulator-compatible = "sdxldo";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ mmcldo1_reg: regulator@7 {
+ reg = <7>;
+ regulator-compatible = "mmcldo1";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ mmcldo2_reg: regulator@8 {
+ reg = <8>;
+ regulator-compatible = "mmcldo2";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ audldo_reg: regulator@9 {
+ reg = <9>;
+ regulator-compatible = "audldo";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ micldo_reg: regulator@10 {
+ reg = <10>;
+ regulator-compatible = "micldo";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ usbldo_reg: regulator@11 {
+ reg = <11>;
+ regulator-compatible = "usbldo";
+ regulator-min-microvolt = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ vibldo_reg: regulator@12 {
+ reg = <12>;
+ regulator-compatible = "vibldo";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ csr_reg: regulator@13 {
+ reg = <13>;
+ regulator-compatible = "csr";
+ regulator-min-microvolt = <860000>;
+ regulator-max-microvolt = <1440000>;
+ };
+
+ iosr1_reg: regulator@14 {
+ reg = <14>;
+ regulator-compatible = "iosr1";
+ regulator-min-microvolt = <860000>;
+ regulator-max-microvolt = <1800000>;
+ };
+
+ iosr2_reg: regulator@15 {
+ reg = <15>;
+ regulator-compatible = "iosr2";
+ regulator-min-microvolt = <860000>;
+ regulator-max-microvolt = <1800000>;
+ };
+
+ msr_reg: regulator@16 {
+ reg = <16>;
+ regulator-compatible = "msr";
+ regulator-min-microvolt = <860000>;
+ regulator-max-microvolt = <1800000>;
+ };
+
+ sdsr1_reg: regulator@17 {
+ reg = <17>;
+ regulator-compatible = "sdsr1";
+ regulator-min-microvolt = <860000>;
+ regulator-max-microvolt = <1340000>;
+ };
+
+ sdsr2_reg: regulator@18 {
+ reg = <18>;
+ regulator-compatible = "sdsr2";
+ regulator-min-microvolt = <860000>;
+ regulator-max-microvolt = <1800000>;
+ };
+
+ vsr_reg: regulator@19 {
+ reg = <19>;
+ regulator-compatible = "vsr";
+ regulator-min-microvolt = <860000>;
+ regulator-max-microvolt = <1800000>;
+ };
+ };
+ };
+};
--
1.8.4
^ permalink raw reply related
* [PATCH v2 4/5] ARM: configs: bcm_defconfig: enable bcm590xx regulator support
From: Matt Porter @ 2014-02-18 23:17 UTC (permalink / raw)
To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
Samuel Ortiz, Lee Jones, Liam Girdwood, Mark Brown,
Christian Daudt
Cc: Devicetree List, Linux ARM Kernel List, Linux Kernel Mailing List,
Tim Kryger
In-Reply-To: <1392765432-9111-1-git-send-email-mporter@linaro.org>
Enable BCM590xx MFD and regulator drivers to manage voltage
regulators on BCM281xx platforms.
Signed-off-by: Tim Kryger <tim.kryger@linaro.org>
Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@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
^ permalink raw reply related
* [PATCH v2 3/5] regulator: add bcm590xx regulator driver
From: Matt Porter @ 2014-02-18 23:17 UTC (permalink / raw)
To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
Samuel Ortiz, Lee Jones, Liam Girdwood, Mark Brown,
Christian Daudt
Cc: Devicetree List, Linux ARM Kernel List, Linux Kernel Mailing List
In-Reply-To: <1392765432-9111-1-git-send-email-mporter@linaro.org>
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 <mporter@linaro.org>
Reviewed-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@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 0000000..58fcc3a
--- /dev/null
+++ b/drivers/regulator/bcm590xx-regulator.c
@@ -0,0 +1,419 @@
+/*
+ * Broadcom BCM590xx regulator driver
+ *
+ * Copyright 2014 Linaro Limited
+ * Author: Matt Porter <mporter@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_CSRPMCTRL1 0x7e
+#define BCM590XX_SDSR1PMCTRL1 0x82
+#define BCM590XX_SDSR2PMCTRL1 0x86
+#define BCM590XX_MSRPMCTRL1 0x8a
+#define BCM590XX_VSRPMCTRL1 0x8e
+#define BCM590XX_REG_ENABLE BIT(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_SDXLDO 6
+#define BCM590XX_REG_MMCLDO1 7
+#define BCM590XX_REG_MMCLDO2 8
+#define BCM590XX_REG_AUDLDO 9
+#define BCM590XX_REG_MICLDO 10
+#define BCM590XX_REG_USBLDO 11
+#define BCM590XX_REG_VIBLDO 12
+
+/* 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[] = {
+ 1200000, 1800000, 2500000, 2700000, 2800000,
+ 2900000, 3000000, 3300000,
+};
+
+/* LDO group C: supported voltages in microvolts */
+static const unsigned int ldo_c_table[] = {
+ 3100000, 1800000, 2500000, 2700000, 2800000,
+ 2900000, 3000000, 3300000,
+};
+
+/* DCDC group CSR: supported voltages in microvolts */
+static const struct regulator_linear_range dcdc_csr_ranges[] = {
+ REGULATOR_LINEAR_RANGE(860000, 2, 50, 10000),
+ REGULATOR_LINEAR_RANGE(1360000, 51, 55, 20000),
+ REGULATOR_LINEAR_RANGE(900000, 56, 63, 0),
+};
+
+/* DCDC group IOSR1: supported voltages in microvolts */
+static const struct regulator_linear_range dcdc_iosr1_ranges[] = {
+ REGULATOR_LINEAR_RANGE(860000, 2, 51, 10000),
+ REGULATOR_LINEAR_RANGE(1500000, 52, 52, 0),
+ REGULATOR_LINEAR_RANGE(1800000, 53, 53, 0),
+ REGULATOR_LINEAR_RANGE(900000, 54, 63, 0),
+};
+
+/* DCDC group SDSR1: supported voltages in microvolts */
+static const struct regulator_linear_range dcdc_sdsr1_ranges[] = {
+ REGULATOR_LINEAR_RANGE(860000, 2, 50, 10000),
+ REGULATOR_LINEAR_RANGE(1340000, 51, 51, 0),
+ REGULATOR_LINEAR_RANGE(900000, 52, 63, 0),
+};
+
+struct bcm590xx_info {
+ const char *name;
+ const char *vin_name;
+ u8 n_voltages;
+ const unsigned int *volt_table;
+ u8 n_linear_ranges;
+ const struct regulator_linear_range *linear_ranges;
+};
+
+#define BCM590XX_REG_TABLE(_name, _table) \
+ { \
+ .name = #_name, \
+ .n_voltages = ARRAY_SIZE(_table), \
+ .volt_table = _table, \
+ }
+
+#define BCM590XX_REG_RANGES(_name, _ranges) \
+ { \
+ .name = #_name, \
+ .n_linear_ranges = ARRAY_SIZE(_ranges), \
+ .linear_ranges = _ranges, \
+ }
+
+static struct bcm590xx_info bcm590xx_regs[] = {
+ BCM590XX_REG_TABLE(rfldo, ldo_a_table),
+ BCM590XX_REG_TABLE(camldo1, ldo_c_table),
+ BCM590XX_REG_TABLE(camldo2, ldo_c_table),
+ BCM590XX_REG_TABLE(simldo1, ldo_a_table),
+ BCM590XX_REG_TABLE(simldo2, ldo_a_table),
+ BCM590XX_REG_TABLE(sdldo, ldo_c_table),
+ BCM590XX_REG_TABLE(sdxldo, ldo_a_table),
+ BCM590XX_REG_TABLE(mmcldo1, ldo_a_table),
+ BCM590XX_REG_TABLE(mmcldo2, ldo_a_table),
+ BCM590XX_REG_TABLE(audldo, ldo_a_table),
+ BCM590XX_REG_TABLE(micldo, ldo_a_table),
+ BCM590XX_REG_TABLE(usbldo, ldo_a_table),
+ BCM590XX_REG_TABLE(vibldo, ldo_c_table),
+ BCM590XX_REG_RANGES(csr, dcdc_csr_ranges),
+ BCM590XX_REG_RANGES(iosr1, dcdc_iosr1_ranges),
+ BCM590XX_REG_RANGES(iosr2, dcdc_iosr1_ranges),
+ BCM590XX_REG_RANGES(msr, dcdc_iosr1_ranges),
+ BCM590XX_REG_RANGES(sdsr1, dcdc_sdsr1_ranges),
+ BCM590XX_REG_RANGES(sdsr2, dcdc_iosr1_ranges),
+ BCM590XX_REG_RANGES(vsr, dcdc_iosr1_ranges),
+};
+
+struct bcm590xx_reg {
+ struct regulator_desc *desc;
+ struct bcm590xx *mfd;
+ struct regulator_dev **rdev;
+ struct bcm590xx_info **info;
+};
+
+static int bcm590xx_get_vsel_register(int id)
+{
+ if (BCM590XX_REG_IS_LDO(id))
+ return BCM590XX_RFLDOCTRL + id;
+ else
+ return BCM590XX_CSRVOUT1 + (id - BCM590XX_REG_CSR) * 3;
+}
+
+static int bcm590xx_get_enable_register(int id)
+{
+ int reg = 0;
+
+ if (BCM590XX_REG_IS_LDO(id))
+ reg = BCM590XX_RFLDOPMCTRL1 + id * 2;
+ else
+ switch (id) {
+ case BCM590XX_REG_CSR:
+ reg = BCM590XX_CSRPMCTRL1;
+ break;
+ case BCM590XX_REG_IOSR1:
+ reg = BCM590XX_IOSR1PMCTRL1;
+ break;
+ case BCM590XX_REG_IOSR2:
+ reg = BCM590XX_IOSR2PMCTRL1;
+ break;
+ case BCM590XX_REG_MSR:
+ reg = BCM590XX_MSRPMCTRL1;
+ break;
+ case BCM590XX_REG_SDSR1:
+ reg = BCM590XX_SDSR1PMCTRL1;
+ break;
+ case BCM590XX_REG_SDSR2:
+ reg = BCM590XX_SDSR2PMCTRL1;
+ break;
+ };
+
+ return reg;
+}
+
+static struct regulator_ops bcm590xx_ops_ldo = {
+ .is_enabled = regulator_is_enabled_regmap,
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
+ .list_voltage = regulator_list_voltage_table,
+ .map_voltage = regulator_map_voltage_iterate,
+};
+
+static struct regulator_ops bcm590xx_ops_dcdc = {
+ .is_enabled = regulator_is_enabled_regmap,
+ .enable = regulator_enable_regmap,
+ .disable = regulator_disable_regmap,
+ .get_voltage_sel = regulator_get_voltage_sel_regmap,
+ .set_voltage_sel = regulator_set_voltage_sel_regmap,
+ .list_voltage = regulator_list_voltage_linear_range,
+ .map_voltage = regulator_map_voltage_linear_range,
+};
+
+#define BCM590XX_MATCH(_name, _id) \
+ { \
+ .name = #_name, \
+ .driver_data = (void *)&bcm590xx_regs[BCM590XX_REG_##_id], \
+ }
+
+static struct of_regulator_match bcm590xx_matches[] = {
+ BCM590XX_MATCH(rfldo, RFLDO),
+ BCM590XX_MATCH(camldo1, CAMLDO1),
+ BCM590XX_MATCH(camldo2, CAMLDO2),
+ BCM590XX_MATCH(simldo1, SIMLDO1),
+ BCM590XX_MATCH(simldo2, SIMLDO2),
+ BCM590XX_MATCH(sdldo, SDLDO),
+ BCM590XX_MATCH(sdxldo, SDXLDO),
+ BCM590XX_MATCH(mmcldo1, MMCLDO1),
+ BCM590XX_MATCH(mmcldo2, MMCLDO2),
+ BCM590XX_MATCH(audldo, AUDLDO),
+ BCM590XX_MATCH(micldo, MICLDO),
+ BCM590XX_MATCH(usbldo, USBLDO),
+ BCM590XX_MATCH(vibldo, VIBLDO),
+ BCM590XX_MATCH(csr, CSR),
+ BCM590XX_MATCH(iosr1, IOSR1),
+ BCM590XX_MATCH(iosr2, IOSR2),
+ BCM590XX_MATCH(msr, MSR),
+ BCM590XX_MATCH(sdsr1, SDSR1),
+ BCM590XX_MATCH(sdsr2, SDSR2),
+ BCM590XX_MATCH(vsr, VSR),
+};
+
+static struct bcm590xx_board *bcm590xx_parse_dt_reg_data(
+ struct platform_device *pdev,
+ struct of_regulator_match **bcm590xx_reg_matches)
+{
+ struct bcm590xx_board *data;
+ struct device_node *np = pdev->dev.of_node;
+ struct device_node *regulators;
+ struct of_regulator_match *matches = bcm590xx_matches;
+ int count = ARRAY_SIZE(bcm590xx_matches);
+ int idx = 0;
+ int ret;
+
+ if (!np) {
+ dev_err(&pdev->dev, "of node not found\n");
+ return NULL;
+ }
+
+ data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
+ if (!data) {
+ dev_err(&pdev->dev, "failed to allocate regulator board data\n");
+ return NULL;
+ }
+
+ np = of_node_get(np);
+ regulators = of_get_child_by_name(np, "regulators");
+ if (!regulators) {
+ dev_warn(&pdev->dev, "regulator node not found\n");
+ return NULL;
+ }
+
+ ret = of_regulator_match(&pdev->dev, regulators, matches, count);
+ of_node_put(regulators);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "Error parsing regulator init data: %d\n",
+ ret);
+ return NULL;
+ }
+
+ *bcm590xx_reg_matches = matches;
+
+ for (idx = 0; idx < count; idx++) {
+ if (!matches[idx].init_data || !matches[idx].of_node)
+ continue;
+
+ data->bcm590xx_pmu_init_data[idx] = matches[idx].init_data;
+ }
+
+ return data;
+}
+
+static int bcm590xx_probe(struct platform_device *pdev)
+{
+ struct bcm590xx *bcm590xx = dev_get_drvdata(pdev->dev.parent);
+ struct bcm590xx_board *pmu_data = NULL;
+ struct bcm590xx_reg *pmu;
+ struct regulator_config config = { };
+ struct bcm590xx_info *info;
+ struct regulator_init_data *reg_data;
+ struct regulator_dev *rdev;
+ struct of_regulator_match *bcm590xx_reg_matches = NULL;
+ int i;
+
+ pmu_data = bcm590xx_parse_dt_reg_data(pdev,
+ &bcm590xx_reg_matches);
+
+ pmu = devm_kzalloc(&pdev->dev, sizeof(*pmu), GFP_KERNEL);
+ if (!pmu) {
+ dev_err(&pdev->dev, "Memory allocation failed for pmu\n");
+ return -ENOMEM;
+ }
+
+ pmu->mfd = bcm590xx;
+
+ platform_set_drvdata(pdev, pmu);
+
+ pmu->desc = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
+ sizeof(struct regulator_desc), GFP_KERNEL);
+ if (!pmu->desc) {
+ dev_err(&pdev->dev, "Memory alloc fails for desc\n");
+ return -ENOMEM;
+ }
+
+ pmu->info = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
+ sizeof(struct bcm590xx_info *), GFP_KERNEL);
+ if (!pmu->info) {
+ dev_err(&pdev->dev, "Memory alloc fails for info\n");
+ return -ENOMEM;
+ }
+
+ pmu->rdev = devm_kzalloc(&pdev->dev, BCM590XX_NUM_REGS *
+ sizeof(struct regulator_dev *), GFP_KERNEL);
+ if (!pmu->rdev) {
+ dev_err(&pdev->dev, "Memory alloc fails for rdev\n");
+ return -ENOMEM;
+ }
+
+ info = bcm590xx_regs;
+
+ for (i = 0; i < BCM590XX_NUM_REGS; i++, info++) {
+ if (pmu_data)
+ reg_data = pmu_data->bcm590xx_pmu_init_data[i];
+ else
+ reg_data = NULL;
+
+ /* Register the regulators */
+ pmu->info[i] = info;
+
+ pmu->desc[i].name = info->name;
+ pmu->desc[i].supply_name = info->vin_name;
+ pmu->desc[i].id = i;
+ pmu->desc[i].volt_table = info->volt_table;
+ pmu->desc[i].n_voltages = info->n_voltages;
+ pmu->desc[i].linear_ranges = info->linear_ranges;
+ pmu->desc[i].n_linear_ranges = info->n_linear_ranges;
+
+ if (BCM590XX_REG_IS_LDO(i)) {
+ pmu->desc[i].ops = &bcm590xx_ops_ldo;
+ pmu->desc[i].vsel_mask = BCM590XX_LDO_VSEL_MASK;
+ } else {
+ pmu->desc[i].ops = &bcm590xx_ops_dcdc;
+ pmu->desc[i].vsel_mask = BCM590XX_SR_VSEL_MASK;
+ }
+
+ pmu->desc[i].vsel_reg = bcm590xx_get_vsel_register(i);
+ pmu->desc[i].enable_is_inverted = true;
+ pmu->desc[i].enable_mask = BCM590XX_REG_ENABLE;
+ pmu->desc[i].enable_reg = bcm590xx_get_enable_register(i);
+ pmu->desc[i].type = REGULATOR_VOLTAGE;
+ pmu->desc[i].owner = THIS_MODULE;
+
+ config.dev = bcm590xx->dev;
+ config.init_data = reg_data;
+ config.driver_data = pmu;
+ config.regmap = bcm590xx->regmap;
+
+ if (bcm590xx_reg_matches)
+ config.of_node = bcm590xx_reg_matches[i].of_node;
+
+ rdev = devm_regulator_register(&pdev->dev, &pmu->desc[i],
+ &config);
+ if (IS_ERR(rdev)) {
+ dev_err(bcm590xx->dev,
+ "failed to register %s regulator\n",
+ pdev->name);
+ return PTR_ERR(rdev);
+ }
+
+ pmu->rdev[i] = rdev;
+ }
+
+ return 0;
+}
+
+static struct of_device_id bcm590xx_of_match[] = {
+ { .compatible = "brcm,bcm59056-regs", },
+ { }
+};
+
+static struct platform_driver bcm590xx_regulator_driver = {
+ .driver = {
+ .name = "bcm590xx-regs",
+ .of_match_table = bcm590xx_of_match,
+ .owner = THIS_MODULE,
+ },
+ .probe = bcm590xx_probe,
+};
+module_platform_driver(bcm590xx_regulator_driver);
+
+MODULE_AUTHOR("Matt Porter <mporter@linaro.org>");
+MODULE_DESCRIPTION("BCM590xx voltage regulator driver");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:bcm590xx-regulator");
--
1.8.4
^ permalink raw reply related
* [PATCH v2 2/5] mfd: add bcm590xx pmu driver
From: Matt Porter @ 2014-02-18 23:17 UTC (permalink / raw)
To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
Samuel Ortiz, Lee Jones, Liam Girdwood, Mark Brown,
Christian Daudt
Cc: Devicetree List, Linux ARM Kernel List, Linux Kernel Mailing List
In-Reply-To: <1392765432-9111-1-git-send-email-mporter@linaro.org>
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 <mporter@linaro.org>
Reviewed-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@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 0000000..06f6387
--- /dev/null
+++ b/drivers/mfd/bcm590xx.c
@@ -0,0 +1,86 @@
+/*
+ * Broadcom BCM590xx PMU
+ *
+ * Copyright 2014 Linaro Limited
+ * Author: Matt Porter <mporter@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 <mporter@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 0000000..434df2d
--- /dev/null
+++ b/include/linux/mfd/bcm590xx.h
@@ -0,0 +1,31 @@
+/*
+ * Broadcom BCM590xx PMU
+ *
+ * Copyright 2014 Linaro Limited
+ * Author: Matt Porter <mporter@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.
+ *
+ */
+
+#ifndef __LINUX_MFD_BCM590XX_H
+#define __LINUX_MFD_BCM590XX_H
+
+#include <linux/device.h>
+#include <linux/i2c.h>
+#include <linux/regmap.h>
+
+/* max register address */
+#define BCM590XX_MAX_REGISTER 0xe7
+
+struct bcm590xx {
+ struct device *dev;
+ struct i2c_client *i2c_client;
+ struct regmap *regmap;
+ unsigned int id;
+};
+
+#endif /* __LINUX_MFD_BCM590XX_H */
--
1.8.4
^ permalink raw reply related
* [PATCH v2 1/5] mfd: add bcm590xx pmu DT binding
From: Matt Porter @ 2014-02-18 23:17 UTC (permalink / raw)
To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
Samuel Ortiz, Lee Jones, Liam Girdwood, Mark Brown,
Christian Daudt
Cc: Devicetree List, Linux Kernel Mailing List, Linux ARM Kernel List
In-Reply-To: <1392765432-9111-1-git-send-email-mporter@linaro.org>
Add a DT binding for the BCM590xx PMUs. The binding inherits from
the generic regulator bindings.
Signed-off-by: Matt Porter <mporter@linaro.org>
Reviewed-by: Tim Kryger <tim.kryger@linaro.org>
Reviewed-by: Markus Mayer <markus.mayer@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 0000000..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 = <1200000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ ...
+ };
+ };
+ };
--
1.8.4
^ permalink raw reply related
* [PATCH v2 0/5] BCM59056 PMU regulator support
From: Matt Porter @ 2014-02-18 23:17 UTC (permalink / raw)
To: Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala,
Samuel Ortiz, Lee Jones, Liam Girdwood, Mark Brown,
Christian Daudt
Cc: Devicetree List, Linux ARM Kernel List, Linux Kernel Mailing List
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
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox