* Re: [PATCH v4 05/12] clk: qcom: Add MSM8960/APQ8064's HFPLLs
From: Rob Herring @ 2017-12-12 20:36 UTC (permalink / raw)
To: Sricharan R
Cc: mturquette, sboyd, devicetree, linux-pm, linux-arm-msm,
linux-kernel, viresh.kumar, linux-arm-kernel
In-Reply-To: <1512726150-7204-6-git-send-email-sricharan@codeaurora.org>
On Fri, Dec 08, 2017 at 03:12:23PM +0530, Sricharan R wrote:
> From: Stephen Boyd <sboyd@codeaurora.org>
>
> Describe the HFPLLs present on MSM8960 and APQ8064 devices.
>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> drivers/clk/qcom/gcc-msm8960.c | 172 +++++++++++++++++++++++++++
> include/dt-bindings/clock/qcom,gcc-msm8960.h | 2 +
For the binding,
Acked-by: Rob Herring <robh@kernel.org>
> 2 files changed, 174 insertions(+)
^ permalink raw reply
* Re: [PATCHv2 1/3] dt-bindings: net: Add DT bindings for Socionext Netsec
From: Andrew Lunn @ 2017-12-12 20:37 UTC (permalink / raw)
To: jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, devicetree-u79uwXL29TY76Z2rM5mHXA,
davem-fT/PcQaiUtIeIZ0/mPfg9Q,
arnd.bergmann-QSEj5FYQhm4dnm+yROfE0A,
ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
Jassi Brar
In-Reply-To: <1513098921-21042-1-git-send-email-jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On Tue, Dec 12, 2017 at 10:45:21PM +0530, jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:
> From: Jassi Brar <jassisinghbrar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>
> This patch adds documentation for Device-Tree bindings for the
> Socionext NetSec Controller driver.
>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Signed-off-by: Jassi Brar <jaswinder.singh-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
> .../devicetree/bindings/net/socionext-netsec.txt | 43 ++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/net/socionext-netsec.txt
>
> diff --git a/Documentation/devicetree/bindings/net/socionext-netsec.txt b/Documentation/devicetree/bindings/net/socionext-netsec.txt
> new file mode 100644
> index 0000000..4695969
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/socionext-netsec.txt
> @@ -0,0 +1,45 @@
> +* Socionext NetSec Ethernet Controller IP
> +
> +Required properties:
> +- compatible: Should be "socionext,synquacer-netsec"
> +- reg: Address and length of the control register area, followed by the
> + address and length of the EEPROM holding the MAC address and
> + microengine firmware
> +- interrupts: Should contain ethernet controller interrupt
> +- clocks: phandle to the PHY reference clock, and any other clocks to be
> + switched by runtime_pm
> +- clock-names: Required only if more than a single clock is listed in 'clocks'.
> + The PHY reference clock must be named 'phy_refclk'
> +- phy-mode: See ethernet.txt file in the same directory
> +- phy-handle: phandle to select child phy
> +
> +Optional properties: (See ethernet.txt file in the same directory)
> +- dma-coherent: Boolean property, must only be present if memory
> + accesses performed by the device are cache coherent
> +- local-mac-address
> +- mac-address
> +- max-speed
> +- max-frame-size
> +
> +Required properties for the child phy:
> +- reg: phy address
Hi Jassi
Just reference phy.txt
> +
> +Example:
> + eth0: netsec@522D0000 {
> + compatible = "socionext,synquacer-netsec";
> + reg = <0 0x522D0000 0x0 0x10000>, <0 0x10000000 0x0 0x10000>;
> + interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&clk_netsec>;
> + phy-mode = "rgmii";
> + max-speed = <1000>;
> + max-frame-size = <9000>;
> + phy-handle = <ðphy0>;
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
Please add an mdio node here, and list all the phys and possibly
Ethernet switches as children of it.
Andrew
--
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 v4 08/12] clk: qcom: Add KPSS ACC/GCC driver
From: Rob Herring @ 2017-12-12 20:38 UTC (permalink / raw)
To: Sricharan R
Cc: mturquette, sboyd, devicetree, linux-pm, linux-arm-msm,
linux-kernel, viresh.kumar, linux-arm-kernel
In-Reply-To: <1512726150-7204-9-git-send-email-sricharan@codeaurora.org>
On Fri, Dec 08, 2017 at 03:12:26PM +0530, Sricharan R wrote:
> From: Stephen Boyd <sboyd@codeaurora.org>
>
> The ACC and GCC regions present in KPSSv1 contain registers to
> control clocks and power to each Krait CPU and L2. For CPUfreq
> purposes probe these devices and expose a mux clock that chooses
> between PXO and PLL8.
>
> Cc: <devicetree@vger.kernel.org>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> .../devicetree/bindings/arm/msm/qcom,kpss-acc.txt | 7 ++
> .../devicetree/bindings/arm/msm/qcom,kpss-gcc.txt | 28 +++++++
Please make bindings a separate patch.
> drivers/clk/qcom/Kconfig | 8 ++
> drivers/clk/qcom/Makefile | 1 +
> drivers/clk/qcom/kpss-xcc.c | 96 ++++++++++++++++++++++
> 5 files changed, 140 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt
> create mode 100644 drivers/clk/qcom/kpss-xcc.c
>
> diff --git a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
> index 1333db9..382a574 100644
> --- a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
> +++ b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
> @@ -21,10 +21,17 @@ PROPERTIES
> the register region. An optional second element specifies
> the base address and size of the alias register region.
>
> +- clock-output-names:
> + Usage: optional
> + Value type: <string>
> + Definition: Name of the output clock. Typically acpuX_aux where X is a
> + CPU number starting at 0.
> +
> Example:
>
> clock-controller@2088000 {
> compatible = "qcom,kpss-acc-v2";
> reg = <0x02088000 0x1000>,
> <0x02008000 0x1000>;
> + clock-output-names = "acpu0_aux";
> };
> diff --git a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt
> new file mode 100644
> index 0000000..d1e12f1
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt
> @@ -0,0 +1,28 @@
> +Krait Processor Sub-system (KPSS) Global Clock Controller (GCC)
> +
> +PROPERTIES
> +
> +- compatible:
> + Usage: required
> + Value type: <string>
> + Definition: should be one of:
> + "qcom,kpss-gcc"
Only one implementation?
> +
> +- reg:
> + Usage: required
> + Value type: <prop-encoded-array>
> + Definition: base address and size of the register region
> +
> +- clock-output-names:
> + Usage: required
> + Value type: <string>
> + Definition: Name of the output clock. Typically acpu_l2_aux indicating
> + an L2 cache auxiliary clock.
> +
> +Example:
> +
> + l2cc: clock-controller@2011000 {
> + compatible = "qcom,kpss-gcc";
> + reg = <0x2011000 0x1000>;
> + clock-output-names = "acpu_l2_aux";
> + };
^ permalink raw reply
* Re: [PATCHv2 2/3] net: socionext: Add Synquacer NetSec driver
From: Andrew Lunn @ 2017-12-12 20:44 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: Jassi Brar,
<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
David S. Miller, Arnd Bergmann, Rob Herring, Mark Rutland,
Jassi Brar
In-Reply-To: <CAKv+Gu-6gb10VromMaTJkzpu1DovDO7B5-GWEQPs04qAG=2ksw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
> > +static int netsec_register_mdio(struct netsec_priv *priv, u32 phy_addr)
> > +{
> > + struct mii_bus *bus;
> > + int ret;
> > +
> > + bus = devm_mdiobus_alloc(priv->dev);
> > + if (!bus)
> > + return -ENOMEM;
> > +
> > + snprintf(bus->id, MII_BUS_ID_SIZE, "%s", dev_name(priv->dev));
> > + bus->priv = priv;
> > + bus->name = "SNI NETSEC MDIO";
> > + bus->read = netsec_phy_read;
> > + bus->write = netsec_phy_write;
> > + bus->parent = priv->dev;
> > + priv->mii_bus = bus;
> > +
> > + if (dev_of_node(priv->dev)) {
> > + ret = of_mdiobus_register(bus, dev_of_node(priv->dev));
> > + if (ret) {
> > + dev_err(priv->dev, "mdiobus register err(%d)\n", ret);
> > + return ret;
> > + }
> > + } else {
> > + /* Mask out all PHYs from auto probing. */
> > + bus->phy_mask = ~0;
> > + ret = mdiobus_register(bus);
> > + if (ret) {
> > + dev_err(priv->dev, "mdiobus register err(%d)\n", ret);
> > + return ret;
> > + }
> > +
> > + priv->phydev = get_phy_device(priv->mii_bus, phy_addr, false);
> > + if (IS_ERR(priv->phydev)) {
> > + ret = PTR_ERR(priv->phydev);
> > + dev_err(priv->dev, "get_phy_device err(%d)\n", ret);
> > + priv->phydev = NULL;
> > + return -ENODEV;
> > + }
> > +
> > + ret = phy_device_register(priv->phydev);
> > + if (ret)
> > + dev_err(priv->dev,
> > + "phy_device_register err(%d)\n", ret);
You should unregister the mdio bus here.
> > + }
> > +
> > + return ret;
> > +}
Andrew
--
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: [PATCHv2 2/3] net: socionext: Add Synquacer NetSec driver
From: Andrew Lunn @ 2017-12-12 20:48 UTC (permalink / raw)
To: Ard Biesheuvel
Cc: Jassi Brar,
<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
David S. Miller, Arnd Bergmann, Rob Herring, Mark Rutland,
Jassi Brar
In-Reply-To: <CAKv+Gu-6gb10VromMaTJkzpu1DovDO7B5-GWEQPs04qAG=2ksw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
> > +static int netsec_mac_update_to_phy_state(struct netsec_priv *priv)
> > +{
> > + struct phy_device *phydev = priv->ndev->phydev;
> > + u32 value = 0;
> > +
> > + value = phydev->duplex ? NETSEC_GMAC_MCR_REG_FULL_DUPLEX_COMMON :
> > + NETSEC_GMAC_MCR_REG_HALF_DUPLEX_COMMON;
> > +
> > + if (phydev->speed != SPEED_1000)
> > + value |= NETSEC_MCR_PS;
> > +
> > + if (priv->phy_interface != PHY_INTERFACE_MODE_GMII &&
> > + phydev->speed == SPEED_100)
> > + value |= NETSEC_GMAC_MCR_REG_FES;
> > +
> > + value |= NETSEC_GMAC_MCR_REG_CST | NETSEC_GMAC_MCR_REG_JE;
> > +
> > + if (priv->phy_interface == PHY_INTERFACE_MODE_RGMII)
> > + value |= NETSEC_GMAC_MCR_REG_IBN;
phy_interface_mode_is_rgmii() ??
Andrew
--
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 v4 09/12] clk: qcom: Add Krait clock controller driver
From: Rob Herring @ 2017-12-12 20:51 UTC (permalink / raw)
To: Sricharan R
Cc: mturquette, sboyd, devicetree, linux-pm, linux-arm-msm,
linux-kernel, viresh.kumar, linux-arm-kernel
In-Reply-To: <1512726150-7204-10-git-send-email-sricharan@codeaurora.org>
On Fri, Dec 08, 2017 at 03:12:27PM +0530, Sricharan R wrote:
> From: Stephen Boyd <sboyd@codeaurora.org>
>
> The Krait CPU clocks are made up of a primary mux and secondary
> mux for each CPU and the L2, controlled via cp15 accessors. For
> Kraits within KPSSv1 each secondary mux accepts a different aux
> source, but on KPSSv2 each secondary mux accepts the same aux
> source.
>
> Cc: <devicetree@vger.kernel.org>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> .../devicetree/bindings/clock/qcom,krait-cc.txt | 22 ++
Please make bindings a separate patch.
> drivers/clk/qcom/Kconfig | 8 +
> drivers/clk/qcom/Makefile | 1 +
> drivers/clk/qcom/krait-cc.c | 350 +++++++++++++++++++++
> 4 files changed, 381 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/clock/qcom,krait-cc.txt
> create mode 100644 drivers/clk/qcom/krait-cc.c
^ permalink raw reply
* Re: [PATCH v2 1/2] dt: bindings: add new dt entry for ath10k calibration variant
From: Rob Herring @ 2017-12-12 20:53 UTC (permalink / raw)
To: Sven Eckelmann
Cc: ath10k-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA, mark.rutland-5wv7dgnIgG8,
ext.waldemar.rymarkiewicz-++hxYGjEMp0AvxtiuMwx3w,
kvalo-sgV2jX0FEOL9JmXXK+q4OQ
In-Reply-To: <20171208103742.3181-2-sven.eckelmann-lv6y7wLVQPlWk0Htik3J/w@public.gmane.org>
On Fri, Dec 08, 2017 at 11:37:41AM +0100, Sven Eckelmann wrote:
> The bus + bmi-chip-id + bmi-board-id is not enough to identify the correct
> board data file on QCA4019 based devices. Multiple different boards share
> the same values. Only the original reference designs can currently be
> identified and loaded from the board-2.bin. But these will not result in
> the correct calibration data when combined with the pre-calibration data
> from the device.
>
> An additional "variant" information has to be provided (via SMBIOS or DT)
> to select the correct board data for a design which was modified by an ODM.
>
> Signed-off-by: Sven Eckelmann <sven.eckelmann-lv6y7wLVQPlWk0Htik3J/w@public.gmane.org>
> ---
> Documentation/devicetree/bindings/net/wireless/qcom,ath10k.txt | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
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 v3 1/8] SOC: brcmstb: add memory API
From: Jim Quinlan @ 2017-12-12 20:53 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linux-kernel, Bjorn Helgaas, Catalin Marinas, Will Deacon,
Rob Herring, Brian Norris, Russell King, Robin Murphy,
Christoph Hellwig, Florian Fainelli, Jonas Gorski, Mark Rutland,
devicetree, Linux-MIPS, linux-pci, Kevin Cernekee, Ralf Baechle,
bcm-kernel-feedback-list, Gregory Fong, linux-arm-kernel
In-Reply-To: <20171205205926.GJ23510@bhelgaas-glaptop.roam.corp.google.com>
On Tue, Dec 5, 2017 at 3:59 PM, Bjorn Helgaas <helgaas@kernel.org> wrote:
> On Tue, Nov 14, 2017 at 05:12:05PM -0500, Jim Quinlan wrote:
>> From: Florian Fainelli <f.fainelli@gmail.com>
>>
>> This commit adds a memory API suitable for ascertaining the sizes of
>> each of the N memory controllers in a Broadcom STB chip. Its first
>> user will be the Broadcom STB PCIe root complex driver, which needs
>> to know these sizes to properly set up DMA mappings for inbound
>> regions.
>>
>> We cannot use memblock here or anything like what Linux provides
>> because it collapses adjacent regions within a larger block, and here
>> we actually need per-memory controller addresses and sizes, which is
>> why we resort to manual DT parsing.
>>
>> Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
>> ---
>> drivers/soc/bcm/brcmstb/Makefile | 2 +-
>> drivers/soc/bcm/brcmstb/memory.c | 172 +++++++++++++++++++++++++++++++++++++++
>> include/soc/brcmstb/memory_api.h | 25 ++++++
>> 3 files changed, 198 insertions(+), 1 deletion(-)
>> create mode 100644 drivers/soc/bcm/brcmstb/memory.c
>> create mode 100644 include/soc/brcmstb/memory_api.h
>>
>> diff --git a/drivers/soc/bcm/brcmstb/Makefile b/drivers/soc/bcm/brcmstb/Makefile
>> index 9120b27..4cea7b6 100644
>> --- a/drivers/soc/bcm/brcmstb/Makefile
>> +++ b/drivers/soc/bcm/brcmstb/Makefile
>> @@ -1 +1 @@
>> -obj-y += common.o biuctrl.o
>> +obj-y += common.o biuctrl.o memory.o
>> diff --git a/drivers/soc/bcm/brcmstb/memory.c b/drivers/soc/bcm/brcmstb/memory.c
>> new file mode 100644
>> index 0000000..eb647ad9
>> --- /dev/null
>> +++ b/drivers/soc/bcm/brcmstb/memory.c
>
> I sort of assume based on [1] that every new file should have an SPDX
> identifier ("The Linux kernel requires the precise SPDX identifier in
> all source files") and that the actual text of the GPL can be omitted.
>
> Only a few files in drivers/pci currently have an SPDX identifier. I
> don't know if that's oversight or work-in-progress or what.
>
> [1] https://lkml.kernel.org/r/20171204212120.484179273@linutronix.de
>
Bjorn, Did you get a chance to review the other commits of this
submission (V3)? I would like any additional feedback before I send
out a V4 with SPDX fixes. Thanks, JimQ
>> @@ -0,0 +1,172 @@
>> +/*
>> + * Copyright © 2015-2017 Broadcom
>> + *
>> + * 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.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> + * GNU General Public License for more details.
>> + *
>> + * A copy of the GPL is available at
>> + * http://www.broadcom.com/licenses/GPLv2.php or from the Free Software
>> + * Foundation at https://www.gnu.org/licenses/ .
^ permalink raw reply
* Re: [PATCH v2] eeprom: at25: Add DT support for EEPROMs with odd address bits
From: Rob Herring @ 2017-12-12 20:54 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Mark Rutland, Arnd Bergmann, Greg Kroah-Hartman, Ivo Sieben,
Wolfram Sang, devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1512740801-21142-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
On Fri, Dec 08, 2017 at 02:46:41PM +0100, Geert Uytterhoeven wrote:
> Certain EEPROMS have a size that is larger than the number of address
> bytes would allow, and store the MSB of the address in bit 3 of the
> instruction byte.
>
> This can be described in platform data using EE_INSTR_BIT3_IS_ADDR, or
> in DT using the obsolete legacy "at25,addr-mode" property.
> But currently there exists no non-deprecated way to describe this in DT.
>
> Hence extend the existing "address-width" DT property to allow
> specifying 9 address bits, and enable support for that in the driver.
>
> This has been tested with a Microchip 25LC040A.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
> ---
> v2:
> - Do not consider odd address widths of 17 or 25 bits,
> - Move handling inside the switch() statement.
> ---
> Documentation/devicetree/bindings/eeprom/at25.txt | 4 +++-
> drivers/misc/eeprom/at25.c | 3 +++
> 2 files changed, 6 insertions(+), 1 deletion(-)
Reviewed-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
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 v11 2/2] leds: lm3692x: Introduce LM3692x dual string driver
From: Jacek Anaszewski @ 2017-12-12 20:58 UTC (permalink / raw)
To: Dan Murphy, robh+dt, mark.rutland, rpurdie, pavel
Cc: devicetree, linux-kernel, linux-leds
In-Reply-To: <20171212181550.22677-2-dmurphy@ti.com>
Hi Dan,
Thanks for the updated patch set.
I found two minor issues but fixed them by myself
and applied both patches to the for-next branch of
linux-leds.git.
Please refer below and let me know if you have any
objections to my amendments.
On 12/12/2017 07:15 PM, Dan Murphy wrote:
> Introducing the LM3692x Dual-String white LED driver.
>
> Data sheet is located
> http://www.ti.com/lit/ds/snvsa29/snvsa29.pdf
>
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>
> v11 - change DT label case to id->name from np->name - https://patchwork.kernel.org/patch/10107895/
>
> v10 - No changes - https://patchwork.kernel.org/patch/10105651/
> v9 - Change the no DT label case to pull the device name from the i2c_id struct
> so that the device name can be part of the sysfs node - https://patchwork.kernel.org/patch/10093759/
> v8 - No changes
> v7 - Reverted back to creating the LED label within the driver -
> https://patchwork.kernel.org/patch/10087473/
> v6 - Use new LED API to compose LED label as opposed to creating it. -
> https://patchwork.kernel.org/patch/10085565/
> v5 - Added OF dependency in Kconfig, added extra fault flag read to ensure that
> if a fault exists and it is not a artifact, fixed LED class label to be derived
> from either the DT child "label" node or create a label based on
> parent_node_name:led color:trigger, removed ifdef for CONFIG_OF and removed
> of_match_ptr - https://patchwork.kernel.org/patch/10081073/
> v4 - Converted to devm led class register, changed MODULE_LICENSE to GPL v2,
> set the led name based on child node name or label entry, removed fault and
> returned read_buf for fault checking, added mutex_destroy to remove function,
> and removed LED_FULL - https://patchwork.kernel.org/patch/10060109/
> v3 - Add missing Makefile and Kconfig from v1 and v2 - https://patchwork.kernel.org/patch/10060075/
> v2 - Added data sheet link, fixed linuxdoc format, returned on failure in init
> routine, return on fault_check failure, updated brightness calculation and
> fixed capitalization issue - https://patchwork.kernel.org/patch/10056675/
>
> drivers/leds/Kconfig | 7 +
> drivers/leds/Makefile | 1 +
> drivers/leds/leds-lm3692x.c | 393 ++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 401 insertions(+)
> create mode 100644 drivers/leds/leds-lm3692x.c
>
> diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
> index 318a28fd58fe..1d215b39cefd 100644
> --- a/drivers/leds/Kconfig
> +++ b/drivers/leds/Kconfig
> @@ -137,6 +137,13 @@ config LEDS_LM3642
> converter plus 1.5A constant current driver for a high-current
> white LED.
>
> +config LEDS_LM3692X
> + tristate "LED support for LM3692x Chips"
> + depends on LEDS_CLASS && I2C && OF
> + select REGMAP_I2C
> + help
> + This option enables support for the TI LM3692x family
> + of white LED string drivers used for backlighting.
>
> config LEDS_LOCOMO
> tristate "LED Support for Locomo device"
> diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
> index a2a6b5a4f86d..987884a5b9a5 100644
> --- a/drivers/leds/Makefile
> +++ b/drivers/leds/Makefile
> @@ -74,6 +74,7 @@ obj-$(CONFIG_LEDS_PM8058) += leds-pm8058.o
> obj-$(CONFIG_LEDS_MLXCPLD) += leds-mlxcpld.o
> obj-$(CONFIG_LEDS_NIC78BX) += leds-nic78bx.o
> obj-$(CONFIG_LEDS_MT6323) += leds-mt6323.o
> +obj-$(CONFIG_LEDS_LM3692X) += leds-lm3692x.o
>
> # LED SPI Drivers
> obj-$(CONFIG_LEDS_DAC124S085) += leds-dac124s085.o
> diff --git a/drivers/leds/leds-lm3692x.c b/drivers/leds/leds-lm3692x.c
> new file mode 100644
> index 000000000000..bfcffb8b9bd5
> --- /dev/null
> +++ b/drivers/leds/leds-lm3692x.c
> @@ -0,0 +1,393 @@
> +/*
> + * TI lm3692x LED Driver
> + *
> + * Copyright (C) 2017 Texas Instruments
> + *
> + * Author: Dan Murphy <dmurphy@ti.com>
> + *
> + * 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.
> + *
> + * Data sheet is located
> + * http://www.ti.com/lit/ds/snvsa29/snvsa29.pdf
> + */
> +
> +#include <linux/i2c.h>
> +#include <linux/init.h>
> +#include <linux/leds.h>
> +#include <linux/regmap.h>
> +#include <linux/regulator/consumer.h>
> +#include <linux/module.h>
> +#include <linux/mutex.h>
> +#include <linux/of.h>
> +#include <linux/of_gpio.h>
> +#include <linux/gpio/consumer.h>
> +#include <linux/slab.h>
> +#include <uapi/linux/uleds.h>
Sorted includes lexicographically.
> +#define LM3692X_REV 0x0
> +#define LM3692X_RESET 0x1
> +#define LM3692X_EN 0x10
> +#define LM3692X_BRT_CTRL 0x11
> +#define LM3692X_PWM_CTRL 0x12
> +#define LM3692X_BOOST_CTRL 0x13
> +#define LM3692X_AUTO_FREQ_HI 0x15
> +#define LM3692X_AUTO_FREQ_LO 0x16
> +#define LM3692X_BL_ADJ_THRESH 0x17
> +#define LM3692X_BRT_LSB 0x18
> +#define LM3692X_BRT_MSB 0x19
> +#define LM3692X_FAULT_CTRL 0x1e
> +#define LM3692X_FAULT_FLAGS 0x1f
> +
> +#define LM3692X_SW_RESET BIT(0)
> +#define LM3692X_DEVICE_EN BIT(0)
> +#define LM3692X_LED1_EN BIT(1)
> +#define LM3692X_LED2_EN BIT(2)
> +
> +/* Brightness Control Bits */
> +#define LM3692X_BL_ADJ_POL BIT(0)
> +#define LM3692X_RAMP_RATE_125us 0x00
> +#define LM3692X_RAMP_RATE_250us BIT(1)
> +#define LM3692X_RAMP_RATE_500us BIT(2)
> +#define LM3692X_RAMP_RATE_1ms (BIT(1) | BIT(2))
> +#define LM3692X_RAMP_RATE_2ms BIT(3)
> +#define LM3692X_RAMP_RATE_4ms (BIT(3) | BIT(1))
> +#define LM3692X_RAMP_RATE_8ms (BIT(2) | BIT(3))
> +#define LM3692X_RAMP_RATE_16ms (BIT(1) | BIT(2) | BIT(3))
> +#define LM3692X_RAMP_EN BIT(4)
> +#define LM3692X_BRHT_MODE_REG 0x00
> +#define LM3692X_BRHT_MODE_PWM BIT(5)
> +#define LM3692X_BRHT_MODE_MULTI_RAMP BIT(6)
> +#define LM3692X_BRHT_MODE_RAMP_MULTI (BIT(5) | BIT(6))
> +#define LM3692X_MAP_MODE_EXP BIT(7)
> +
> +/* PWM Register Bits */
> +#define LM3692X_PWM_FILTER_100 BIT(0)
> +#define LM3692X_PWM_FILTER_150 BIT(1)
> +#define LM3692X_PWM_FILTER_200 (BIT(0) | BIT(1))
> +#define LM3692X_PWM_HYSTER_1LSB BIT(2)
> +#define LM3692X_PWM_HYSTER_2LSB BIT(3)
> +#define LM3692X_PWM_HYSTER_3LSB (BIT(3) | BIT(2))
> +#define LM3692X_PWM_HYSTER_4LSB BIT(4)
> +#define LM3692X_PWM_HYSTER_5LSB (BIT(4) | BIT(2))
> +#define LM3692X_PWM_HYSTER_6LSB (BIT(4) | BIT(3))
> +#define LM3692X_PWM_POLARITY BIT(5)
> +#define LM3692X_PWM_SAMP_4MHZ BIT(6)
> +#define LM3692X_PWM_SAMP_24MHZ BIT(7)
> +
> +/* Boost Control Bits */
> +#define LM3692X_OCP_PROT_1A BIT(0)
> +#define LM3692X_OCP_PROT_1_25A BIT(1)
> +#define LM3692X_OCP_PROT_1_5A (BIT(0) | BIT(1))
> +#define LM3692X_OVP_21V BIT(2)
> +#define LM3692X_OVP_25V BIT(3)
> +#define LM3692X_OVP_29V (BIT(2) | BIT(3))
> +#define LM3692X_MIN_IND_22UH BIT(4)
> +#define LM3692X_BOOST_SW_1MHZ BIT(5)
> +#define LM3692X_BOOST_SW_NO_SHIFT BIT(6)
> +
> +/* Fault Control Bits */
> +#define LM3692X_FAULT_CTRL_OVP BIT(0)
> +#define LM3692X_FAULT_CTRL_OCP BIT(1)
> +#define LM3692X_FAULT_CTRL_TSD BIT(2)
> +#define LM3692X_FAULT_CTRL_OPEN BIT(3)
> +
> +/* Fault Flag Bits */
> +#define LM3692X_FAULT_FLAG_OVP BIT(0)
> +#define LM3692X_FAULT_FLAG_OCP BIT(1)
> +#define LM3692X_FAULT_FLAG_TSD BIT(2)
> +#define LM3692X_FAULT_FLAG_SHRT BIT(3)
> +#define LM3692X_FAULT_FLAG_OPEN BIT(4)
> +
> +/**
> + * struct lm3692x_led -
> + * @lock - Lock for reading/writing the device
> + * @client - Pointer to the I2C client
> + * @led_dev - LED class device pointer
> + * @regmap - Devices register map
> + * @enable_gpio - VDDIO/EN gpio to enable communication interface
> + * @regulator - LED supply regulator pointer
> + * @label - LED label
> + */
> +struct lm3692x_led {
> + struct mutex lock;
> + struct i2c_client *client;
> + struct led_classdev led_dev;
> + struct regmap *regmap;
> + struct gpio_desc *enable_gpio;
> + struct regulator *regulator;
> + char label[LED_MAX_NAME_SIZE];
> +};
> +
> +static const struct reg_default lm3692x_reg_defs[] = {
> + {LM3692X_EN, 0xf},
> + {LM3692X_BRT_CTRL, 0x61},
> + {LM3692X_PWM_CTRL, 0x73},
> + {LM3692X_BOOST_CTRL, 0x6f},
> + {LM3692X_AUTO_FREQ_HI, 0x0},
> + {LM3692X_AUTO_FREQ_LO, 0x0},
> + {LM3692X_BL_ADJ_THRESH, 0x0},
> + {LM3692X_BRT_LSB, 0x7},
> + {LM3692X_BRT_MSB, 0xff},
> + {LM3692X_FAULT_CTRL, 0x7},
> +};
> +
> +static const struct regmap_config lm3692x_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
> +
> + .max_register = LM3692X_FAULT_FLAGS,
> + .reg_defaults = lm3692x_reg_defs,
> + .num_reg_defaults = ARRAY_SIZE(lm3692x_reg_defs),
> + .cache_type = REGCACHE_RBTREE,
> +};
> +
> +static int lm3692x_fault_check(struct lm3692x_led *led)
> +{
> + int ret;
> + unsigned int read_buf;
> +
> + ret = regmap_read(led->regmap, LM3692X_FAULT_FLAGS, &read_buf);
> + if (ret)
> + return ret;
> +
> + if (read_buf)
> + dev_err(&led->client->dev, "Detected a fault 0x%X\n", read_buf);
> +
> + /* The first read may clear the fault. Check again to see if the fault
> + * still exits and return that value.
> + */
> + regmap_read(led->regmap, LM3692X_FAULT_FLAGS, &read_buf);
> + if (read_buf)
> + dev_err(&led->client->dev, "Second read of fault flags 0x%X\n",
> + read_buf);
> +
> + return read_buf;
> +}
> +
> +static int lm3692x_brightness_set(struct led_classdev *led_cdev,
> + enum led_brightness brt_val)
> +{
> + struct lm3692x_led *led =
> + container_of(led_cdev, struct lm3692x_led, led_dev);
> + int ret;
> + int led_brightness_lsb = (brt_val >> 5);
> +
> + mutex_lock(&led->lock);
> +
> + ret = lm3692x_fault_check(led);
> + if (ret) {
> + dev_err(&led->client->dev, "Cannot read/clear faults\n");
> + goto out;
> + }
> +
> + ret = regmap_write(led->regmap, LM3692X_BRT_MSB, brt_val);
> + if (ret) {
> + dev_err(&led->client->dev, "Cannot write MSB\n");
> + goto out;
> + }
> +
> + ret = regmap_write(led->regmap, LM3692X_BRT_LSB, led_brightness_lsb);
> + if (ret) {
> + dev_err(&led->client->dev, "Cannot write LSB\n");
> + goto out;
> + }
> +out:
> + mutex_unlock(&led->lock);
> + return ret;
> +}
> +
> +static int lm3692x_init(struct lm3692x_led *led)
> +{
> + int ret;
> +
> + if (led->regulator) {
> + ret = regulator_enable(led->regulator);
> + if (ret) {
> + dev_err(&led->client->dev,
> + "Failed to enable regulator\n");
> + return ret;
> + }
> + }
> +
> + if (led->enable_gpio)
> + gpiod_direction_output(led->enable_gpio, 1);
> +
> + ret = lm3692x_fault_check(led);
> + if (ret) {
> + dev_err(&led->client->dev, "Cannot read/clear faults\n");
> + goto out;
> + }
> +
> + ret = regmap_write(led->regmap, LM3692X_BRT_CTRL, 0x00);
> + if (ret)
> + goto out;
> +
> + /*
> + * For glitch free operation, the following data should
> + * only be written while device enable bit is 0
> + * per Section 7.5.14 of the data sheet
> + */
> + ret = regmap_write(led->regmap, LM3692X_PWM_CTRL,
> + LM3692X_PWM_FILTER_100 | LM3692X_PWM_SAMP_24MHZ);
> + if (ret)
> + goto out;
> +
> + ret = regmap_write(led->regmap, LM3692X_BOOST_CTRL,
> + LM3692X_BRHT_MODE_RAMP_MULTI |
> + LM3692X_BL_ADJ_POL |
> + LM3692X_RAMP_RATE_250us);
> + if (ret)
> + goto out;
> +
> + ret = regmap_write(led->regmap, LM3692X_AUTO_FREQ_HI, 0x00);
> + if (ret)
> + goto out;
> +
> + ret = regmap_write(led->regmap, LM3692X_AUTO_FREQ_LO, 0x00);
> + if (ret)
> + goto out;
> +
> + ret = regmap_write(led->regmap, LM3692X_BL_ADJ_THRESH, 0x00);
> + if (ret)
> + goto out;
> +
> + ret = regmap_write(led->regmap, LM3692X_BRT_CTRL,
> + LM3692X_BL_ADJ_POL | LM3692X_PWM_HYSTER_4LSB);
> + if (ret)
> + goto out;
> +
> + return ret;
> +out:
> + dev_err(&led->client->dev, "Fail writing initialization values\n");
> +
> + if (led->enable_gpio)
> + gpiod_direction_output(led->enable_gpio, 0);
> +
> + if (led->regulator) {
> + ret = regulator_disable(led->regulator);
> + if (ret)
> + dev_err(&led->client->dev,
> + "Failed to disable regulator\n");
> + }
> +
> + return ret;
> +}
> +
> +static int lm3692x_probe(struct i2c_client *client,
> + const struct i2c_device_id *id)
> +{
> + int ret;
> + struct lm3692x_led *led;
> + struct device_node *np = client->dev.of_node;
> + struct device_node *child_node;
> + const char *name;
> +
> + led = devm_kzalloc(&client->dev, sizeof(*led), GFP_KERNEL);
> + if (!led)
> + return -ENOMEM;
> +
> + for_each_available_child_of_node(np, child_node) {
> + led->led_dev.default_trigger = of_get_property(child_node,
> + "linux,default-trigger",
> + NULL);
> +
> + ret = of_property_read_string(child_node, "label", &name);
> + if (!ret)
> + snprintf(led->label, sizeof(led->label), "%s:%s",
> + id->name, name);
> + else
> + snprintf(led->label, sizeof(led->label),
> + "%s::backlight_cluster", id->name);
checpatch.pl complains here about indentation:
WARNING: suspect code indent for conditional statements (16, 20)
#351: FILE: drivers/leds/leds-lm3692x.c:297:
+ if (!ret)
+ snprintf(led->label, sizeof(led->label), "%s:%s",
WARNING: suspect code indent for conditional statements (16, 20)
#354: FILE: drivers/leds/leds-lm3692x.c:300:
+ else
+ snprintf(led->label, sizeof(led->label),
Reformatted it as follows:
if (!ret)
snprintf(led->label, sizeof(led->label),
"%s:%s", id->name, name);
else
snprintf(led->label, sizeof(led->label),
"%s::backlight_cluster", id->name);
> + };
> +
> + led->enable_gpio = devm_gpiod_get_optional(&client->dev,
> + "enable", GPIOD_OUT_LOW);
> + if (IS_ERR(led->enable_gpio)) {
> + ret = PTR_ERR(led->enable_gpio);
> + dev_err(&client->dev, "Failed to get enable gpio: %d\n", ret);
> + return ret;
> + }
> +
> + led->regulator = devm_regulator_get(&client->dev, "vled");
> + if (IS_ERR(led->regulator))
> + led->regulator = NULL;
> +
> + led->client = client;
> + led->led_dev.name = led->label;
> + led->led_dev.brightness_set_blocking = lm3692x_brightness_set;
> +
> + mutex_init(&led->lock);
> +
> + i2c_set_clientdata(client, led);
> +
> + led->regmap = devm_regmap_init_i2c(client, &lm3692x_regmap_config);
> + if (IS_ERR(led->regmap)) {
> + ret = PTR_ERR(led->regmap);
> + dev_err(&client->dev, "Failed to allocate register map: %d\n",
> + ret);
> + return ret;
> + }
> +
> + ret = lm3692x_init(led);
> + if (ret)
> + return ret;
> +
> + ret = devm_led_classdev_register(&client->dev, &led->led_dev);
> + if (ret) {
> + dev_err(&client->dev, "led register err: %d\n", ret);
> + return ret;
> + }
> +
> + return 0;
> +}
> +
> +static int lm3692x_remove(struct i2c_client *client)
> +{
> + struct lm3692x_led *led = i2c_get_clientdata(client);
> + int ret;
> +
> + if (led->enable_gpio)
> + gpiod_direction_output(led->enable_gpio, 0);
> +
> + if (led->regulator) {
> + ret = regulator_disable(led->regulator);
> + if (ret)
> + dev_err(&led->client->dev,
> + "Failed to disable regulator\n");
> + }
> +
> + mutex_destroy(&led->lock);
> +
> + return 0;
> +}
> +
> +static const struct i2c_device_id lm3692x_id[] = {
> + { "lm36922", 0 },
> + { "lm36923", 1 },
> + { }
> +};
> +MODULE_DEVICE_TABLE(i2c, lm3692x_id);
> +
> +static const struct of_device_id of_lm3692x_leds_match[] = {
> + { .compatible = "ti,lm36922", },
> + { .compatible = "ti,lm36923", },
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, of_lm3692x_leds_match);
> +
> +static struct i2c_driver lm3692x_driver = {
> + .driver = {
> + .name = "lm3692x",
> + .of_match_table = of_lm3692x_leds_match,
> + },
> + .probe = lm3692x_probe,
> + .remove = lm3692x_remove,
> + .id_table = lm3692x_id,
> +};
> +module_i2c_driver(lm3692x_driver);
> +
> +MODULE_DESCRIPTION("Texas Instruments LM3692X LED driver");
> +MODULE_AUTHOR("Dan Murphy <dmurphy@ti.com>");
> +MODULE_LICENSE("GPL v2");
>
--
Best regards,
Jacek Anaszewski
^ permalink raw reply
* Re: [PATCH 1/1] dt-bindings: arm: document supported STM32 SoC family
From: Rob Herring @ 2017-12-12 21:03 UTC (permalink / raw)
To: Ludovic Barre
Cc: Mark Rutland, Maxime Coquelin, Alexandre Torgue,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Gwenael Treuveur
In-Reply-To: <1512741394-27341-1-git-send-email-ludovic.Barre-qxv4g6HH51o@public.gmane.org>
On Fri, Dec 08, 2017 at 02:56:34PM +0100, Ludovic Barre wrote:
> From: Ludovic Barre <ludovic.barre-qxv4g6HH51o@public.gmane.org>
>
> This adds a list of supported STM32 SoC bindings.
>
> Signed-off-by: Gwenael Treuveur <gwenael.treuveur-qxv4g6HH51o@public.gmane.org>
> Signed-off-by: Ludovic Barre <ludovic.barre-qxv4g6HH51o@public.gmane.org>
> ---
> Documentation/devicetree/bindings/arm/stm32.txt | 9 +++++++++
> 1 file changed, 9 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/arm/stm32.txt
Applied, thanks.
Rob
--
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 v3 3/6] leds: lp8860: Update the dt parsing for LED labeling
From: Jacek Anaszewski @ 2017-12-12 21:13 UTC (permalink / raw)
To: Dan Murphy, robh+dt, mark.rutland, rpurdie, pavel
Cc: devicetree, linux-kernel, linux-leds
In-Reply-To: <20171212185809.23880-5-dmurphy@ti.com>
Hi Dan,
Thanks for the patch set.
On 12/12/2017 07:58 PM, Dan Murphy wrote:
> Update the DT parsing for the label node so that
> the label is retrieved from the device child as
> opposed to being part of the parent.
>
> This will align this driver with the LED
> binding documentation
>
> Documentation/devicetree/bindings/leds/common.txt
>
> Signed-off-by: Dan Murphy <dmurphy@ti.com>
> ---
>
> v3 - Changed the label generation to pull the name from the i2c device id
> as opposed to pulling the id from the parent dt node since that will just be
> led-controller - https://patchwork.kernel.org/patch/10093753/
>
> v2 - no changes
>
> drivers/leds/leds-lp8860.c | 23 ++++++++++++-----------
> 1 file changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c
> index 3e70775a2d54..bc432764c99d 100644
> --- a/drivers/leds/leds-lp8860.c
> +++ b/drivers/leds/leds-lp8860.c
> @@ -22,6 +22,7 @@
> #include <linux/of_gpio.h>
> #include <linux/gpio/consumer.h>
> #include <linux/slab.h>
> +#include <uapi/linux/uleds.h>
>
> #define LP8860_DISP_CL1_BRT_MSB 0x00
> #define LP8860_DISP_CL1_BRT_LSB 0x01
> @@ -86,8 +87,6 @@
>
> #define LP8860_CLEAR_FAULTS 0x01
>
> -#define LP8860_DISP_LED_NAME "display_cluster"
> -
> /**
> * struct lp8860_led -
> * @lock - Lock for reading/writing the device
> @@ -107,7 +106,7 @@ struct lp8860_led {
> struct regmap *eeprom_regmap;
> struct gpio_desc *enable_gpio;
> struct regulator *regulator;
> - const char *label;
> + char label[LED_MAX_NAME_SIZE];
> };
>
> struct lp8860_eeprom_reg {
> @@ -365,19 +364,21 @@ static int lp8860_probe(struct i2c_client *client,
> int ret;
> struct lp8860_led *led;
> struct device_node *np = client->dev.of_node;
> + struct device_node *child_node;
> + const char *name;
>
> led = devm_kzalloc(&client->dev, sizeof(*led), GFP_KERNEL);
> if (!led)
> return -ENOMEM;
>
> - led->label = LP8860_DISP_LED_NAME;
> -
> - if (client->dev.of_node) {
> - ret = of_property_read_string(np, "label", &led->label);
> - if (ret) {
> - dev_err(&client->dev, "Missing label in dt\n");
> - return -EINVAL;
> - }
> + for_each_available_child_of_node(np, child_node) {
> + ret = of_property_read_string(child_node, "label", &name);
> + if (!ret)
> + snprintf(led->label, sizeof(led->label), "%s:%s",
> + id->name, name);
> + else
> + snprintf(led->label, sizeof(led->label),
> + "%s::display_cluster", id->name);
Here we have the same indentation problem as in case of leds-lm3692x.c
> }
>
> led->enable_gpio = devm_gpiod_get_optional(&client->dev,
>
--
Best regards,
Jacek Anaszewski
^ permalink raw reply
* Re: [PATCH v3 1/8] SOC: brcmstb: add memory API
From: Bjorn Helgaas @ 2017-12-12 21:14 UTC (permalink / raw)
To: Jim Quinlan
Cc: linux-kernel, Bjorn Helgaas, Catalin Marinas, Will Deacon,
Rob Herring, Brian Norris, Russell King, Robin Murphy,
Christoph Hellwig, Florian Fainelli, Jonas Gorski, Mark Rutland,
devicetree, Linux-MIPS, linux-pci, Kevin Cernekee, Ralf Baechle,
bcm-kernel-feedback-list, Gregory Fong, linux-arm-kernel
In-Reply-To: <CANCKTBvoXpF-H8Pck5TsH+7tNM=di1-uoedqACE+kjNEAUodYg@mail.gmail.com>
[+cc Lorenzo]
On Tue, Dec 12, 2017 at 03:53:28PM -0500, Jim Quinlan wrote:
> On Tue, Dec 5, 2017 at 3:59 PM, Bjorn Helgaas <helgaas@kernel.org> wrote:
> > On Tue, Nov 14, 2017 at 05:12:05PM -0500, Jim Quinlan wrote:
> >> From: Florian Fainelli <f.fainelli@gmail.com>
> >>
> >> This commit adds a memory API suitable for ascertaining the sizes of
> >> each of the N memory controllers in a Broadcom STB chip. Its first
> >> user will be the Broadcom STB PCIe root complex driver, which needs
> >> to know these sizes to properly set up DMA mappings for inbound
> >> regions.
> >>
> >> We cannot use memblock here or anything like what Linux provides
> >> because it collapses adjacent regions within a larger block, and here
> >> we actually need per-memory controller addresses and sizes, which is
> >> why we resort to manual DT parsing.
> >>
> >> Signed-off-by: Jim Quinlan <jim2101024@gmail.com>
> >> ---
> >> drivers/soc/bcm/brcmstb/Makefile | 2 +-
> >> drivers/soc/bcm/brcmstb/memory.c | 172 +++++++++++++++++++++++++++++++++++++++
> >> include/soc/brcmstb/memory_api.h | 25 ++++++
> >> 3 files changed, 198 insertions(+), 1 deletion(-)
> >> create mode 100644 drivers/soc/bcm/brcmstb/memory.c
> >> create mode 100644 include/soc/brcmstb/memory_api.h
> >>
> >> diff --git a/drivers/soc/bcm/brcmstb/Makefile b/drivers/soc/bcm/brcmstb/Makefile
> >> index 9120b27..4cea7b6 100644
> >> --- a/drivers/soc/bcm/brcmstb/Makefile
> >> +++ b/drivers/soc/bcm/brcmstb/Makefile
> >> @@ -1 +1 @@
> >> -obj-y += common.o biuctrl.o
> >> +obj-y += common.o biuctrl.o memory.o
> >> diff --git a/drivers/soc/bcm/brcmstb/memory.c b/drivers/soc/bcm/brcmstb/memory.c
> >> new file mode 100644
> >> index 0000000..eb647ad9
> >> --- /dev/null
> >> +++ b/drivers/soc/bcm/brcmstb/memory.c
> >
> > I sort of assume based on [1] that every new file should have an SPDX
> > identifier ("The Linux kernel requires the precise SPDX identifier in
> > all source files") and that the actual text of the GPL can be omitted.
> >
> > Only a few files in drivers/pci currently have an SPDX identifier. I
> > don't know if that's oversight or work-in-progress or what.
> >
> > [1] https://lkml.kernel.org/r/20171204212120.484179273@linutronix.de
> >
>
> Bjorn, Did you get a chance to review the other commits of this
> submission (V3)? I would like any additional feedback before I send
> out a V4 with SPDX fixes. Thanks, JimQ
Lorenzo is taking over drivers/pci/host/* and he'll no doubt have some
comments when he gets to this. I'll point out a few quick formatting
things in the meantime.
> >> @@ -0,0 +1,172 @@
> >> +/*
> >> + * Copyright © 2015-2017 Broadcom
> >> + *
> >> + * 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.
> >> + *
> >> + * This program is distributed in the hope that it will be useful,
> >> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> >> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> >> + * GNU General Public License for more details.
> >> + *
> >> + * A copy of the GPL is available at
> >> + * http://www.broadcom.com/licenses/GPLv2.php or from the Free Software
> >> + * Foundation at https://www.gnu.org/licenses/ .
^ permalink raw reply
* Re: [linux-sunxi] [PATCH v2 3/6] ARM: sun4i: Convert to CCU
From: Kevin Hilman @ 2017-12-12 21:24 UTC (permalink / raw)
To: Priit Laes, Chen-Yu Tsai, Maxime Ripard
Cc: lkml, linux-arm-kernel, devicetree, linux-clk, linux-sunxi,
Icenowy Zheng, Russell King, Mark Rutland, Rob Herring,
Stephen Boyd, Michael Turquette, Philipp Zabel, Olof Johansson
In-Reply-To: <20171212172635.2utwz3koyo5iwglt@plaes.org>
On Tue, Dec 12, 2017 at 9:26 AM, Priit Laes <plaes@plaes.org> wrote:
> On Mon, Dec 11, 2017 at 02:22:30PM -0800, Kevin Hilman wrote:
>> On Sun, Mar 26, 2017 at 10:20 AM, Priit Laes <plaes@plaes.org> wrote:
>> > Convert sun4i-a10.dtsi to new CCU driver.
>> >
>> > Signed-off-by: Priit Laes <plaes@plaes.org>
>>
>> I finally got around to bisecting a mainline boot failure on
>> sun4i-a10-cubieboard that's been happening for quite a while. Based
>> on on kernelci.org, it showed up sometime during the v4.15 merge
>> window[1]. It bisected down to this commit (in mainline as commit
>> 41193869f2bdb585ce09bfdd16d9482aadd560ad).
>>
>> When it fails, there is no output on the serial console, so I don't
>> know exactly how it's failing, just that it no longer boots.
>
> We tried out latest 4.15 with various compilers and it works:
> - gcc version 7.1.1 20170622 (Red Hat Cross 7.1.1-3) (GCC) - A10 Gemei G9 tablet
> - gcc 7.2.0-debian - A10 Cubieboard
And you can reproduce the bug with gcc5 or gcc6?
Very strange that a DT only patch would cause a gcc related regression
and if it does, it should be investigated. I don't think requiring
gcc7 is an appropriate solution.
@Chen-Yu, @Maxime: are you guys OK with requiring gcc7 for working
upstream boot for A10?
Kevin
^ permalink raw reply
* Re: [PATCH v3 3/6] leds: lp8860: Update the dt parsing for LED labeling
From: Dan Murphy @ 2017-12-12 21:27 UTC (permalink / raw)
To: Jacek Anaszewski, robh+dt, mark.rutland, rpurdie, pavel
Cc: devicetree, linux-kernel, linux-leds
In-Reply-To: <f191482b-65a0-1520-8d72-d7626ca1b0b6@gmail.com>
Jacek
On 12/12/2017 03:13 PM, Jacek Anaszewski wrote:
> Hi Dan,
>
> Thanks for the patch set.
>
> On 12/12/2017 07:58 PM, Dan Murphy wrote:
>> Update the DT parsing for the label node so that
>> the label is retrieved from the device child as
>> opposed to being part of the parent.
>>
>> This will align this driver with the LED
>> binding documentation
>>
>> Documentation/devicetree/bindings/leds/common.txt
>>
>> Signed-off-by: Dan Murphy <dmurphy@ti.com>
>> ---
>>
>> v3 - Changed the label generation to pull the name from the i2c device id
>> as opposed to pulling the id from the parent dt node since that will just be
>> led-controller - https://patchwork.kernel.org/patch/10093753/
>>
>> v2 - no changes
>>
>> drivers/leds/leds-lp8860.c | 23 ++++++++++++-----------
>> 1 file changed, 12 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c
>> index 3e70775a2d54..bc432764c99d 100644
>> --- a/drivers/leds/leds-lp8860.c
>> +++ b/drivers/leds/leds-lp8860.c
>> @@ -22,6 +22,7 @@
>> #include <linux/of_gpio.h>
>> #include <linux/gpio/consumer.h>
>> #include <linux/slab.h>
>> +#include <uapi/linux/uleds.h>
>>
>> #define LP8860_DISP_CL1_BRT_MSB 0x00
>> #define LP8860_DISP_CL1_BRT_LSB 0x01
>> @@ -86,8 +87,6 @@
>>
>> #define LP8860_CLEAR_FAULTS 0x01
>>
>> -#define LP8860_DISP_LED_NAME "display_cluster"
>> -
>> /**
>> * struct lp8860_led -
>> * @lock - Lock for reading/writing the device
>> @@ -107,7 +106,7 @@ struct lp8860_led {
>> struct regmap *eeprom_regmap;
>> struct gpio_desc *enable_gpio;
>> struct regulator *regulator;
>> - const char *label;
>> + char label[LED_MAX_NAME_SIZE];
>> };
>>
>> struct lp8860_eeprom_reg {
>> @@ -365,19 +364,21 @@ static int lp8860_probe(struct i2c_client *client,
>> int ret;
>> struct lp8860_led *led;
>> struct device_node *np = client->dev.of_node;
>> + struct device_node *child_node;
>> + const char *name;
>>
>> led = devm_kzalloc(&client->dev, sizeof(*led), GFP_KERNEL);
>> if (!led)
>> return -ENOMEM;
>>
>> - led->label = LP8860_DISP_LED_NAME;
>> -
>> - if (client->dev.of_node) {
>> - ret = of_property_read_string(np, "label", &led->label);
>> - if (ret) {
>> - dev_err(&client->dev, "Missing label in dt\n");
>> - return -EINVAL;
>> - }
>> + for_each_available_child_of_node(np, child_node) {
>> + ret = of_property_read_string(child_node, "label", &name);
>> + if (!ret)
>> + snprintf(led->label, sizeof(led->label), "%s:%s",
>> + id->name, name);
>> + else
>> + snprintf(led->label, sizeof(led->label),
>> + "%s::display_cluster", id->name);
>
> Here we have the same indentation problem as in case of leds-lm3692x.c
I will fix it up and re-send.
Dan
>
>> }
>>
>> led->enable_gpio = devm_gpiod_get_optional(&client->dev,
>>
>
--
------------------
Dan Murphy
^ permalink raw reply
* [PATCH] leds: as3645a: Fix checkpatch warnings
From: Dan Murphy @ 2017-12-12 21:50 UTC (permalink / raw)
To: robh+dt, mark.rutland, rpurdie, jacek.anaszewski, pavel,
sakari.ailus, laurent.pinchart
Cc: devicetree, linux-kernel, linux-leds, Dan Murphy
Fix two checkpatch warnings for 80 char
length and for a quoted string across multiple
line warnings.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
drivers/leds/leds-as3645a.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
index 9a257f969300..f883616d9e60 100644
--- a/drivers/leds/leds-as3645a.c
+++ b/drivers/leds/leds-as3645a.c
@@ -360,7 +360,8 @@ static int as3645a_set_flash_brightness(struct led_classdev_flash *fled,
{
struct as3645a *flash = fled_to_as3645a(fled);
- flash->flash_current = as3645a_current_to_reg(flash, true, brightness_ua);
+ flash->flash_current = as3645a_current_to_reg(flash, true,
+ brightness_ua);
return as3645a_set_current(flash);
}
@@ -455,8 +456,8 @@ static int as3645a_detect(struct as3645a *flash)
/* Verify the chip model and version. */
if (model != 0x01 || rfu != 0x00) {
- dev_err(dev, "AS3645A not detected "
- "(model %d rfu %d)\n", model, rfu);
+ dev_err(dev, "AS3645A not detected (model %d rfu %d)\n",
+ model, rfu);
return -ENODEV;
}
--
2.15.0.124.g7668cbc60
^ permalink raw reply related
* [RFC PATCH 1/2] dt: bindings: as3645a: Update dt node example with standard
From: Dan Murphy @ 2017-12-12 21:50 UTC (permalink / raw)
To: robh+dt, mark.rutland, rpurdie, jacek.anaszewski, pavel,
sakari.ailus, laurent.pinchart
Cc: devicetree, linux-kernel, linux-leds, Dan Murphy
Update the DT binding to remove the device name from
the DT parent node as well as removing the device
name from the label. The LED label will be generated
based off the id name stored in the local driver so
the LED function can be indicated in the label DT
entry.
Also removed the indentation on the example.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
.../devicetree/bindings/leds/ams,as3645a.txt | 36 +++++++++++-----------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/Documentation/devicetree/bindings/leds/ams,as3645a.txt b/Documentation/devicetree/bindings/leds/ams,as3645a.txt
index fc7f5f9f234c..122aa7165cf3 100644
--- a/Documentation/devicetree/bindings/leds/ams,as3645a.txt
+++ b/Documentation/devicetree/bindings/leds/ams,as3645a.txt
@@ -58,22 +58,22 @@ label : The label of the indicator LED.
Example
=======
- as3645a@30 {
- compatible = "ams,as3645a";
- #address-cells = <1>;
- #size-cells = <0>;
- reg = <0x30>;
- flash@0 {
- reg = <0x0>;
- flash-timeout-us = <150000>;
- flash-max-microamp = <320000>;
- led-max-microamp = <60000>;
- ams,input-max-microamp = <1750000>;
- label = "as3645a:flash";
- };
- indicator@1 {
- reg = <0x1>;
- led-max-microamp = <10000>;
- label = "as3645a:indicator";
- };
+led-controller@30 {
+ compatible = "ams,as3645a";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0x30>;
+ led@0 {
+ reg = <0x0>;
+ flash-timeout-us = <150000>;
+ flash-max-microamp = <320000>;
+ led-max-microamp = <60000>;
+ ams,input-max-microamp = <1750000>;
+ label = "flash";
};
+ led@1 {
+ reg = <0x1>;
+ led-max-microamp = <10000>;
+ label = "indicator";
+ };
+};
--
2.15.0.124.g7668cbc60
^ permalink raw reply related
* [RFC PATCH 2/2] leds: as3645a: Update LED label generation
From: Dan Murphy @ 2017-12-12 21:50 UTC (permalink / raw)
To: robh+dt, mark.rutland, rpurdie, jacek.anaszewski, pavel,
sakari.ailus, laurent.pinchart
Cc: devicetree, linux-kernel, linux-leds, Dan Murphy
In-Reply-To: <20171212215024.30116-1-dmurphy@ti.com>
Generate the LED label based off either the
DT label node or off the I2C ID in the
i2c device id struct.
If the label is used then this should denote
the LED function. As an example it would
be as3645a:<function>
Otherwise if the label is not
used the LED label will be as3645a:flash and
as3645a:indicator.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
drivers/leds/leds-as3645a.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c
index f883616d9e60..197acd69ddcc 100644
--- a/drivers/leds/leds-as3645a.c
+++ b/drivers/leds/leds-as3645a.c
@@ -526,10 +526,11 @@ static int as3645a_parse_node(struct as3645a *flash,
rval = of_property_read_string(flash->flash_node, "label", &name);
if (!rval)
- strlcpy(names->flash, name, sizeof(names->flash));
+ snprintf(names->flash, sizeof(names->flash), "%s:%s",
+ id->name, name);
else
snprintf(names->flash, sizeof(names->flash),
- "%s:flash", node->name);
+ "%s:flash", id->name);
rval = of_property_read_u32(flash->flash_node, "flash-timeout-us",
&cfg->flash_timeout_us);
@@ -570,10 +571,11 @@ static int as3645a_parse_node(struct as3645a *flash,
rval = of_property_read_string(flash->indicator_node, "label", &name);
if (!rval)
- strlcpy(names->indicator, name, sizeof(names->indicator));
+ snprintf(names->indicator, sizeof(names->indicator), "%s:%s",
+ id->name, name);
else
snprintf(names->indicator, sizeof(names->indicator),
- "%s:indicator", node->name);
+ "%s:indicator", id->name);
rval = of_property_read_u32(flash->indicator_node, "led-max-microamp",
&cfg->indicator_max_ua);
--
2.15.0.124.g7668cbc60
^ permalink raw reply related
* [PATCH v3 0/3] Bluetooth: hci_ll: Get BD address from NVMEM
From: David Lechner @ 2017-12-12 21:59 UTC (permalink / raw)
To: devicetree, linux-bluetooth
Cc: David Lechner, Rob Herring, Mark Rutland, Marcel Holtmann,
Gustavo Padovan, Johan Hedberg, netdev, linux-kernel
This series adds supporting getting the BD address from a NVMEM provider
for "LL" HCI controllers (Texas Instruments).
v3 changes:
* Additional comments on why swapping bytes is needed.
* Fixed comment style and trailing whitespace.
* Rework error handling for nvmem cell code.
v2 changes:
* Fixed typos in dt-bindings
* Use "bd-address" instead of "mac-address"
* Updated dt-bindings to specify the byte order of "bd-address"
* New patch "Bluetooth: hci_ll: add support for setting public address"
* Dropped patch "Bluetooth: hci_ll: add constant for vendor-specific command"
that is already in bluetooth-next
* Rework error handling
* Use bdaddr_t, bacmp and other bluetooth utils
David Lechner (3):
Bluetooth: hci_ll: add support for setting public address
dt-bindings: Add optional nvmem BD address bindings to ti,wlink-st
Bluetooth: hci_ll: Add optional nvmem BD address source
.../devicetree/bindings/net/ti,wilink-st.txt | 5 ++
drivers/bluetooth/hci_ll.c | 77 ++++++++++++++++++++++
2 files changed, 82 insertions(+)
--
2.7.4
^ permalink raw reply
* [PATCH v3 1/3] Bluetooth: hci_ll: add support for setting public address
From: David Lechner @ 2017-12-12 21:59 UTC (permalink / raw)
To: devicetree, linux-bluetooth
Cc: David Lechner, Rob Herring, Mark Rutland, Marcel Holtmann,
Gustavo Padovan, Johan Hedberg, netdev, linux-kernel
In-Reply-To: <1513115958-23761-1-git-send-email-david@lechnology.com>
This adds support for setting the public address on Texas Instruments
Bluetooth chips using a vendor-specific command.
This has been tested on a CC2560A chip. The TI wiki also indicates that
this command should work on TI WL17xx/WL18xx Bluetooth chips.
During review, there was some question as to the correctness of the byte
swapping since TI's documentation is not clear on this matter. This can
be tested with the btmgmt utility from bluez. The adapter must be powered
off to change the address. If the baswap() is omitted, address is reversed.
In case there is a issue in the future, here is the output of btmon during
the command `btmgmt public-addr 00:11:22:33:44:55`:
Bluetooth monitor ver 5.43
= Note: Linux version 4.15.0-rc2-08561-gcb132a1-dirty (armv5tejl) 0.707043
= Note: Bluetooth subsystem version 2.22 0.707091
= New Index: 00:17:E7:BD:1C:8E (Primary,UART,hci0) [hci0] 0.707106
@ MGMT Open: btmgmt (privileged) version 1.14 {0x0002} 0.707124
@ MGMT Open: bluetoothd (privileged) version 1.14 {0x0001} 0.707137
@ MGMT Open: btmon (privileged) version 1.14 {0x0003} 0.707540
@ MGMT Command: Set Public Address (0x0039) plen 6 {0x0002} [hci0] 11.167991
Address: 00:11:22:33:44:55 (CIMSYS Inc)
@ MGMT Event: Command Complete (0x0001) plen 7 {0x0002} [hci0] 11.175681
Set Public Address (0x0039) plen 4
Status: Success (0x00)
Missing options: 0x00000000
@ MGMT Event: Index Removed (0x0005) plen 0 {0x0003} [hci0] 11.175757
@ MGMT Event: Index Removed (0x0005) plen 0 {0x0002} [hci0] 11.175757
@ MGMT Event: Index Removed (0x0005) plen 0 {0x0001} [hci0] 11.175757
= Open Index: 00:17:E7:BD:1C:8E [hci0] 11.176807
< HCI Command: Vendor (0x3f|0x0006) plen 6 [hci0] 11.176975
00 11 22 33 44 55 .."3DU
> HCI Event: Command Complete (0x0e) plen 4 [hci0] 11.188260
Vendor (0x3f|0x0006) ncmd 1
Status: Success (0x00)
...
< HCI Command: Read Local Version Info.. (0x04|0x0001) plen 0 [hci0] 11.189859
> HCI Event: Command Complete (0x0e) plen 12 [hci0] 11.190732
Read Local Version Information (0x04|0x0001) ncmd 1
Status: Success (0x00)
HCI version: Bluetooth 2.1 (0x04) - Revision 0 (0x0000)
LMP version: Bluetooth 2.1 (0x04) - Subversion 6431 (0x191f)
Manufacturer: Texas Instruments Inc. (13)
< HCI Command: Read BD ADDR (0x04|0x0009) plen 0 [hci0] 11.191027
> HCI Event: Command Complete (0x0e) plen 10 [hci0] 11.192101
Read BD ADDR (0x04|0x0009) ncmd 1
Status: Success (0x00)
Address: 00:11:22:33:44:55 (CIMSYS Inc)
...
Signed-off-by: David Lechner <david@lechnology.com>
---
drivers/bluetooth/hci_ll.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index efcfbe9..c948e8d 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -57,6 +57,7 @@
#include "hci_uart.h"
/* Vendor-specific HCI commands */
+#define HCI_VS_WRITE_BD_ADDR 0xfc06
#define HCI_VS_UPDATE_UART_HCI_BAUDRATE 0xff36
/* HCILL commands */
@@ -662,6 +663,24 @@ static int download_firmware(struct ll_device *lldev)
return err;
}
+static int ll_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
+{
+ bdaddr_t bdaddr_swapped;
+ struct sk_buff *skb;
+
+ /* HCI_VS_WRITE_BD_ADDR (at least on a CC2560A chip) expects the BD
+ * address to be MSB first, but bdaddr_t has the convention of being
+ * LSB first.
+ */
+ baswap(&bdaddr_swapped, bdaddr);
+ skb = __hci_cmd_sync(hdev, HCI_VS_WRITE_BD_ADDR, sizeof(bdaddr_t),
+ &bdaddr_swapped, HCI_INIT_TIMEOUT);
+ if (!IS_ERR(skb))
+ kfree_skb(skb);
+
+ return PTR_ERR_OR_ZERO(skb);
+}
+
static int ll_setup(struct hci_uart *hu)
{
int err, retry = 3;
@@ -674,6 +693,8 @@ static int ll_setup(struct hci_uart *hu)
lldev = serdev_device_get_drvdata(serdev);
+ hu->hdev->set_bdaddr = ll_set_bdaddr;
+
serdev_device_set_flow_control(serdev, true);
do {
--
2.7.4
^ permalink raw reply related
* [PATCH v3 2/3] dt-bindings: Add optional nvmem BD address bindings to ti,wlink-st
From: David Lechner @ 2017-12-12 21:59 UTC (permalink / raw)
To: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-bluetooth-u79uwXL29TY76Z2rM5mHXA
Cc: David Lechner, Rob Herring, Mark Rutland, Marcel Holtmann,
Gustavo Padovan, Johan Hedberg, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1513115958-23761-1-git-send-email-david-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
This adds optional nvmem consumer properties to the ti,wlink-st device tree
bindings to allow specifying the BD address.
Reviewed-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: David Lechner <david-nq/r/kbU++upp/zk7JDF2g@public.gmane.org>
---
Documentation/devicetree/bindings/net/ti,wilink-st.txt | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/ti,wilink-st.txt b/Documentation/devicetree/bindings/net/ti,wilink-st.txt
index 1649c1f..a45a508 100644
--- a/Documentation/devicetree/bindings/net/ti,wilink-st.txt
+++ b/Documentation/devicetree/bindings/net/ti,wilink-st.txt
@@ -32,6 +32,9 @@ Optional properties:
See ../clocks/clock-bindings.txt for details.
- clock-names : Must include the following entry:
"ext_clock" (External clock provided to the TI combo chip).
+ - nvmem-cells: phandle to nvmem data cell that contains a 6 byte BD address
+ with the most significant byte first (big-endian).
+ - nvmem-cell-names: "bd-address" (required when nvmem-cells is specified)
Example:
@@ -43,5 +46,7 @@ Example:
enable-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
clocks = <&clk32k_wl18xx>;
clock-names = "ext_clock";
+ nvmem-cells = <&bd_address>;
+ nvmem-cell-names = "bd-address";
};
};
--
2.7.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] Bluetooth: hci_ll: Add optional nvmem BD address source
From: David Lechner @ 2017-12-12 21:59 UTC (permalink / raw)
To: devicetree, linux-bluetooth
Cc: David Lechner, Rob Herring, Mark Rutland, Marcel Holtmann,
Gustavo Padovan, Johan Hedberg, netdev, linux-kernel
In-Reply-To: <1513115958-23761-1-git-send-email-david@lechnology.com>
This adds an optional nvmem consumer to get a BD address from an external
source. The BD address is then set in the Bluetooth chip after the
firmware has been loaded.
This has been tested working with a TI CC2560A chip (in a LEGO MINDSTORMS
EV3).
Signed-off-by: David Lechner <david@lechnology.com>
---
drivers/bluetooth/hci_ll.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
index c948e8d..ed042ae 100644
--- a/drivers/bluetooth/hci_ll.c
+++ b/drivers/bluetooth/hci_ll.c
@@ -53,6 +53,7 @@
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <linux/gpio/consumer.h>
+#include <linux/nvmem-consumer.h>
#include "hci_uart.h"
@@ -90,6 +91,7 @@ struct ll_device {
struct serdev_device *serdev;
struct gpio_desc *enable_gpio;
struct clk *ext_clk;
+ bdaddr_t bdaddr;
};
struct ll_struct {
@@ -719,6 +721,18 @@ static int ll_setup(struct hci_uart *hu)
if (err)
return err;
+ /* Set BD address if one was specified at probe */
+ if (!bacmp(&lldev->bdaddr, BDADDR_NONE)) {
+ /* This means that there was an error getting the BD address
+ * during probe, so mark the device as having a bad address.
+ */
+ set_bit(HCI_QUIRK_INVALID_BDADDR, &hu->hdev->quirks);
+ } else if (bacmp(&lldev->bdaddr, BDADDR_ANY)) {
+ err = ll_set_bdaddr(hu->hdev, &lldev->bdaddr);
+ if (err)
+ set_bit(HCI_QUIRK_INVALID_BDADDR, &hu->hdev->quirks);
+ }
+
/* Operational speed if any */
if (hu->oper_speed)
speed = hu->oper_speed;
@@ -749,6 +763,7 @@ static int hci_ti_probe(struct serdev_device *serdev)
{
struct hci_uart *hu;
struct ll_device *lldev;
+ struct nvmem_cell *bdaddr_cell;
u32 max_speed = 3000000;
lldev = devm_kzalloc(&serdev->dev, sizeof(struct ll_device), GFP_KERNEL);
@@ -770,6 +785,52 @@ static int hci_ti_probe(struct serdev_device *serdev)
of_property_read_u32(serdev->dev.of_node, "max-speed", &max_speed);
hci_uart_set_speeds(hu, 115200, max_speed);
+ /* optional BD address from nvram */
+ bdaddr_cell = nvmem_cell_get(&serdev->dev, "bd-address");
+ if (IS_ERR(bdaddr_cell)) {
+ int err = PTR_ERR(bdaddr_cell);
+
+ if (err == -EPROBE_DEFER)
+ return err;
+
+ /* ENOENT means there is no matching nvmem cell and ENOSYS
+ * means that nvmem is not enabled in the kernel configuration.
+ */
+ if (err != -ENOENT && err != -ENOSYS) {
+ /* If there was some other error, give userspace a
+ * chance to fix the problem instead of failing to load
+ * the driver. Using BDADDR_NONE as a flag that is
+ * tested later in the setup function.
+ */
+ dev_warn(&serdev->dev,
+ "Failed to get \"bd-address\" nvmem cell (%d)\n",
+ err);
+ bacpy(&lldev->bdaddr, BDADDR_NONE);
+ }
+ } else {
+ bdaddr_t *bdaddr;
+ int len;
+
+ bdaddr = nvmem_cell_read(bdaddr_cell, &len);
+ nvmem_cell_put(bdaddr_cell);
+ if (IS_ERR(bdaddr)) {
+ dev_err(&serdev->dev, "Failed to read nvmem bd-address\n");
+ return PTR_ERR(bdaddr);
+ }
+ if (len != sizeof(bdaddr_t)) {
+ dev_err(&serdev->dev, "Invalid nvmem bd-address length\n");
+ kfree(bdaddr);
+ return -EINVAL;
+ }
+
+ /* As per the device tree bindings, the value from nvmem is
+ * expected to be MSB first, but in the kernel it is expected
+ * that bdaddr_t is LSB first.
+ */
+ baswap(&lldev->bdaddr, bdaddr);
+ kfree(bdaddr);
+ }
+
return hci_uart_register_device(hu, &llp);
}
--
2.7.4
^ permalink raw reply related
* [PATCH v4 0/6] Updated LP8860 driver series
From: Dan Murphy @ 2017-12-12 22:01 UTC (permalink / raw)
To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
rpurdie-Fm38FmjxZ/leoWH0uzbU5w,
jacek.anaszewski-Re5JQEeQqe8AvxtiuMwx3w, pavel-+ZI9xUNit7I
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-leds-u79uwXL29TY76Z2rM5mHXA, Dan Murphy
All
v4 - Fix checkpatch warning for code indentation on the
leds: lp8860: Update the dt parsing for LED labeling patch.
v3 - Made changes to the patch set to address concerns on DT node naming conventions
based on discussion in the RFC patch https://patchwork.kernel.org/patch/10089047/
also made requested changes to the DT and driver based on feedback. Patchworks
links in each patch.
v2 - Added an initial patch to bring the DT binding up to standard prior to adding
the changes for the label and triggers.
v1 Cover letter repeat below
After creating a new LED driver for the LM3692x device I went back to the
LP8860 driver that I authored and found some updates that need to be applied.
First the way the LP8860 retrieved the label from the DT was incorrect as the
label should have been from a child node as opposed to the parent. This is now
fixed with this series.
Second, since that device can be used to as either a backlight driver or as a
string agnostic driver a trigger to the backlight needed to be added.
Finally there are changes to the driver that need to be made as either
unnoticed bugs or updates to the driver to align with the current LED
framework. For instance moving to the devm LED class registration, destroying
the mutex upon driver removal and removing the in driver dependency on CONFIG_OF
and moving it to the Kconfig.
With these changes this should at least bring the driver into a better shape.
There are additional changes coming for this driver but I wanted to get the
driver up to snuff before adding a feature to it.
Dan
Dan Murphy (6):
dt: bindings: lp8860: Update bindings for lp8860
dt: bindings: lp8860: Update DT label binding
leds: lp8860: Update the dt parsing for LED labeling
dt: bindings: lp8860: Add trigger binding to the lp8860
leds: lp8860: Add DT parsing to retrieve the trigger node
leds: lp8860: Various fixes to align with LED framework
.../devicetree/bindings/leds/leds-lp8860.txt | 32 ++++++++++++-----
drivers/leds/Kconfig | 2 +-
drivers/leds/leds-lp8860.c | 40 ++++++++++++----------
3 files changed, 46 insertions(+), 28 deletions(-)
--
2.15.0.124.g7668cbc60
--
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
* [PATCH v4 1/6] dt: bindings: lp8860: Update bindings for lp8860
From: Dan Murphy @ 2017-12-12 22:01 UTC (permalink / raw)
To: robh+dt, mark.rutland, rpurdie, jacek.anaszewski, pavel
Cc: devicetree, linux-kernel, linux-leds, Dan Murphy
In-Reply-To: <20171212220143.31210-1-dmurphy@ti.com>
Update the lp8860 bindings to fix various issues
found. Add address-cells and size-cells, rename
enable-gpio to enable-gpios, update the node name
to the device name and indent the node example.
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
v4 - No changes
v3 - Indicatd enable-gpios is active high, moved address and size cells to child
node patch and updated parent DT node name - https://patchwork.kernel.org/patch/10093745/
v2 - New patch
Documentation/devicetree/bindings/leds/leds-lp8860.txt | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/leds/leds-lp8860.txt b/Documentation/devicetree/bindings/leds/leds-lp8860.txt
index aad38dd94d4b..b9d09acbaa73 100644
--- a/Documentation/devicetree/bindings/leds/leds-lp8860.txt
+++ b/Documentation/devicetree/bindings/leds/leds-lp8860.txt
@@ -6,22 +6,22 @@ current sinks that can be controlled by a PWM input
signal, a SPI/I2C master, or both.
Required properties:
- - compatible:
+ - compatible :
"ti,lp8860"
- - reg - I2C slave address
- - label - Used for naming LEDs
+ - reg : I2C slave address
+ - label : Used for naming LEDs
Optional properties:
- - enable-gpio - gpio pin to enable/disable the device.
- - supply - "vled" - LED supply
+ - enable-gpios : gpio pin to enable (active high)/disable the device.
+ - vled-supply : LED supply
Example:
-leds: leds@6 {
+led-controller@2d {
compatible = "ti,lp8860";
reg = <0x2d>;
label = "display_cluster";
- enable-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>;
+ enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
vled-supply = <&vbatt>;
}
--
2.15.0.124.g7668cbc60
^ permalink raw reply related
* [PATCH v4 2/6] dt: bindings: lp8860: Update DT label binding
From: Dan Murphy @ 2017-12-12 22:01 UTC (permalink / raw)
To: robh+dt, mark.rutland, rpurdie, jacek.anaszewski, pavel
Cc: devicetree, linux-kernel, linux-leds, Dan Murphy
In-Reply-To: <20171212220143.31210-1-dmurphy@ti.com>
Update the lp8860 label binding to the LED
standard as documented in
Documentation/devicetree/bindings/leds/common.txt
Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
v4 - No changes
v3 - Added address and size cells, updated label with color and inserted spaces
around the reg node - https://patchwork.kernel.org/patch/10093749/
v2 - Added reg to child node and made it required
Documentation/devicetree/bindings/leds/leds-lp8860.txt | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/leds/leds-lp8860.txt b/Documentation/devicetree/bindings/leds/leds-lp8860.txt
index b9d09acbaa73..c3d64ade1e26 100644
--- a/Documentation/devicetree/bindings/leds/leds-lp8860.txt
+++ b/Documentation/devicetree/bindings/leds/leds-lp8860.txt
@@ -9,20 +9,33 @@ Required properties:
- compatible :
"ti,lp8860"
- reg : I2C slave address
- - label : Used for naming LEDs
+ - #address-cells : 1
+ - #size-cells : 0
Optional properties:
- enable-gpios : gpio pin to enable (active high)/disable the device.
- vled-supply : LED supply
+Required child properties:
+ - reg : 0
+
+Optional child properties:
+ - label : see Documentation/devicetree/bindings/leds/common.txt
+
Example:
led-controller@2d {
compatible = "ti,lp8860";
+ #address-cells = <1>;
+ #size-cells = <0>;
reg = <0x2d>;
- label = "display_cluster";
enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
vled-supply = <&vbatt>;
+
+ led@0 {
+ reg = <0>;
+ label = "white:display_cluster";
+ };
}
For more product information please see the link below:
--
2.15.0.124.g7668cbc60
^ permalink raw reply related
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