Re: [PATCH 1/1] pinctrl: bcm281xx: Staticize bcm281xx_pinctrl_probe
Hi Sachin, Looks good, thanks. How did you come across the need for this change? Regards, Sherman On 14-06-23 04:38 AM, Sachin Kamat wrote: bcm281xx_pinctrl_probe is local to this file. Make it static. Signed-off-by: Sachin Kamat --- drivers/pinctrl/pinctrl-bcm281xx.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-bcm281xx.c b/drivers/pinctrl/pinctrl-bcm281xx.c index 3bed792b2c03..c5ca9e633fff 100644 --- a/drivers/pinctrl/pinctrl-bcm281xx.c +++ b/drivers/pinctrl/pinctrl-bcm281xx.c @@ -1396,7 +1396,7 @@ static struct pinctrl_desc bcm281xx_pinctrl_desc = { .owner = THIS_MODULE, }; -int __init bcm281xx_pinctrl_probe(struct platform_device *pdev) +static int __init bcm281xx_pinctrl_probe(struct platform_device *pdev) { struct bcm281xx_pinctrl_data *pdata = _pinctrl; struct resource *res; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 1/1] pinctrl: bcm281xx: Staticize bcm281xx_pinctrl_probe
Hi Sachin, Looks good, thanks. How did you come across the need for this change? Regards, Sherman On 14-06-23 04:38 AM, Sachin Kamat wrote: bcm281xx_pinctrl_probe is local to this file. Make it static. Signed-off-by: Sachin Kamat sachin.ka...@samsung.com --- drivers/pinctrl/pinctrl-bcm281xx.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-bcm281xx.c b/drivers/pinctrl/pinctrl-bcm281xx.c index 3bed792b2c03..c5ca9e633fff 100644 --- a/drivers/pinctrl/pinctrl-bcm281xx.c +++ b/drivers/pinctrl/pinctrl-bcm281xx.c @@ -1396,7 +1396,7 @@ static struct pinctrl_desc bcm281xx_pinctrl_desc = { .owner = THIS_MODULE, }; -int __init bcm281xx_pinctrl_probe(struct platform_device *pdev) +static int __init bcm281xx_pinctrl_probe(struct platform_device *pdev) { struct bcm281xx_pinctrl_data *pdata = bcm281xx_pinctrl; struct resource *res; -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 3/3] pinctrl: fix typo in bindings documentation
Fixed the missing comma in DT node example. Signed-off-by: Sherman Yin --- .../bindings/pinctrl/brcm,bcm11351-pinctrl.txt |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt index c119deb..67a5db9 100644 --- a/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt @@ -119,7 +119,7 @@ Optional Properties (for HDMI pins): Example: // pin controller node pinctrl@35004800 { - compatible = "brcmbcm11351-pinctrl"; + compatible = "brcm,bcm11351-pinctrl"; reg = <0x35004800 0x430>; // pin configuration node -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 2/3] Update bcm_defconfig with new pinctrl CONFIG
To be consistent with other Broadcom drivers, the Broadcom Capri pinctrl driver and its related CONFIG option are renamed to bcm281xx. This commit updates the defconfig that enables the pinctrl driver. Signed-off-by: Sherman Yin Reviewed-by: Matt Porter Acked-by: Linus Walleij --- arch/arm/configs/bcm_defconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig index 2519d6d..b4d3013 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig @@ -125,7 +125,7 @@ CONFIG_CRC_ITU_T=y CONFIG_CRC7=y CONFIG_XZ_DEC=y CONFIG_AVERAGE=y -CONFIG_PINCTRL_CAPRI=y +CONFIG_PINCTRL_BCM281XX=y CONFIG_WATCHDOG=y CONFIG_BCM_KONA_WDT=y CONFIG_BCM_KONA_WDT_DEBUG=y -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 0/3] pinctrl: Rename Broadcom Capri pinctrl driver
To be consistent with other Broadcom drivers, the Broadcom Capri pinctrl driver and its related CONFIG option are renamed to bcm281xx. Devicetree compatible string and binding documentation use "brcm,bcm11351-pinctrl" to match the machine binding here: Documentation/devicetree/bindings/arm/bcm/bcm11351.txt This driver supports pinctrl on BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 SoCs. Signed-off-by: Sherman Yin Reviewed-by: Matt Porter Acked-by: Linus Walleij --- v3: removed the device tree/compatible string portion of changes which were already accepted in 3.14-rc6. Fixed typo in documentation. v2: split single patch into 4 patches Sherman Yin (3): pinctrl: Rename Broadcom Capri pinctrl driver Update bcm_defconfig with new pinctrl CONFIG pinctrl: fix typo in bindings documentation .../bindings/pinctrl/brcm,bcm11351-pinctrl.txt |2 +- arch/arm/configs/bcm_defconfig |2 +- drivers/pinctrl/Kconfig|8 +- drivers/pinctrl/Makefile |2 +- .../{pinctrl-capri.c => pinctrl-bcm281xx.c}| 1519 ++-- 5 files changed, 770 insertions(+), 763 deletions(-) rename drivers/pinctrl/{pinctrl-capri.c => pinctrl-bcm281xx.c} (25%) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 0/3] pinctrl: Rename Broadcom Capri pinctrl driver
To be consistent with other Broadcom drivers, the Broadcom Capri pinctrl driver and its related CONFIG option are renamed to bcm281xx. Devicetree compatible string and binding documentation use brcm,bcm11351-pinctrl to match the machine binding here: Documentation/devicetree/bindings/arm/bcm/bcm11351.txt This driver supports pinctrl on BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Matt Porter mpor...@linaro.org Acked-by: Linus Walleij linus.wall...@linaro.org --- v3: removed the device tree/compatible string portion of changes which were already accepted in 3.14-rc6. Fixed typo in documentation. v2: split single patch into 4 patches Sherman Yin (3): pinctrl: Rename Broadcom Capri pinctrl driver Update bcm_defconfig with new pinctrl CONFIG pinctrl: fix typo in bindings documentation .../bindings/pinctrl/brcm,bcm11351-pinctrl.txt |2 +- arch/arm/configs/bcm_defconfig |2 +- drivers/pinctrl/Kconfig|8 +- drivers/pinctrl/Makefile |2 +- .../{pinctrl-capri.c = pinctrl-bcm281xx.c}| 1519 ++-- 5 files changed, 770 insertions(+), 763 deletions(-) rename drivers/pinctrl/{pinctrl-capri.c = pinctrl-bcm281xx.c} (25%) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 3/3] pinctrl: fix typo in bindings documentation
Fixed the missing comma in DT node example. Signed-off-by: Sherman Yin s...@broadcom.com --- .../bindings/pinctrl/brcm,bcm11351-pinctrl.txt |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt index c119deb..67a5db9 100644 --- a/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt @@ -119,7 +119,7 @@ Optional Properties (for HDMI pins): Example: // pin controller node pinctrl@35004800 { - compatible = brcmbcm11351-pinctrl; + compatible = brcm,bcm11351-pinctrl; reg = 0x35004800 0x430; // pin configuration node -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 2/3] Update bcm_defconfig with new pinctrl CONFIG
To be consistent with other Broadcom drivers, the Broadcom Capri pinctrl driver and its related CONFIG option are renamed to bcm281xx. This commit updates the defconfig that enables the pinctrl driver. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Matt Porter mpor...@linaro.org Acked-by: Linus Walleij linus.wall...@linaro.org --- arch/arm/configs/bcm_defconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig index 2519d6d..b4d3013 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig @@ -125,7 +125,7 @@ CONFIG_CRC_ITU_T=y CONFIG_CRC7=y CONFIG_XZ_DEC=y CONFIG_AVERAGE=y -CONFIG_PINCTRL_CAPRI=y +CONFIG_PINCTRL_BCM281XX=y CONFIG_WATCHDOG=y CONFIG_BCM_KONA_WDT=y CONFIG_BCM_KONA_WDT_DEBUG=y -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] pinctrl: capri: Make capri_pinctrl_probe static
On 14-02-04 12:49 AM, Axel Lin wrote: Signed-off-by: Axel Lin --- drivers/pinctrl/pinctrl-capri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-capri.c b/drivers/pinctrl/pinctrl-capri.c index 4669c53..b4aa8e3 100644 --- a/drivers/pinctrl/pinctrl-capri.c +++ b/drivers/pinctrl/pinctrl-capri.c @@ -1390,7 +1390,7 @@ static struct pinctrl_desc capri_pinctrl_desc = { .owner = THIS_MODULE, }; -int __init capri_pinctrl_probe(struct platform_device *pdev) +static int __init capri_pinctrl_probe(struct platform_device *pdev) { struct capri_pinctrl_data *pdata = _pinctrl; struct resource *res; Note that this will collide with the capri->bcm281xx renaming patches. Linus, Christian, are those patches going in soon? Thanks, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] pinctrl: capri: Make capri_pinctrl_probe static
On 14-02-04 12:49 AM, Axel Lin wrote: Signed-off-by: Axel Lin axel@ingics.com --- drivers/pinctrl/pinctrl-capri.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-capri.c b/drivers/pinctrl/pinctrl-capri.c index 4669c53..b4aa8e3 100644 --- a/drivers/pinctrl/pinctrl-capri.c +++ b/drivers/pinctrl/pinctrl-capri.c @@ -1390,7 +1390,7 @@ static struct pinctrl_desc capri_pinctrl_desc = { .owner = THIS_MODULE, }; -int __init capri_pinctrl_probe(struct platform_device *pdev) +static int __init capri_pinctrl_probe(struct platform_device *pdev) { struct capri_pinctrl_data *pdata = capri_pinctrl; struct resource *res; Note that this will collide with the capri-bcm281xx renaming patches. Linus, Christian, are those patches going in soon? Thanks, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 0/4] pinctrl: Rename Broadcom Capri pinctrl driver
To be consistent with other Broadcom drivers, the Broadcom Capri pinctrl driver and its related CONFIG option are renamed to bcm281xx. Devicetree compatible string and binding documentation use "brcm,bcm11351-pinctrl" to match the machine binding here: Documentation/devicetree/bindings/arm/bcm/bcm11351.txt This driver supports pinctrl on BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 SoCs. Signed-off-by: Sherman Yin Reviewed-by: Matt Porter Acked-by: Linus Walleij --- v2: split single patch into 4 patches Sherman Yin (4): pinctrl: Rename Broadcom Capri pinctrl binding pinctrl: Rename Broadcom Capri pinctrl driver Update bcm_defconfig with new pinctrl CONFIG Update dtsi with new pinctrl compatible string ...capri-pinctrl.txt => brcm,bcm11351-pinctrl.txt} |8 +- arch/arm/boot/dts/bcm11351.dtsi|2 +- arch/arm/configs/bcm_defconfig |2 +- drivers/pinctrl/Kconfig|8 +- drivers/pinctrl/Makefile |2 +- .../{pinctrl-capri.c => pinctrl-bcm281xx.c}| 1521 ++-- 6 files changed, 775 insertions(+), 768 deletions(-) rename Documentation/devicetree/bindings/pinctrl/{brcm,capri-pinctrl.txt => brcm,bcm11351-pinctrl.txt} (98%) rename drivers/pinctrl/{pinctrl-capri.c => pinctrl-bcm281xx.c} (25%) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 3/4] Update bcm_defconfig with new pinctrl CONFIG
To be consistent with other Broadcom drivers, the Broadcom Capri pinctrl driver and its related CONFIG option are renamed to bcm281xx. This commit updates the defconfig that enables the pinctrl driver. Signed-off-by: Sherman Yin Reviewed-by: Matt Porter Acked-by: Linus Walleij --- arch/arm/configs/bcm_defconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig index bede511..53d6d47 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig @@ -126,4 +126,4 @@ CONFIG_CRC_ITU_T=y CONFIG_CRC7=y CONFIG_XZ_DEC=y CONFIG_AVERAGE=y -CONFIG_PINCTRL_CAPRI=y +CONFIG_PINCTRL_BCM281XX=y -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 4/4] Update dtsi with new pinctrl compatible string
This commit updates bcm11351.dtsi with the new compatible string for the same driver. Signed-off-by: Sherman Yin Reviewed-by: Matt Porter Acked-by: Linus Walleij --- arch/arm/boot/dts/bcm11351.dtsi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi index dd8e878..6c183f3 100644 --- a/arch/arm/boot/dts/bcm11351.dtsi +++ b/arch/arm/boot/dts/bcm11351.dtsi @@ -143,7 +143,7 @@ }; pinctrl@35004800 { - compatible = "brcm,capri-pinctrl"; + compatible = "brcm,bcm11351-pinctrl"; reg = <0x35004800 0x430>; }; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 1/4] pinctrl: Rename Broadcom Capri pinctrl binding
The compatible string of the Broadcom Capri pinctrl driver is renamed to "brcm,bcm11351-pinctrl" to match the machine binding here: Documentation/devicetree/bindings/arm/bcm/bcm11351.txt Signed-off-by: Sherman Yin Reviewed-by: Matt Porter Acked-by: Linus Walleij --- ...capri-pinctrl.txt => brcm,bcm11351-pinctrl.txt} |8 1 file changed, 4 insertions(+), 4 deletions(-) rename Documentation/devicetree/bindings/pinctrl/{brcm,capri-pinctrl.txt => brcm,bcm11351-pinctrl.txt} (98%) diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt similarity index 98% rename from Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt rename to Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt index 9e9e9ef..c119deb 100644 --- a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt @@ -1,4 +1,4 @@ -Broadcom Capri Pin Controller +Broadcom BCM281xx Pin Controller This is a pin controller for the Broadcom BCM281xx SoC family, which includes BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. @@ -7,14 +7,14 @@ BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. Required Properties: -- compatible: Must be "brcm,capri-pinctrl". +- compatible: Must be "brcm,bcm11351-pinctrl" - reg: Base address of the PAD Controller register block and the size of the block. For example, the following is the bare minimum node: pinctrl@35004800 { - compatible = "brcm,capri-pinctrl"; + compatible = "brcm,bcm11351-pinctrl"; reg = <0x35004800 0x430>; }; @@ -119,7 +119,7 @@ Optional Properties (for HDMI pins): Example: // pin controller node pinctrl@35004800 { - compatible = "brcm,capri-pinctrl"; + compatible = "brcmbcm11351-pinctrl"; reg = <0x35004800 0x430>; // pin configuration node -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 1/4] pinctrl: Rename Broadcom Capri pinctrl binding
The compatible string of the Broadcom Capri pinctrl driver is renamed to brcm,bcm11351-pinctrl to match the machine binding here: Documentation/devicetree/bindings/arm/bcm/bcm11351.txt Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Matt Porter mpor...@linaro.org Acked-by: Linus Walleij linus.wall...@linaro.org --- ...capri-pinctrl.txt = brcm,bcm11351-pinctrl.txt} |8 1 file changed, 4 insertions(+), 4 deletions(-) rename Documentation/devicetree/bindings/pinctrl/{brcm,capri-pinctrl.txt = brcm,bcm11351-pinctrl.txt} (98%) diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt similarity index 98% rename from Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt rename to Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt index 9e9e9ef..c119deb 100644 --- a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/brcm,bcm11351-pinctrl.txt @@ -1,4 +1,4 @@ -Broadcom Capri Pin Controller +Broadcom BCM281xx Pin Controller This is a pin controller for the Broadcom BCM281xx SoC family, which includes BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. @@ -7,14 +7,14 @@ BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. Required Properties: -- compatible: Must be brcm,capri-pinctrl. +- compatible: Must be brcm,bcm11351-pinctrl - reg: Base address of the PAD Controller register block and the size of the block. For example, the following is the bare minimum node: pinctrl@35004800 { - compatible = brcm,capri-pinctrl; + compatible = brcm,bcm11351-pinctrl; reg = 0x35004800 0x430; }; @@ -119,7 +119,7 @@ Optional Properties (for HDMI pins): Example: // pin controller node pinctrl@35004800 { - compatible = brcm,capri-pinctrl; + compatible = brcmbcm11351-pinctrl; reg = 0x35004800 0x430; // pin configuration node -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 4/4] Update dtsi with new pinctrl compatible string
This commit updates bcm11351.dtsi with the new compatible string for the same driver. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Matt Porter mpor...@linaro.org Acked-by: Linus Walleij linus.wall...@linaro.org --- arch/arm/boot/dts/bcm11351.dtsi |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi index dd8e878..6c183f3 100644 --- a/arch/arm/boot/dts/bcm11351.dtsi +++ b/arch/arm/boot/dts/bcm11351.dtsi @@ -143,7 +143,7 @@ }; pinctrl@35004800 { - compatible = brcm,capri-pinctrl; + compatible = brcm,bcm11351-pinctrl; reg = 0x35004800 0x430; }; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 3/4] Update bcm_defconfig with new pinctrl CONFIG
To be consistent with other Broadcom drivers, the Broadcom Capri pinctrl driver and its related CONFIG option are renamed to bcm281xx. This commit updates the defconfig that enables the pinctrl driver. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Matt Porter mpor...@linaro.org Acked-by: Linus Walleij linus.wall...@linaro.org --- arch/arm/configs/bcm_defconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig index bede511..53d6d47 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig @@ -126,4 +126,4 @@ CONFIG_CRC_ITU_T=y CONFIG_CRC7=y CONFIG_XZ_DEC=y CONFIG_AVERAGE=y -CONFIG_PINCTRL_CAPRI=y +CONFIG_PINCTRL_BCM281XX=y -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 0/4] pinctrl: Rename Broadcom Capri pinctrl driver
To be consistent with other Broadcom drivers, the Broadcom Capri pinctrl driver and its related CONFIG option are renamed to bcm281xx. Devicetree compatible string and binding documentation use brcm,bcm11351-pinctrl to match the machine binding here: Documentation/devicetree/bindings/arm/bcm/bcm11351.txt This driver supports pinctrl on BCM11130, BCM11140, BCM11351, BCM28145 and BCM28155 SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Matt Porter mpor...@linaro.org Acked-by: Linus Walleij linus.wall...@linaro.org --- v2: split single patch into 4 patches Sherman Yin (4): pinctrl: Rename Broadcom Capri pinctrl binding pinctrl: Rename Broadcom Capri pinctrl driver Update bcm_defconfig with new pinctrl CONFIG Update dtsi with new pinctrl compatible string ...capri-pinctrl.txt = brcm,bcm11351-pinctrl.txt} |8 +- arch/arm/boot/dts/bcm11351.dtsi|2 +- arch/arm/configs/bcm_defconfig |2 +- drivers/pinctrl/Kconfig|8 +- drivers/pinctrl/Makefile |2 +- .../{pinctrl-capri.c = pinctrl-bcm281xx.c}| 1521 ++-- 6 files changed, 775 insertions(+), 768 deletions(-) rename Documentation/devicetree/bindings/pinctrl/{brcm,capri-pinctrl.txt = brcm,bcm11351-pinctrl.txt} (98%) rename drivers/pinctrl/{pinctrl-capri.c = pinctrl-bcm281xx.c} (25%) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 14-01-20 12:16 AM, Linus Walleij wrote: On Sat, Jan 18, 2014 at 3:56 AM, Matt Porter wrote: I wonder if Linus would accept a rename at this point (too late for 3.14 presumably, but for 3.15) of s/capri/bcm281xx throughout, bcm11351 for the compatible string, as we have for the machine compatible, and also BCM281XX for the Kconfig option. Yes, if there is some consensus that this is what we want to do. I can certainly merge that during the 3.14-rc phase for that matter. Hi Linus, I'll confirm the new name with Matt before sending out another patch. Which would work better for you - a) a set of patches replacing my previous ones, b) a set of patches on top of my previous ones, c) a single patch on top of my previous ones? d) something else? Thanks, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 14-01-20 12:16 AM, Linus Walleij wrote: On Sat, Jan 18, 2014 at 3:56 AM, Matt Porter mpor...@linaro.org wrote: I wonder if Linus would accept a rename at this point (too late for 3.14 presumably, but for 3.15) of s/capri/bcm281xx throughout, bcm11351 for the compatible string, as we have for the machine compatible, and also BCM281XX for the Kconfig option. Yes, if there is some consensus that this is what we want to do. I can certainly merge that during the 3.14-rc phase for that matter. Hi Linus, I'll confirm the new name with Matt before sending out another patch. Which would work better for you - a) a set of patches replacing my previous ones, b) a set of patches on top of my previous ones, c) a single patch on top of my previous ones? d) something else? Thanks, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 14-01-16 05:19 AM, Linus Walleij wrote: On Sat, Dec 21, 2013 at 3:13 AM, Sherman Yin wrote: '> Adds pinctrl driver for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v4: - PINCTRL selected in Kconfig, PINCTRL_CAPRI selected in bcm_defconfig - make use of regmap - change CAPRI_PIN_UPDATE from macro to inline function. - Handle pull-up strength arg in Ohm instead of enum Patch applied. It is really good now! It's late before the merge window, but you've done a tremendous work on this driver and I don't want to delay its deployment further. Great, thanks for the support and reviews! But note: arch/arm/configs/bcm_defconfig |1 + arch/arm/mach-bcm/Kconfig |1 + I've optimistically applied these two hunks of the patch as well, but if there is any conflict with the ARM SoC tree I will just rebase the patch and pull these *out*. ARM SoC maintainers: be warned if something collides. Ok, will keep an eye on this and fix accordingly. Should be simple fixes. Regards, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] pinctrl: capri: add dependency on OF
On 14-01-16 02:45 PM, Linus Walleij wrote: As this driver is using pinconf_generic_dt_node_to_map_pin() it needs to depend on OF so as not to cause build problems on archs that do not support OF. Cc: Sherman Yin Signed-off-by: Linus Walleij --- drivers/pinctrl/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index f1dda4d9de13..be361b7cd30f 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -106,6 +106,7 @@ config PINCTRL_BCM2835 config PINCTRL_CAPRI bool "Broadcom Capri pinctrl driver" + depends on OF select PINMUX select PINCONF select GENERIC_PINCONF Thanks for the fix, Linus. While we're visiting this config, should we add "depends on MACH_BCM_MOBILE" as well? Thanks, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] pinctrl: capri: add dependency on OF
On 14-01-16 02:45 PM, Linus Walleij wrote: As this driver is using pinconf_generic_dt_node_to_map_pin() it needs to depend on OF so as not to cause build problems on archs that do not support OF. Cc: Sherman Yin s...@broadcom.com Signed-off-by: Linus Walleij linus.wall...@linaro.org --- drivers/pinctrl/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index f1dda4d9de13..be361b7cd30f 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -106,6 +106,7 @@ config PINCTRL_BCM2835 config PINCTRL_CAPRI bool Broadcom Capri pinctrl driver + depends on OF select PINMUX select PINCONF select GENERIC_PINCONF Thanks for the fix, Linus. While we're visiting this config, should we add depends on MACH_BCM_MOBILE as well? Thanks, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 14-01-16 05:19 AM, Linus Walleij wrote: On Sat, Dec 21, 2013 at 3:13 AM, Sherman Yin s...@broadcom.com wrote: ' Adds pinctrl driver for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v4: - PINCTRL selected in Kconfig, PINCTRL_CAPRI selected in bcm_defconfig - make use of regmap - change CAPRI_PIN_UPDATE from macro to inline function. - Handle pull-up strength arg in Ohm instead of enum Patch applied. It is really good now! It's late before the merge window, but you've done a tremendous work on this driver and I don't want to delay its deployment further. Great, thanks for the support and reviews! But note: arch/arm/configs/bcm_defconfig |1 + arch/arm/mach-bcm/Kconfig |1 + I've optimistically applied these two hunks of the patch as well, but if there is any conflict with the ARM SoC tree I will just rebase the patch and pull these *out*. ARM SoC maintainers: be warned if something collides. Ok, will keep an eye on this and fix accordingly. Should be simple fixes. Regards, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
On 14-01-14 02:16 AM, Linus Walleij wrote: On Tue, Jan 7, 2014 at 9:45 PM, Sherman Yin wrote: On 14-01-07 09:15 AM, Linus Walleij wrote: Is that what you wanted to see in pinctrl-bindings.txt, or is there something else you want to see added to that txt file? I didn't want to add the description of slew-rate arguments there because this is capri-specific. I'm not quite sure what else to add. (...) That doc already says bias-pull-up is specified in Ohm, and the specific values are chip-specific, so I don't think they should be mentioned there. You're right, forget about this. I didn't realize the pinctrl bindings doc was that good... +Optional Properties (for HDMI pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: "alt1", "alt2", "alt3", "alt4" +- slew-rate: Integer. Controls slew rate. + 0: Standard(100kbps)& Fast(400kbps) mode + 1: Highspeed (3.4Mbps) mode H slew rate is not specifiec in "bps" but rather in something like volts per second. But maybe it's best to keep this value driver-specific. Right, I think the slew-rates values are capri specific. OK Great! Is there anything else you would like to see changed before this patchset can be accepted? Thanks, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
On 14-01-14 02:16 AM, Linus Walleij wrote: On Tue, Jan 7, 2014 at 9:45 PM, Sherman Yin s...@broadcom.com wrote: On 14-01-07 09:15 AM, Linus Walleij wrote: Is that what you wanted to see in pinctrl-bindings.txt, or is there something else you want to see added to that txt file? I didn't want to add the description of slew-rate arguments there because this is capri-specific. I'm not quite sure what else to add. (...) That doc already says bias-pull-up is specified in Ohm, and the specific values are chip-specific, so I don't think they should be mentioned there. You're right, forget about this. I didn't realize the pinctrl bindings doc was that good... +Optional Properties (for HDMI pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: alt1, alt2, alt3, alt4 +- slew-rate: Integer. Controls slew rate. + 0: Standard(100kbps) Fast(400kbps) mode + 1: Highspeed (3.4Mbps) mode H slew rate is not specifiec in bps but rather in something like volts per second. But maybe it's best to keep this value driver-specific. Right, I think the slew-rates values are capri specific. OK Great! Is there anything else you would like to see changed before this patchset can be accepted? Thanks, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
On 14-01-07 09:15 AM, Linus Walleij wrote: On Sat, Dec 21, 2013 at 3:13 AM, Sherman Yin wrote: +Optional Properties (for standard pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: "alt1", "alt2", "alt3", "alt4" +- input-schmitt-enable:No arguments. Enable schmitt-trigger mode. +- input-schmitt-disable: No arguments. Disable schmitt-trigger mode. +- bias-pull-up:No arguments. Pull up on pin. +- bias-pull-down: No arguments. Pull down on pin. +- bias-disable:No arguments. Disable pin bias. +- slew-rate: Integer. Meaning depends on configured pin mux: + *_SCL or *_SDA: + 0: Standard(100kbps)& Fast(400kbps) mode + 1: Highspeed (3.4Mbps) mode + IC_DM or IC_DP: + 0: normal slew rate + 1: fast slew rate + Otherwise: + 0: fast slew rate + 1: normal slew rate +- input-enable:No arguements. Enable input (does not affect + output.) +- input-disable: No arguements. Disable input (does not affect + output.) +- drive-strength: Integer. Drive strength in mA. Valid values are + 2, 4, 6, 8, 10, 12, 14, 16 mA. Also patch Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt Since you're adding generic properties. Please note that I removed from this patchset the patch that you've merged to your for-next branch already: https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-pinctrl.git/commit/?h=for-next=8ba3f4d00078e7a49c60c0bd6298f29402c3a0a0 Is that what you wanted to see in pinctrl-bindings.txt, or is there something else you want to see added to that txt file? I didn't want to add the description of slew-rate arguments there because this is capri-specific. I'm not quite sure what else to add. +Optional Properties (for I2C pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: "alt1", "alt2", "alt3", "alt4" +- bias-pull-up:Integer. Pull up strength in Ohm. There are 3 + pull-up resisitors (1.2k, 1.8k, 2.7k) available + in parallel for I2C pins, so the valid values + are: 568, 720, 831, 1080, 1200, 1800, 2700 Ohm. Also patch Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt That doc already says bias-pull-up is specified in Ohm, and the specific values are chip-specific, so I don't think they should be mentioned there. +- bias-disable:No arguments. Disable pin bias. +- slew-rate: Integer. Meaning depends on configured pin mux: + *_SCL or *_SDA: + 0: Standard(100kbps)& Fast(400kbps) mode + 1: Highspeed (3.4Mbps) mode + IC_DM or IC_DP: + 0: normal slew rate + 1: fast slew rate + Otherwise: + 0: fast slew rate + 1: normal slew rate Hm that does not seem generic though, so let's not add this to the generic bindings. +- input-enable:No arguements. Enable input (does not affect + output.) +- input-disable: No arguements. Disable input (does not affect + output.) + +Optional Properties (for HDMI pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: "alt1", "alt2", "alt3", "alt4" +- slew-rate: Integer. Controls slew rate. + 0: Standard(100kbps)& Fast(400kbps) mode + 1: Highspeed (3.4Mbps) mode H slew rate is not specifiec in "bps" but rather in something like volts per second. But maybe it's best to keep this value driver-specific. Right, I think the slew-rates values are capri specific. Thanks for the review. Regards, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v4 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
On 14-01-07 09:15 AM, Linus Walleij wrote: On Sat, Dec 21, 2013 at 3:13 AM, Sherman Yin s...@broadcom.com wrote: +Optional Properties (for standard pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: alt1, alt2, alt3, alt4 +- input-schmitt-enable:No arguments. Enable schmitt-trigger mode. +- input-schmitt-disable: No arguments. Disable schmitt-trigger mode. +- bias-pull-up:No arguments. Pull up on pin. +- bias-pull-down: No arguments. Pull down on pin. +- bias-disable:No arguments. Disable pin bias. +- slew-rate: Integer. Meaning depends on configured pin mux: + *_SCL or *_SDA: + 0: Standard(100kbps) Fast(400kbps) mode + 1: Highspeed (3.4Mbps) mode + IC_DM or IC_DP: + 0: normal slew rate + 1: fast slew rate + Otherwise: + 0: fast slew rate + 1: normal slew rate +- input-enable:No arguements. Enable input (does not affect + output.) +- input-disable: No arguements. Disable input (does not affect + output.) +- drive-strength: Integer. Drive strength in mA. Valid values are + 2, 4, 6, 8, 10, 12, 14, 16 mA. Also patch Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt Since you're adding generic properties. Please note that I removed from this patchset the patch that you've merged to your for-next branch already: https://git.kernel.org/cgit/linux/kernel/git/linusw/linux-pinctrl.git/commit/?h=for-nextid=8ba3f4d00078e7a49c60c0bd6298f29402c3a0a0 Is that what you wanted to see in pinctrl-bindings.txt, or is there something else you want to see added to that txt file? I didn't want to add the description of slew-rate arguments there because this is capri-specific. I'm not quite sure what else to add. +Optional Properties (for I2C pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: alt1, alt2, alt3, alt4 +- bias-pull-up:Integer. Pull up strength in Ohm. There are 3 + pull-up resisitors (1.2k, 1.8k, 2.7k) available + in parallel for I2C pins, so the valid values + are: 568, 720, 831, 1080, 1200, 1800, 2700 Ohm. Also patch Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt That doc already says bias-pull-up is specified in Ohm, and the specific values are chip-specific, so I don't think they should be mentioned there. +- bias-disable:No arguments. Disable pin bias. +- slew-rate: Integer. Meaning depends on configured pin mux: + *_SCL or *_SDA: + 0: Standard(100kbps) Fast(400kbps) mode + 1: Highspeed (3.4Mbps) mode + IC_DM or IC_DP: + 0: normal slew rate + 1: fast slew rate + Otherwise: + 0: fast slew rate + 1: normal slew rate Hm that does not seem generic though, so let's not add this to the generic bindings. +- input-enable:No arguements. Enable input (does not affect + output.) +- input-disable: No arguements. Disable input (does not affect + output.) + +Optional Properties (for HDMI pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: alt1, alt2, alt3, alt4 +- slew-rate: Integer. Controls slew rate. + 0: Standard(100kbps) Fast(400kbps) mode + 1: Highspeed (3.4Mbps) mode H slew rate is not specifiec in bps but rather in something like volts per second. But maybe it's best to keep this value driver-specific. Right, I think the slew-rates values are capri specific. Thanks for the review. Regards, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 5/6] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-12-18 03:56 PM, Sherman Yin wrote: On 13-12-12 12:54 PM, Linus Walleij wrote: +/* + * Write to the register using the value and mask if current value is different + */ +static void capri_reg_write(struct pinctrl_dev *pctldev, + void __iomem *reg, + u32 val, + u32 mask) +{ + u32 old_val; + u32 new_val; + + old_val = readl(reg); + new_val = (old_val & ~mask) | (val & mask); + + if (new_val == old_val) { + dev_dbg(pctldev->dev, + "Reg 0x%p=0x%x (no change)\n", + reg, old_val); + return; + } + + dev_dbg(pctldev->dev, + "Reg 0x%p change from 0x%x to 0x%x\n", + reg, old_val, new_val); + writel(new_val, reg); +} This is a reimplementation of regmap for MMIO. See drivers/base/regmap/regmap-mmio.c Notice how regmap_update_bits() is used throughout the kernel. If you want to do this, use regmap. Ok. As you can see in v4 of my patchset, I've changed my driver to use the mmio regmap. However, as I was tracing through regmap_update_bits(), it looks like I have to go through a lot of checks and function pointers just to do a simple write to a register. Also, I have to select REGMAP_MMIO which brings in a bunch of code as well. I understand the benefits of using common code, but in this case it seems there is a lot of extra code and run-time overhead to use regmap. In the end it also doesn't buy much in terms of functionality. Just a quick note - it looks like the 2nd parameter of regmap_update_bits() wants the offset of a register (offset from regmap_mmio_context.regs). So calling the parameter "reg" is a little confusing, at least in the MMIO case. Regards, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v4: Changed valid values for "bias-pull-up" property for I2C pins. Expanded pin configuration node example. v3: Use generic pin config properties instead of brcm-specific ones. Clarified pin types (standard, i2c, hdmi). v2: Use hyphens instead of underscore in DT property names. --- .../bindings/pinctrl/brcm,capri-pinctrl.txt| 461 1 file changed, 461 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt new file mode 100644 index 000..9e9e9ef --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt @@ -0,0 +1,461 @@ +Broadcom Capri Pin Controller + +This is a pin controller for the Broadcom BCM281xx SoC family, which includes +BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. + +=== Pin Controller Node === + +Required Properties: + +- compatible: Must be "brcm,capri-pinctrl". +- reg: Base address of the PAD Controller register block and the size + of the block. + +For example, the following is the bare minimum node: + + pinctrl@35004800 { + compatible = "brcm,capri-pinctrl"; + reg = <0x35004800 0x430>; + }; + +As a pin controller device, in addition to the required properties, this node +should also contain the pin configuration nodes that client devices reference, +if any. + +=== Pin Configuration Node === + +Each pin configuration node is a sub-node of the pin controller node and is a +container of an arbitrary number of subnodes, called pin group nodes in this +document. + +Please refer to the pinctrl-bindings.txt in this directory for details of the +common pinctrl bindings used by client devices, including the definition of a +"pin configuration node". + +=== Pin Group Node === + +A pin group node specifies the desired pin mux and/or pin configuration for an +arbitrary number of pins. The name of the pin group node is optional and not +used. + +A pin group node only affects the properties specified in the node, and has no +effect on any properties that are omitted. + +The pin group node accepts a subset of the generic pin config properties. For +details generic pin config properties, please refer to pinctrl-bindings.txt +and . + +Each pin controlled by this pin controller belong to one of three types: +Standard, I2C, and HDMI. Each type accepts a different set of pin config +properties. A list of pins and their types is provided below. + +Required Properties (applicable to all pins): + +- pins:Multiple strings. Specifies the name(s) of one or more pins to + be configured by this node. + +Optional Properties (for standard pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: "alt1", "alt2", "alt3", "alt4" +- input-schmitt-enable:No arguments. Enable schmitt-trigger mode. +- input-schmitt-disable: No arguments. Disable schmitt-trigger mode. +- bias-pull-up:No arguments. Pull up on pin. +- bias-pull-down: No arguments. Pull down on pin. +- bias-disable:No arguments. Disable pin bias. +- slew-rate: Integer. Meaning depends on configured pin mux: + *_SCL or *_SDA: + 0: Standard(100kbps)& Fast(400kbps) mode + 1: Highspeed (3.4Mbps) mode + IC_DM or IC_DP: + 0: normal slew rate + 1: fast slew rate + Otherwise: + 0: fast slew rate + 1: normal slew rate +- input-enable:No arguements. Enable input (does not affect + output.) +- input-disable: No arguements. Disable input (does not affect + output.) +- drive-strength: Integer. Drive strength in mA. Valid values are + 2, 4, 6, 8, 10, 12, 14, 16 mA. + +Optional Properties (for I2C pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: "alt1", "alt2", "alt3", "alt4" +- bias-pull-up:Integer. Pull up strength in Ohm. There are 3 +
Re: [PATCH v3 3/6] pinctrl: Make PINCTRL selectable by defconfig/menuconfig
On 13-12-20 12:58 PM, Arnd Bergmann wrote: On Friday 20 December 2013, Linus Walleij wrote: On Tue, Dec 17, 2013 at 1:18 AM, Bjorn Andersson wrote: No matter how we build the individual pinctrl drivers we will always need the pinctrl framework in a multi-soc zImage; so I can't see that we gain anything from being able to compile PINCTRL as a module. I discussed this matter with Christian on IRC and I believe we could basically do "select PINCTRL" on ARCH_MULTIPLATFORM as the vast majority of multiplatforms appear to be using this anyway, this would make the submenu for pin control pop up in menuconfig for this, and make it possible to move different subdrivers to modules if desired. MULTIPLATFORM does not seem to be about saving footprint bytes on a very fine-granular level anyway, more about doing the module loading/unloading approach to footprint. Let's review the list of platforms that don't select PINCTRL. There are some platforms that are indeed sensitive about memory footprint, and I promised people that converting to multiplatform won't cause a significant increase in kernel binary size as long as no other platforms are enabled. Arnd Ok, for this driver, I'll just select PINCTRL under the ARCH_BCM_MOBILE. We can move this to ARCH_MULTIPLATFORM once we're sure this is okay for other platforms. Regards, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 0/6] Add Broadcom Capri pinctrl driver
The following patches adds a pinctrl driver for Broadcom Capri (BCM281xx) SoCs. The first patch, adding the void * to pinctrl_pin_desc, has been previously discussed with LinusW. See this thread: http://lists.infradead.org/pipermail/linux-arm-kernel/2013-April/165880.html --- v4: - removed patch to add new properties to generic pinconfig (merged) - Updated bias-pull-up property to accept R value in Ohms instead of an enum - move PINCTRL_CAPRI to defconfig - Use regmap MMIO v3: Re-worked driver to be based on generic pinconfig, addressed review comments and other supporting changes: - moved config selection from Kconfig to defconfig - added slew-rate, input enable, input disable properties for generic pinconfig - added a description for PINCTRL config v2: Use hyphens instead of underscore in DT property names. Sherman Yin (6): pinctrl: Add void * to pinctrl_pin_desc pinctrl: Adds slew-rate, input-enable/disable pinctrl: Make PINCTRL selectable by defconfig/menuconfig pinctrl: Add pinctrl binding for Broadcom Capri SoCs ARM: pinctrl: Add Broadcom Capri pinctrl driver pinctrl: Enable pinctrl for Broadcom Capri SoCs .../bindings/pinctrl/brcm,capri-pinctrl.txt| 429 ++ .../bindings/pinctrl/pinctrl-bindings.txt |3 + arch/arm/boot/dts/bcm11351.dtsi|4 + arch/arm/configs/bcm_defconfig |5 + drivers/pinctrl/Kconfig| 13 +- drivers/pinctrl/Makefile |1 + drivers/pinctrl/pinconf-generic.c |4 + drivers/pinctrl/pinctrl-capri.c| 1408 include/linux/pinctrl/pinconf-generic.h|4 + include/linux/pinctrl/pinctrl.h|2 + 10 files changed, 1872 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt create mode 100644 drivers/pinctrl/pinctrl-capri.c -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 1/4] pinctrl: Add void * to pinctrl_pin_desc
drv_data is added to the pinctrl_pin_desc for drivers to define additional driver-specific per-pin data. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v4: no change v3: no change v2: no change --- include/linux/pinctrl/pinctrl.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index fefb886..cc8e1af 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -32,10 +32,12 @@ struct device_node; * pins, pads or other muxable units in this struct * @number: unique pin number from the global pin number space * @name: a name for this pin + * @drv_data: driver-defined per-pin data. pinctrl core does not touch this */ struct pinctrl_pin_desc { unsigned number; const char *name; + void *drv_data; }; /* Convenience macro to define a single named or anonymous pin descriptor */ -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
Adds pinctrl driver for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v4: - PINCTRL selected in Kconfig, PINCTRL_CAPRI selected in bcm_defconfig - make use of regmap - change CAPRI_PIN_UPDATE from macro to inline function. - Handle pull-up strength arg in Ohm instead of enum v3: Re-work driver to be based on generic pin config. Moved config selection from Kconfig to bcm_defconfig. v2: Use hyphens instead of underscore in DT property names. --- arch/arm/configs/bcm_defconfig |1 + arch/arm/mach-bcm/Kconfig |1 + drivers/pinctrl/Kconfig | 12 + drivers/pinctrl/Makefile|1 + drivers/pinctrl/pinctrl-capri.c | 1454 +++ 5 files changed, 1469 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-capri.c diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig index 287ac1d..bede511 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig @@ -126,3 +126,4 @@ CONFIG_CRC_ITU_T=y CONFIG_CRC7=y CONFIG_XZ_DEC=y CONFIG_AVERAGE=y +CONFIG_PINCTRL_CAPRI=y diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index 9fe6d88..b1aa6a9 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -25,6 +25,7 @@ config ARCH_BCM_MOBILE select TICK_ONESHOT select CACHE_L2X0 select HAVE_ARM_ARCH_TIMER + select PINCTRL help This enables support for systems based on Broadcom mobile SoCs. It currently supports the 'BCM281XX' family, which includes diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 33f9dc1..a9f6405 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -104,6 +104,18 @@ config PINCTRL_BCM2835 select PINMUX select PINCONF +config PINCTRL_CAPRI + bool "Broadcom Capri pinctrl driver" + select PINMUX + select PINCONF + select GENERIC_PINCONF + select REGMAP_MMIO + help + Say Y here to support Broadcom Capri pinctrl driver, which is used for + the BCM281xx SoC family, including BCM11130, BCM11140, BCM11351, + BCM28145, and BCM28155 SoCs. This driver requires the pinctrl + framework. GPIO is provided by a separate GPIO driver. + config PINCTRL_IMX bool select PINMUX diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index 4f7be29..86cac40 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -21,6 +21,7 @@ obj-$(CONFIG_PINCTRL_BF60x) += pinctrl-adi2-bf60x.o obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o obj-$(CONFIG_PINCTRL_BAYTRAIL) += pinctrl-baytrail.o +obj-$(CONFIG_PINCTRL_CAPRI)+= pinctrl-capri.o obj-$(CONFIG_PINCTRL_IMX) += pinctrl-imx.o obj-$(CONFIG_PINCTRL_IMX1_CORE)+= pinctrl-imx1-core.o obj-$(CONFIG_PINCTRL_IMX27)+= pinctrl-imx27.o diff --git a/drivers/pinctrl/pinctrl-capri.c b/drivers/pinctrl/pinctrl-capri.c new file mode 100644 index 000..4669c53 --- /dev/null +++ b/drivers/pinctrl/pinctrl-capri.c @@ -0,0 +1,1454 @@ +/* + * Copyright (C) 2013 Broadcom Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "core.h" +#include "pinctrl-utils.h" + +/* Capri Pin Control Registers Definitions */ + +/* Function Select bits are the same for all pin control registers */ +#define CAPRI_PIN_REG_F_SEL_MASK 0x0700 +#define CAPRI_PIN_REG_F_SEL_SHIFT 8 + +/* Standard pin register */ +#define CAPRI_STD_PIN_REG_DRV_STR_MASK 0x0007 +#define CAPRI_STD_PIN_REG_DRV_STR_SHIFT0 +#define CAPRI_STD_PIN_REG_INPUT_DIS_MASK 0x0008 +#define CAPRI_STD_PIN_REG_INPUT_DIS_SHIFT 3 +#define CAPRI_STD_PIN_REG_SLEW_MASK0x0010 +#define CAPRI_STD_PIN_REG_SLEW_SHIFT 4 +#define CAPRI_STD_PIN_REG_PULL_UP_MASK 0x0020 +#define CAPRI_STD_PIN_REG_PULL_UP_SHIFT5 +#define CAPRI_STD_PIN_REG_PULL_DN_MASK 0x0040 +#define CAPRI_STD_PIN_REG_PULL_DN_SHIFT6 +#define CAPRI_STD_PIN_REG_HYST_MASK0x0080 +#define CAPRI_STD_PIN_REG_HYST_SHIFT 7 + +/* I2C pin register */ +#define CAPRI_I2C_PIN_REG_INPUT_DIS_MASK 0x0004 +#define CAPRI_I2C_PIN_REG_INPUT_DIS_SHIFT 2 +#define CAPRI_I2C_PIN_
[PATCH v4 4/4] pinctrl: Enable pinctrl for Broadcom Capri SoCs
Enable pinctrl for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v4: no change v3: No change. v2: Use hyphens instead of underscore in DT property names. --- arch/arm/boot/dts/bcm11351.dtsi |4 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi index b0c0610..dd8e878 100644 --- a/arch/arm/boot/dts/bcm11351.dtsi +++ b/arch/arm/boot/dts/bcm11351.dtsi @@ -142,4 +142,8 @@ status = "disabled"; }; + pinctrl@35004800 { + compatible = "brcm,capri-pinctrl"; + reg = <0x35004800 0x430>; + }; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 4/4] pinctrl: Enable pinctrl for Broadcom Capri SoCs
Enable pinctrl for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v4: no change v3: No change. v2: Use hyphens instead of underscore in DT property names. --- arch/arm/boot/dts/bcm11351.dtsi |4 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi index b0c0610..dd8e878 100644 --- a/arch/arm/boot/dts/bcm11351.dtsi +++ b/arch/arm/boot/dts/bcm11351.dtsi @@ -142,4 +142,8 @@ status = disabled; }; + pinctrl@35004800 { + compatible = brcm,capri-pinctrl; + reg = 0x35004800 0x430; + }; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
Adds pinctrl driver for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v4: - PINCTRL selected in Kconfig, PINCTRL_CAPRI selected in bcm_defconfig - make use of regmap - change CAPRI_PIN_UPDATE from macro to inline function. - Handle pull-up strength arg in Ohm instead of enum v3: Re-work driver to be based on generic pin config. Moved config selection from Kconfig to bcm_defconfig. v2: Use hyphens instead of underscore in DT property names. --- arch/arm/configs/bcm_defconfig |1 + arch/arm/mach-bcm/Kconfig |1 + drivers/pinctrl/Kconfig | 12 + drivers/pinctrl/Makefile|1 + drivers/pinctrl/pinctrl-capri.c | 1454 +++ 5 files changed, 1469 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-capri.c diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig index 287ac1d..bede511 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig @@ -126,3 +126,4 @@ CONFIG_CRC_ITU_T=y CONFIG_CRC7=y CONFIG_XZ_DEC=y CONFIG_AVERAGE=y +CONFIG_PINCTRL_CAPRI=y diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index 9fe6d88..b1aa6a9 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -25,6 +25,7 @@ config ARCH_BCM_MOBILE select TICK_ONESHOT select CACHE_L2X0 select HAVE_ARM_ARCH_TIMER + select PINCTRL help This enables support for systems based on Broadcom mobile SoCs. It currently supports the 'BCM281XX' family, which includes diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 33f9dc1..a9f6405 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -104,6 +104,18 @@ config PINCTRL_BCM2835 select PINMUX select PINCONF +config PINCTRL_CAPRI + bool Broadcom Capri pinctrl driver + select PINMUX + select PINCONF + select GENERIC_PINCONF + select REGMAP_MMIO + help + Say Y here to support Broadcom Capri pinctrl driver, which is used for + the BCM281xx SoC family, including BCM11130, BCM11140, BCM11351, + BCM28145, and BCM28155 SoCs. This driver requires the pinctrl + framework. GPIO is provided by a separate GPIO driver. + config PINCTRL_IMX bool select PINMUX diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index 4f7be29..86cac40 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -21,6 +21,7 @@ obj-$(CONFIG_PINCTRL_BF60x) += pinctrl-adi2-bf60x.o obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o obj-$(CONFIG_PINCTRL_BAYTRAIL) += pinctrl-baytrail.o +obj-$(CONFIG_PINCTRL_CAPRI)+= pinctrl-capri.o obj-$(CONFIG_PINCTRL_IMX) += pinctrl-imx.o obj-$(CONFIG_PINCTRL_IMX1_CORE)+= pinctrl-imx1-core.o obj-$(CONFIG_PINCTRL_IMX27)+= pinctrl-imx27.o diff --git a/drivers/pinctrl/pinctrl-capri.c b/drivers/pinctrl/pinctrl-capri.c new file mode 100644 index 000..4669c53 --- /dev/null +++ b/drivers/pinctrl/pinctrl-capri.c @@ -0,0 +1,1454 @@ +/* + * Copyright (C) 2013 Broadcom Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed as is WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +#include linux/err.h +#include linux/io.h +#include linux/module.h +#include linux/of.h +#include linux/platform_device.h +#include linux/pinctrl/pinctrl.h +#include linux/pinctrl/pinmux.h +#include linux/pinctrl/pinconf.h +#include linux/pinctrl/pinconf-generic.h +#include linux/regmap.h +#include linux/slab.h +#include core.h +#include pinctrl-utils.h + +/* Capri Pin Control Registers Definitions */ + +/* Function Select bits are the same for all pin control registers */ +#define CAPRI_PIN_REG_F_SEL_MASK 0x0700 +#define CAPRI_PIN_REG_F_SEL_SHIFT 8 + +/* Standard pin register */ +#define CAPRI_STD_PIN_REG_DRV_STR_MASK 0x0007 +#define CAPRI_STD_PIN_REG_DRV_STR_SHIFT0 +#define CAPRI_STD_PIN_REG_INPUT_DIS_MASK 0x0008 +#define CAPRI_STD_PIN_REG_INPUT_DIS_SHIFT 3 +#define CAPRI_STD_PIN_REG_SLEW_MASK0x0010 +#define CAPRI_STD_PIN_REG_SLEW_SHIFT 4 +#define CAPRI_STD_PIN_REG_PULL_UP_MASK 0x0020 +#define CAPRI_STD_PIN_REG_PULL_UP_SHIFT5 +#define CAPRI_STD_PIN_REG_PULL_DN_MASK 0x0040 +#define CAPRI_STD_PIN_REG_PULL_DN_SHIFT6 +#define CAPRI_STD_PIN_REG_HYST_MASK0x0080
[PATCH v4 1/4] pinctrl: Add void * to pinctrl_pin_desc
drv_data is added to the pinctrl_pin_desc for drivers to define additional driver-specific per-pin data. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v4: no change v3: no change v2: no change --- include/linux/pinctrl/pinctrl.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index fefb886..cc8e1af 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -32,10 +32,12 @@ struct device_node; * pins, pads or other muxable units in this struct * @number: unique pin number from the global pin number space * @name: a name for this pin + * @drv_data: driver-defined per-pin data. pinctrl core does not touch this */ struct pinctrl_pin_desc { unsigned number; const char *name; + void *drv_data; }; /* Convenience macro to define a single named or anonymous pin descriptor */ -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 3/6] pinctrl: Make PINCTRL selectable by defconfig/menuconfig
On 13-12-20 12:58 PM, Arnd Bergmann wrote: On Friday 20 December 2013, Linus Walleij wrote: On Tue, Dec 17, 2013 at 1:18 AM, Bjorn Andersson bjorn.anders...@sonymobile.com wrote: No matter how we build the individual pinctrl drivers we will always need the pinctrl framework in a multi-soc zImage; so I can't see that we gain anything from being able to compile PINCTRL as a module. I discussed this matter with Christian on IRC and I believe we could basically do select PINCTRL on ARCH_MULTIPLATFORM as the vast majority of multiplatforms appear to be using this anyway, this would make the submenu for pin control pop up in menuconfig for this, and make it possible to move different subdrivers to modules if desired. MULTIPLATFORM does not seem to be about saving footprint bytes on a very fine-granular level anyway, more about doing the module loading/unloading approach to footprint. Let's review the list of platforms that don't select PINCTRL. There are some platforms that are indeed sensitive about memory footprint, and I promised people that converting to multiplatform won't cause a significant increase in kernel binary size as long as no other platforms are enabled. Arnd Ok, for this driver, I'll just select PINCTRL under the ARCH_BCM_MOBILE. We can move this to ARCH_MULTIPLATFORM once we're sure this is okay for other platforms. Regards, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 0/6] Add Broadcom Capri pinctrl driver
The following patches adds a pinctrl driver for Broadcom Capri (BCM281xx) SoCs. The first patch, adding the void * to pinctrl_pin_desc, has been previously discussed with LinusW. See this thread: http://lists.infradead.org/pipermail/linux-arm-kernel/2013-April/165880.html --- v4: - removed patch to add new properties to generic pinconfig (merged) - Updated bias-pull-up property to accept R value in Ohms instead of an enum - move PINCTRL_CAPRI to defconfig - Use regmap MMIO v3: Re-worked driver to be based on generic pinconfig, addressed review comments and other supporting changes: - moved config selection from Kconfig to defconfig - added slew-rate, input enable, input disable properties for generic pinconfig - added a description for PINCTRL config v2: Use hyphens instead of underscore in DT property names. Sherman Yin (6): pinctrl: Add void * to pinctrl_pin_desc pinctrl: Adds slew-rate, input-enable/disable pinctrl: Make PINCTRL selectable by defconfig/menuconfig pinctrl: Add pinctrl binding for Broadcom Capri SoCs ARM: pinctrl: Add Broadcom Capri pinctrl driver pinctrl: Enable pinctrl for Broadcom Capri SoCs .../bindings/pinctrl/brcm,capri-pinctrl.txt| 429 ++ .../bindings/pinctrl/pinctrl-bindings.txt |3 + arch/arm/boot/dts/bcm11351.dtsi|4 + arch/arm/configs/bcm_defconfig |5 + drivers/pinctrl/Kconfig| 13 +- drivers/pinctrl/Makefile |1 + drivers/pinctrl/pinconf-generic.c |4 + drivers/pinctrl/pinctrl-capri.c| 1408 include/linux/pinctrl/pinconf-generic.h|4 + include/linux/pinctrl/pinctrl.h|2 + 10 files changed, 1872 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt create mode 100644 drivers/pinctrl/pinctrl-capri.c -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v4 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v4: Changed valid values for bias-pull-up property for I2C pins. Expanded pin configuration node example. v3: Use generic pin config properties instead of brcm-specific ones. Clarified pin types (standard, i2c, hdmi). v2: Use hyphens instead of underscore in DT property names. --- .../bindings/pinctrl/brcm,capri-pinctrl.txt| 461 1 file changed, 461 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt new file mode 100644 index 000..9e9e9ef --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt @@ -0,0 +1,461 @@ +Broadcom Capri Pin Controller + +This is a pin controller for the Broadcom BCM281xx SoC family, which includes +BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. + +=== Pin Controller Node === + +Required Properties: + +- compatible: Must be brcm,capri-pinctrl. +- reg: Base address of the PAD Controller register block and the size + of the block. + +For example, the following is the bare minimum node: + + pinctrl@35004800 { + compatible = brcm,capri-pinctrl; + reg = 0x35004800 0x430; + }; + +As a pin controller device, in addition to the required properties, this node +should also contain the pin configuration nodes that client devices reference, +if any. + +=== Pin Configuration Node === + +Each pin configuration node is a sub-node of the pin controller node and is a +container of an arbitrary number of subnodes, called pin group nodes in this +document. + +Please refer to the pinctrl-bindings.txt in this directory for details of the +common pinctrl bindings used by client devices, including the definition of a +pin configuration node. + +=== Pin Group Node === + +A pin group node specifies the desired pin mux and/or pin configuration for an +arbitrary number of pins. The name of the pin group node is optional and not +used. + +A pin group node only affects the properties specified in the node, and has no +effect on any properties that are omitted. + +The pin group node accepts a subset of the generic pin config properties. For +details generic pin config properties, please refer to pinctrl-bindings.txt +and include/linux/pinctrl/pinconfig-generic.h. + +Each pin controlled by this pin controller belong to one of three types: +Standard, I2C, and HDMI. Each type accepts a different set of pin config +properties. A list of pins and their types is provided below. + +Required Properties (applicable to all pins): + +- pins:Multiple strings. Specifies the name(s) of one or more pins to + be configured by this node. + +Optional Properties (for standard pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: alt1, alt2, alt3, alt4 +- input-schmitt-enable:No arguments. Enable schmitt-trigger mode. +- input-schmitt-disable: No arguments. Disable schmitt-trigger mode. +- bias-pull-up:No arguments. Pull up on pin. +- bias-pull-down: No arguments. Pull down on pin. +- bias-disable:No arguments. Disable pin bias. +- slew-rate: Integer. Meaning depends on configured pin mux: + *_SCL or *_SDA: + 0: Standard(100kbps) Fast(400kbps) mode + 1: Highspeed (3.4Mbps) mode + IC_DM or IC_DP: + 0: normal slew rate + 1: fast slew rate + Otherwise: + 0: fast slew rate + 1: normal slew rate +- input-enable:No arguements. Enable input (does not affect + output.) +- input-disable: No arguements. Disable input (does not affect + output.) +- drive-strength: Integer. Drive strength in mA. Valid values are + 2, 4, 6, 8, 10, 12, 14, 16 mA. + +Optional Properties (for I2C pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: alt1, alt2, alt3, alt4 +- bias-pull-up:Integer. Pull up strength in Ohm. There are 3 + pull-up resisitors (1.2k, 1.8k, 2.7k) available
Re: [PATCH v3 5/6] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-12-18 03:56 PM, Sherman Yin wrote: On 13-12-12 12:54 PM, Linus Walleij wrote: +/* + * Write to the register using the value and mask if current value is different + */ +static void capri_reg_write(struct pinctrl_dev *pctldev, + void __iomem *reg, + u32 val, + u32 mask) +{ + u32 old_val; + u32 new_val; + + old_val = readl(reg); + new_val = (old_val ~mask) | (val mask); + + if (new_val == old_val) { + dev_dbg(pctldev-dev, + Reg 0x%p=0x%x (no change)\n, + reg, old_val); + return; + } + + dev_dbg(pctldev-dev, + Reg 0x%p change from 0x%x to 0x%x\n, + reg, old_val, new_val); + writel(new_val, reg); +} This is a reimplementation of regmap for MMIO. See drivers/base/regmap/regmap-mmio.c Notice how regmap_update_bits() is used throughout the kernel. If you want to do this, use regmap. Ok. As you can see in v4 of my patchset, I've changed my driver to use the mmio regmap. However, as I was tracing through regmap_update_bits(), it looks like I have to go through a lot of checks and function pointers just to do a simple write to a register. Also, I have to select REGMAP_MMIO which brings in a bunch of code as well. I understand the benefits of using common code, but in this case it seems there is a lot of extra code and run-time overhead to use regmap. In the end it also doesn't buy much in terms of functionality. Just a quick note - it looks like the 2nd parameter of regmap_update_bits() wants the offset of a register (offset from regmap_mmio_context.regs). So calling the parameter reg is a little confusing, at least in the MMIO case. Regards, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 5/6] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-12-13 02:22 AM, Mark Brown wrote: On Thu, Dec 12, 2013 at 09:54:50PM +0100, Linus Walleij wrote: This is a reimplementation of regmap for MMIO. See drivers/base/regmap/regmap-mmio.c Notice how regmap_update_bits() is used throughout the kernel. If you want to do this, use regmap. Or if this is very performance sensitive (which I'd not expect for pinctrl) there's a helper in review at the minute which just uses a spinlock. Thanks Mark. It's not expected to be performance sensitive, so I'll probably go with regmap. Regards, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 5/6] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-12-12 12:54 PM, Linus Walleij wrote: +#define CAPRI_PIN_SHIFT(type, param) \ + (CAPRI_ ## type ## _PIN_REG_ ## param ## _SHIFT) + +#define CAPRI_PIN_MASK(type, param) \ + (CAPRI_ ## type ## _PIN_REG_ ## param ## _MASK) + +/* Macro to update reg with new pin config param */ +#define CAPRI_PIN_UPDATE(reg, type, param, val) \ + (((reg) & ~CAPRI_PIN_MASK(type, param)) | \ + (((val) << CAPRI_PIN_SHIFT(type, param)) & CAPRI_PIN_MASK(type, param))) Yuck! Are you sure you cannot convert these to static inlines and make them much simpler in the process? We do have an optimizing compiler, you don't need to do everything on one line... besides we're not on the hotpath. If I were to convert the first 2 #defines to functions, it would either be a 2-level switch statement or a 2D lookup table. IMO both of these options are more difficult to read than this simple concatenation, so I really rather keep them this way. CAPRI_PIN_UPDATE, OTOH, doesn't require any concatenation so I can easily make that into an inline. +/* + * Write to the register using the value and mask if current value is different + */ +static void capri_reg_write(struct pinctrl_dev *pctldev, + void __iomem *reg, + u32 val, + u32 mask) +{ + u32 old_val; + u32 new_val; + + old_val = readl(reg); + new_val = (old_val & ~mask) | (val & mask); + + if (new_val == old_val) { + dev_dbg(pctldev->dev, + "Reg 0x%p=0x%x (no change)\n", + reg, old_val); + return; + } + + dev_dbg(pctldev->dev, + "Reg 0x%p change from 0x%x to 0x%x\n", + reg, old_val, new_val); + writel(new_val, reg); +} This is a reimplementation of regmap for MMIO. See drivers/base/regmap/regmap-mmio.c Notice how regmap_update_bits() is used throughout the kernel. If you want to do this, use regmap. Ok. + case PIN_CONFIG_DRIVE_STRENGTH: + /* Valid range is 2-16 mA, even numbers only */ + if ((arg < 2) || (arg > 16) || (arg % 2)) { + dev_err(pctldev->dev, + "Invalid Drive Strength value (%d) for " + "pin %s (%d). Valid values are " + "(2..16) mA, even numbers only.\n", + arg, pdata->pins[pin].name, pin); + return -EINVAL; + } + *val = CAPRI_PIN_UPDATE(*val, STD, DRV_STR, (arg/2)-1); + *mask |= CAPRI_STD_PIN_REG_DRV_STR_MASK; + break; Hm rather nice integer math... Sorry, I can't tell if you are being sarcastic :) Drive strength is represented by 3 bits in the register. If the values were 2-14 I could have done some bit-checking instead of those 3 conditions in the if statement. Or, if we use a enum of 0-7 then the check is much easier. But as we discussed re: pull-up resistance, we rather let users specify real numbers. The (arg/2)-1 is just to convert the mA into the 3 bits. +/* Goes through the configs and update register val/mask */ +static int capri_i2c_pin_update(struct pinctrl_dev *pctldev, + unsigned pin, + unsigned long *configs, + unsigned num_configs, + u32 *val, + u32 *mask) +{ + struct capri_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev); + int i; + enum pin_config_param param; + u16 arg; + + for (i = 0; i < num_configs; i++) { + param = pinconf_to_config_param(configs[i]); + arg = pinconf_to_config_argument(configs[i]); + + switch (param) { + case PIN_CONFIG_BIAS_PULL_UP: + if ((arg < 1) || (arg > 7)) { + dev_err(pctldev->dev, + "Invalid Pull Up value (%d) for pin %s " + "(%d). Valid values are (1..7).\n", + arg, pdata->pins[pin].name, pin); + return -EINVAL; + } No don't do that as mentioned in the other patch. Pass pull up strength in Ohms. Then have a translation table here, and do some best-effort fuzzy match. Sure. I'm just going to error out if the user-supplied value is off, since it is very clear what is acceptable from the binding documentation. + /* Different pins have different configuration options */ + switch (pin_type) { + case CAPRI_PIN_TYPE_STD: + rc =
Re: [PATCH v3 5/6] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-12-12 12:54 PM, Linus Walleij wrote: +#define CAPRI_PIN_SHIFT(type, param) \ + (CAPRI_ ## type ## _PIN_REG_ ## param ## _SHIFT) + +#define CAPRI_PIN_MASK(type, param) \ + (CAPRI_ ## type ## _PIN_REG_ ## param ## _MASK) + +/* Macro to update reg with new pin config param */ +#define CAPRI_PIN_UPDATE(reg, type, param, val) \ + (((reg) ~CAPRI_PIN_MASK(type, param)) | \ + (((val) CAPRI_PIN_SHIFT(type, param)) CAPRI_PIN_MASK(type, param))) Yuck! Are you sure you cannot convert these to static inlines and make them much simpler in the process? We do have an optimizing compiler, you don't need to do everything on one line... besides we're not on the hotpath. If I were to convert the first 2 #defines to functions, it would either be a 2-level switch statement or a 2D lookup table. IMO both of these options are more difficult to read than this simple concatenation, so I really rather keep them this way. CAPRI_PIN_UPDATE, OTOH, doesn't require any concatenation so I can easily make that into an inline. +/* + * Write to the register using the value and mask if current value is different + */ +static void capri_reg_write(struct pinctrl_dev *pctldev, + void __iomem *reg, + u32 val, + u32 mask) +{ + u32 old_val; + u32 new_val; + + old_val = readl(reg); + new_val = (old_val ~mask) | (val mask); + + if (new_val == old_val) { + dev_dbg(pctldev-dev, + Reg 0x%p=0x%x (no change)\n, + reg, old_val); + return; + } + + dev_dbg(pctldev-dev, + Reg 0x%p change from 0x%x to 0x%x\n, + reg, old_val, new_val); + writel(new_val, reg); +} This is a reimplementation of regmap for MMIO. See drivers/base/regmap/regmap-mmio.c Notice how regmap_update_bits() is used throughout the kernel. If you want to do this, use regmap. Ok. + case PIN_CONFIG_DRIVE_STRENGTH: + /* Valid range is 2-16 mA, even numbers only */ + if ((arg 2) || (arg 16) || (arg % 2)) { + dev_err(pctldev-dev, + Invalid Drive Strength value (%d) for + pin %s (%d). Valid values are + (2..16) mA, even numbers only.\n, + arg, pdata-pins[pin].name, pin); + return -EINVAL; + } + *val = CAPRI_PIN_UPDATE(*val, STD, DRV_STR, (arg/2)-1); + *mask |= CAPRI_STD_PIN_REG_DRV_STR_MASK; + break; Hm rather nice integer math... Sorry, I can't tell if you are being sarcastic :) Drive strength is represented by 3 bits in the register. If the values were 2-14 I could have done some bit-checking instead of those 3 conditions in the if statement. Or, if we use a enum of 0-7 then the check is much easier. But as we discussed re: pull-up resistance, we rather let users specify real numbers. The (arg/2)-1 is just to convert the mA into the 3 bits. +/* Goes through the configs and update register val/mask */ +static int capri_i2c_pin_update(struct pinctrl_dev *pctldev, + unsigned pin, + unsigned long *configs, + unsigned num_configs, + u32 *val, + u32 *mask) +{ + struct capri_pinctrl_data *pdata = pinctrl_dev_get_drvdata(pctldev); + int i; + enum pin_config_param param; + u16 arg; + + for (i = 0; i num_configs; i++) { + param = pinconf_to_config_param(configs[i]); + arg = pinconf_to_config_argument(configs[i]); + + switch (param) { + case PIN_CONFIG_BIAS_PULL_UP: + if ((arg 1) || (arg 7)) { + dev_err(pctldev-dev, + Invalid Pull Up value (%d) for pin %s + (%d). Valid values are (1..7).\n, + arg, pdata-pins[pin].name, pin); + return -EINVAL; + } No don't do that as mentioned in the other patch. Pass pull up strength in Ohms. Then have a translation table here, and do some best-effort fuzzy match. Sure. I'm just going to error out if the user-supplied value is off, since it is very clear what is acceptable from the binding documentation. + /* Different pins have different configuration options */ + switch (pin_type) { + case CAPRI_PIN_TYPE_STD: + rc = capri_std_pin_update(pctldev, pin, configs, num_configs, +
Re: [PATCH v3 5/6] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-12-13 02:22 AM, Mark Brown wrote: On Thu, Dec 12, 2013 at 09:54:50PM +0100, Linus Walleij wrote: This is a reimplementation of regmap for MMIO. See drivers/base/regmap/regmap-mmio.c Notice how regmap_update_bits() is used throughout the kernel. If you want to do this, use regmap. Or if this is very performance sensitive (which I'd not expect for pinctrl) there's a helper in review at the minute which just uses a spinlock. Thanks Mark. It's not expected to be performance sensitive, so I'll probably go with regmap. Regards, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
On 13-12-16 05:17 AM, Linus Walleij wrote: On Sat, Dec 14, 2013 at 2:16 AM, Sherman Yin wrote: +- bias-pull-up:Integer. Pull up strength in Ohm: + 1: 1.2 kOhm + 2: 1.8 kOhm + 3: 720 Ohm + 4: 2.7 kOhm + 5: 831 Ohm + 6: 1.08 kOhm + 7: 568 Ohm Please do not use these custom enumerators 1 thru 7. Instead say that the argument is given in ohms, so for example: bias-pull-up = <12000>; Then translate this into the proper enumerator in your driver instead. Ok. The 3 bits in this enumeration correspond to enabling the 3 pull up Rs (1.2k, 1.8k, 2.7k) in parallel, so the enum kind of make sense. But sure I can change it to actual ohms and will error out in the driver if specified value is not one of the 7. Aha, that's how they do it :-) Please write this in a comment in the driver because it makes it a lot easier to understand what is going on, and e.g. how to fuzz an apropriate resistance. Yes, I plan to explain where those odd numbers come from in this file. Can you tell me something about how such resistors are produced in silicon? Sorry I'm not quite sure. I only know a little bit of the circuitry down to the schematic level... Regards, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
On 13-12-16 05:17 AM, Linus Walleij wrote: On Sat, Dec 14, 2013 at 2:16 AM, Sherman Yin s...@broadcom.com wrote: +- bias-pull-up:Integer. Pull up strength in Ohm: + 1: 1.2 kOhm + 2: 1.8 kOhm + 3: 720 Ohm + 4: 2.7 kOhm + 5: 831 Ohm + 6: 1.08 kOhm + 7: 568 Ohm Please do not use these custom enumerators 1 thru 7. Instead say that the argument is given in ohms, so for example: bias-pull-up = 12000; Then translate this into the proper enumerator in your driver instead. Ok. The 3 bits in this enumeration correspond to enabling the 3 pull up Rs (1.2k, 1.8k, 2.7k) in parallel, so the enum kind of make sense. But sure I can change it to actual ohms and will error out in the driver if specified value is not one of the 7. Aha, that's how they do it :-) Please write this in a comment in the driver because it makes it a lot easier to understand what is going on, and e.g. how to fuzz an apropriate resistance. Yes, I plan to explain where those odd numbers come from in this file. Can you tell me something about how such resistors are produced in silicon? Sorry I'm not quite sure. I only know a little bit of the circuitry down to the schematic level... Regards, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
On 13-12-12 12:37 PM, Linus Walleij wrote: On Wed, Dec 11, 2013 at 7:37 PM, Sherman Yin wrote: Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v3: Use generic pin config properties instead of brcm-specific ones. Clarified pin types (standard, i2c, hdmi). v2: Use hyphens instead of underscore in DT property names. Overall this is very nice! Thanks! +- bias-pull-up:Integer. Pull up strength in Ohm: + 1: 1.2 kOhm + 2: 1.8 kOhm + 3: 720 Ohm + 4: 2.7 kOhm + 5: 831 Ohm + 6: 1.08 kOhm + 7: 568 Ohm Please do not use these custom enumerators 1 thru 7. Instead say that the argument is given in ohms, so for example: bias-pull-up = <12000>; Then translate this into the proper enumerator in your driver instead. Ok. The 3 bits in this enumeration correspond to enabling the 3 pull up Rs (1.2k, 1.8k, 2.7k) in parallel, so the enum kind of make sense. But sure I can change it to actual ohms and will error out in the driver if specified value is not one of the 7. No full example provided in the binding! This needs to be there for understanding. Ok Will add some examples. Thanks, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
On 13-12-12 12:37 PM, Linus Walleij wrote: On Wed, Dec 11, 2013 at 7:37 PM, Sherman Yin s...@broadcom.com wrote: Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v3: Use generic pin config properties instead of brcm-specific ones. Clarified pin types (standard, i2c, hdmi). v2: Use hyphens instead of underscore in DT property names. Overall this is very nice! Thanks! +- bias-pull-up:Integer. Pull up strength in Ohm: + 1: 1.2 kOhm + 2: 1.8 kOhm + 3: 720 Ohm + 4: 2.7 kOhm + 5: 831 Ohm + 6: 1.08 kOhm + 7: 568 Ohm Please do not use these custom enumerators 1 thru 7. Instead say that the argument is given in ohms, so for example: bias-pull-up = 12000; Then translate this into the proper enumerator in your driver instead. Ok. The 3 bits in this enumeration correspond to enabling the 3 pull up Rs (1.2k, 1.8k, 2.7k) in parallel, so the enum kind of make sense. But sure I can change it to actual ohms and will error out in the driver if specified value is not one of the 7. No full example provided in the binding! This needs to be there for understanding. Ok Will add some examples. Thanks, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 5/6] ARM: pinctrl: Add Broadcom Capri pinctrl driver
Adds pinctrl driver for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v3: Re-work driver to be based on generic pin config. Moved config selection from Kconfig to bcm_defconfig. v2: Use hyphens instead of underscore in DT property names. --- arch/arm/configs/bcm_defconfig |5 + drivers/pinctrl/Kconfig | 11 + drivers/pinctrl/Makefile|1 + drivers/pinctrl/pinctrl-capri.c | 1408 +++ 4 files changed, 1425 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-capri.c diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig index 287ac1d..6b94987 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig @@ -126,3 +126,8 @@ CONFIG_CRC_ITU_T=y CONFIG_CRC7=y CONFIG_XZ_DEC=y CONFIG_AVERAGE=y +CONFIG_PINCTRL=y +CONFIG_PINMUX=y +CONFIG_PINCONF=y +CONFIG_GENERIC_PINCONF=y +CONFIG_PINCTRL_CAPRI=y diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index a921ff1..664c8e6 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -104,6 +104,17 @@ config PINCTRL_BCM2835 select PINMUX select PINCONF +config PINCTRL_CAPRI + bool "Broadcom Capri pinctrl driver" + select PINMUX + select PINCONF + select GENERIC_PINCONF + help + Say Y here to support Broadcom Capri pinctrl driver, which is used for + the BCM281xx SoC family, including BCM11130, BCM11140, BCM11351, + BCM28145, and BCM28155 SoCs. This driver requires the pinctrl + framework. GPIO is provided by a separate GPIO driver. + config PINCTRL_IMX bool select PINMUX diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index 4f7be29..86cac40 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -21,6 +21,7 @@ obj-$(CONFIG_PINCTRL_BF60x) += pinctrl-adi2-bf60x.o obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o obj-$(CONFIG_PINCTRL_BAYTRAIL) += pinctrl-baytrail.o +obj-$(CONFIG_PINCTRL_CAPRI)+= pinctrl-capri.o obj-$(CONFIG_PINCTRL_IMX) += pinctrl-imx.o obj-$(CONFIG_PINCTRL_IMX1_CORE)+= pinctrl-imx1-core.o obj-$(CONFIG_PINCTRL_IMX27)+= pinctrl-imx27.o diff --git a/drivers/pinctrl/pinctrl-capri.c b/drivers/pinctrl/pinctrl-capri.c new file mode 100644 index 000..d468de6 --- /dev/null +++ b/drivers/pinctrl/pinctrl-capri.c @@ -0,0 +1,1408 @@ +/* + * Copyright (C) 2013 Broadcom Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "core.h" +#include "pinctrl-utils.h" + +/* Capri Pin Control Registers Definitions */ + +/* Function Select bits are the same for all pin control registers */ +#define CAPRI_PIN_REG_F_SEL_MASK 0x0700 +#define CAPRI_PIN_REG_F_SEL_SHIFT 8 + +/* Standard pin register */ +#define CAPRI_STD_PIN_REG_DRV_STR_MASK 0x0007 +#define CAPRI_STD_PIN_REG_DRV_STR_SHIFT0 +#define CAPRI_STD_PIN_REG_INPUT_DIS_MASK 0x0008 +#define CAPRI_STD_PIN_REG_INPUT_DIS_SHIFT 3 +#define CAPRI_STD_PIN_REG_SLEW_MASK0x0010 +#define CAPRI_STD_PIN_REG_SLEW_SHIFT 4 +#define CAPRI_STD_PIN_REG_PULL_UP_MASK 0x0020 +#define CAPRI_STD_PIN_REG_PULL_UP_SHIFT5 +#define CAPRI_STD_PIN_REG_PULL_DN_MASK 0x0040 +#define CAPRI_STD_PIN_REG_PULL_DN_SHIFT6 +#define CAPRI_STD_PIN_REG_HYST_MASK0x0080 +#define CAPRI_STD_PIN_REG_HYST_SHIFT 7 + +/* I2C pin register */ +#define CAPRI_I2C_PIN_REG_INPUT_DIS_MASK 0x0004 +#define CAPRI_I2C_PIN_REG_INPUT_DIS_SHIFT 2 +#define CAPRI_I2C_PIN_REG_SLEW_MASK0x0008 +#define CAPRI_I2C_PIN_REG_SLEW_SHIFT 3 +#define CAPRI_I2C_PIN_REG_PULL_UP_STR_MASK 0x0070 +#define CAPRI_I2C_PIN_REG_PULL_UP_STR_SHIFT4 + +/* HDMI pin register */ +#define CAPRI_HDMI_PIN_REG_INPUT_DIS_MASK 0x0008 +#define CAPRI_HDMI_PIN_REG_INPUT_DIS_SHIFT 3 +#define CAPRI_HDMI_PIN_REG_MODE_MASK 0x0010 +#define CAPRI_HDMI_PIN_REG_MODE_SHIFT 4 + +/** + * capri_pin_type - types of pin register + */ +enum capri_pin_type { + CAPRI_PIN_TYPE_UNKNOWN = 0, + CAPRI_PIN_TYPE_STD, + CAPRI_PIN_TYPE_I2C, + CAPRI_PIN_TYPE_HDMI, +}; + +static enum capri_pin_type std_pin = CAPRI_PIN_TYPE_
[PATCH v3 2/6] pinctrl: Adds slew-rate, input-enable/disable
This commit adds slew-rate and input-enable/disable support for pinconf -generic. Signed-off-by: Sherman Yin --- v3: added to patchset .../bindings/pinctrl/pinctrl-bindings.txt |3 +++ drivers/pinctrl/pinconf-generic.c |4 include/linux/pinctrl/pinconf-generic.h|4 3 files changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt index 1958ca9..4414163 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt @@ -151,6 +151,8 @@ drive-push-pull - drive actively high and low drive-open-drain - drive with open drain drive-open-source - drive with open source drive-strength - sink or source at most X mA +input-enable - enable input on pin (no effect on output) +input-disable - disable input on pin (no effect on output) input-schmitt-enable - enable schmitt-trigger mode input-schmitt-disable - disable schmitt-trigger mode input-debounce - debounce mode with debound time X @@ -158,6 +160,7 @@ low-power-enable- enable low power mode low-power-disable - disable low power mode output-low - set the pin to output mode with low level output-high- set the pin to output mode with high level +slew-rate - set the slew rate Some of the generic properties take arguments. For those that do, the arguments are described below. diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index 55a0ebe..3d9a999 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -48,6 +48,7 @@ static struct pin_config_item conf_items[] = { PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, "output drive open drain", NULL), PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL), PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH, "output drive strength", "mA"), + PCONFDUMP(PIN_CONFIG_INPUT_ENABLE, "input enabled", NULL), PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT_ENABLE, "input schmitt enabled", NULL), PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, "input schmitt trigger", NULL), PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, "input debounce", "usec"), @@ -160,6 +161,8 @@ static struct pinconf_generic_dt_params dt_params[] = { { "drive-open-drain", PIN_CONFIG_DRIVE_OPEN_DRAIN, 0 }, { "drive-open-source", PIN_CONFIG_DRIVE_OPEN_SOURCE, 0 }, { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 0 }, + { "input-enable", PIN_CONFIG_INPUT_ENABLE, 1 }, + { "input-disable", PIN_CONFIG_INPUT_ENABLE, 0 }, { "input-schmitt-enable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 1 }, { "input-schmitt-disable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 0 }, { "input-debounce", PIN_CONFIG_INPUT_DEBOUNCE, 0 }, @@ -167,6 +170,7 @@ static struct pinconf_generic_dt_params dt_params[] = { { "low-power-disable", PIN_CONFIG_LOW_POWER_MODE, 0 }, { "output-low", PIN_CONFIG_OUTPUT, 0, }, { "output-high", PIN_CONFIG_OUTPUT, 1, }, + { "slew-rate", PIN_CONFIG_SLEW_RATE, 0}, }; /** diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index fb90ef5..0db67bf 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h @@ -61,6 +61,9 @@ * argument is ignored. * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current * passed as argument. The argument is in mA. + * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not + * affect the pin's ability to drive output. 1 enables input, 0 disables + * input. * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, * schmitt-trigger mode is disabled. @@ -99,6 +102,7 @@ enum pin_config_param { PIN_CONFIG_DRIVE_OPEN_DRAIN, PIN_CONFIG_DRIVE_OPEN_SOURCE, PIN_CONFIG_DRIVE_STRENGTH, + PIN_CONFIG_INPUT_ENABLE, PIN_CONFIG_INPUT_SCHMITT_ENABLE, PIN_CONFIG_INPUT_SCHMITT, PIN_CONFIG_INPUT_DEBOUNCE, -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 6/6] pinctrl: Enable pinctrl for Broadcom Capri SoCs
Enable pinctrl for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v3: no change v2: no change --- arch/arm/boot/dts/bcm11351.dtsi |4 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi index b0c0610..dd8e878 100644 --- a/arch/arm/boot/dts/bcm11351.dtsi +++ b/arch/arm/boot/dts/bcm11351.dtsi @@ -142,4 +142,8 @@ status = "disabled"; }; + pinctrl@35004800 { + compatible = "brcm,capri-pinctrl"; + reg = <0x35004800 0x430>; + }; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 0/6] Add Broadcom Capri pinctrl driver
The following patches adds a pinctrl driver for Broadcom Capri (BCM281xx) SoCs. The first patch, adding the void * to pinctrl_pin_desc, has been previously discussed with LinusW. See this thread: http://lists.infradead.org/pipermail/linux-arm-kernel/2013-April/165880.html --- v3: Re-worked driver to be based on generic pinconfig, addressed review comments and other supporting changes: - moved config selection from Kconfig to defconfig - added slew-rate, input enable, input disable properties for generic pinconfig - added a description for PINCTRL config v2: Use hyphens instead of underscore in DT property names. Sherman Yin (6): pinctrl: Add void * to pinctrl_pin_desc pinctrl: Adds slew-rate, input-enable/disable pinctrl: Make PINCTRL selectable by defconfig/menuconfig pinctrl: Add pinctrl binding for Broadcom Capri SoCs ARM: pinctrl: Add Broadcom Capri pinctrl driver pinctrl: Enable pinctrl for Broadcom Capri SoCs .../bindings/pinctrl/brcm,capri-pinctrl.txt| 429 ++ .../bindings/pinctrl/pinctrl-bindings.txt |3 + arch/arm/boot/dts/bcm11351.dtsi|4 + arch/arm/configs/bcm_defconfig |5 + drivers/pinctrl/Kconfig| 13 +- drivers/pinctrl/Makefile |1 + drivers/pinctrl/pinconf-generic.c |4 + drivers/pinctrl/pinctrl-capri.c| 1408 include/linux/pinctrl/pinconf-generic.h|4 + include/linux/pinctrl/pinctrl.h|2 + 10 files changed, 1872 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt create mode 100644 drivers/pinctrl/pinctrl-capri.c -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v3: Use generic pin config properties instead of brcm-specific ones. Clarified pin types (standard, i2c, hdmi). v2: Use hyphens instead of underscore in DT property names. --- .../bindings/pinctrl/brcm,capri-pinctrl.txt| 429 1 file changed, 429 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt new file mode 100644 index 000..7973cbd --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt @@ -0,0 +1,429 @@ +Broadcom Capri Pin Controller + +This is a pin controller for the Broadcom BCM281xx SoC family, which includes +BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. + +=== Pin Controller Node === + +Required Properties: + +- compatible: Must be "brcm,capri-pinctrl". +- reg: Base address of the PAD Controller register block and the size + of the block. + +For example, the following is the bare minimum node: + + pinctrl@35004800 { + compatible = "brcm,capri-pinctrl"; + reg = <0x35004800 0x430>; + }; + +As a pin controller device, in addition to the required properties, this node +should also contain the pin configuration nodes that client devices reference, +if any. + +=== Pin Configuration Node === + +Each pin configuration node is a sub-node of the pin controller node and is a +container of an arbitrary number of subnodes, called pin group nodes in this +document. + +Please refer to the pinctrl-bindings.txt in this directory for details of the +common pinctrl bindings used by client devices, including the definition of a +"pin configuration node". + +=== Pin Group Node === + +A pin group node specifies the desired pin mux and/or pin configuration for an +arbitrary number of pins. The name of the pin group node is optional and not +used. + +A pin group node only affects the properties specified in the node, and has no +effect on any properties that are omitted. + +The pin group node accepts a subset of the generic pin config properties. For +details generic pin config properties, please refer to pinctrl-bindings.txt +and . + +Each pin controlled by this pin controller belong to one of three types: +Standard, I2C, and HDMI. Each type accepts a different set of pin config +properties. A list of pins and their types is provided below. + +Required Properties (applicable to all pins): + +- pins:Multiple strings. Specifies the name(s) of one or more pins to + be configured by this node. + +Optional Properties (for standard pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: "alt1", "alt2", "alt3", "alt4" +- input-schmitt-enable:No arguments. Enable schmitt-trigger mode. +- input-schmitt-disable: No arguments. Disable schmitt-trigger mode. +- bias-pull-up:No arguments. Pull up on pin. +- bias-pull-down: No arguments. Pull down on pin. +- bias-disable:No arguments. Disable pin bias. +- slew-rate: Integer. Meaning depends on configured pin mux: + *_SCL or *_SDA: + 0: Standard(100kbps)& Fast(400kbps) mode + 1: Highspeed (3.4Mbps) mode + IC_DM or IC_DP: + 0: normal slew rate + 1: fast slew rate + Otherwise: + 0: fast slew rate + 1: normal slew rate +- input-enable:No arguements. Enable input (does not affect + output.) +- input-disable: No arguements. Disable input (does not affect + output.) +- drive-strength: Integer. Drive strength in mA. Valid values are + 2, 4, 6, 8, 10, 12, 14, 16 mA. + +Optional Properties (for I2C pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: "alt1", "alt2", "alt3", "alt4" +- bias-pull-up:Integer. Pull up strength in Ohm: + 1: 1.2 kOhm + 2: 1.8 kOhm + 3: 720 Ohm +
[PATCH v3 3/6] pinctrl: Make PINCTRL selectable by defconfig/menuconfig
Adds a string to the PINCTRL config option so that 1) CONFIG_PINCTRL=y would not be erased by make config, and 2) PINCTRL option would show up in menuconfig. Signed-off-by: Sherman Yin --- v3: added to patchset drivers/pinctrl/Kconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 33f9dc1..a921ff1 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -3,7 +3,7 @@ # config PINCTRL - bool + bool "Enable the pinctrl framework" if PINCTRL -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 1/6] pinctrl: Add void * to pinctrl_pin_desc
drv_data is added to the pinctrl_pin_desc for drivers to define additional driver-specific per-pin data. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v3: no change v2: no change --- include/linux/pinctrl/pinctrl.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index fefb886..cc8e1af 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -32,10 +32,12 @@ struct device_node; * pins, pads or other muxable units in this struct * @number: unique pin number from the global pin number space * @name: a name for this pin + * @drv_data: driver-defined per-pin data. pinctrl core does not touch this */ struct pinctrl_pin_desc { unsigned number; const char *name; + void *drv_data; }; /* Convenience macro to define a single named or anonymous pin descriptor */ -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 1/6] pinctrl: Add void * to pinctrl_pin_desc
drv_data is added to the pinctrl_pin_desc for drivers to define additional driver-specific per-pin data. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v3: no change v2: no change --- include/linux/pinctrl/pinctrl.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index fefb886..cc8e1af 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -32,10 +32,12 @@ struct device_node; * pins, pads or other muxable units in this struct * @number: unique pin number from the global pin number space * @name: a name for this pin + * @drv_data: driver-defined per-pin data. pinctrl core does not touch this */ struct pinctrl_pin_desc { unsigned number; const char *name; + void *drv_data; }; /* Convenience macro to define a single named or anonymous pin descriptor */ -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 4/6] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v3: Use generic pin config properties instead of brcm-specific ones. Clarified pin types (standard, i2c, hdmi). v2: Use hyphens instead of underscore in DT property names. --- .../bindings/pinctrl/brcm,capri-pinctrl.txt| 429 1 file changed, 429 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt new file mode 100644 index 000..7973cbd --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt @@ -0,0 +1,429 @@ +Broadcom Capri Pin Controller + +This is a pin controller for the Broadcom BCM281xx SoC family, which includes +BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. + +=== Pin Controller Node === + +Required Properties: + +- compatible: Must be brcm,capri-pinctrl. +- reg: Base address of the PAD Controller register block and the size + of the block. + +For example, the following is the bare minimum node: + + pinctrl@35004800 { + compatible = brcm,capri-pinctrl; + reg = 0x35004800 0x430; + }; + +As a pin controller device, in addition to the required properties, this node +should also contain the pin configuration nodes that client devices reference, +if any. + +=== Pin Configuration Node === + +Each pin configuration node is a sub-node of the pin controller node and is a +container of an arbitrary number of subnodes, called pin group nodes in this +document. + +Please refer to the pinctrl-bindings.txt in this directory for details of the +common pinctrl bindings used by client devices, including the definition of a +pin configuration node. + +=== Pin Group Node === + +A pin group node specifies the desired pin mux and/or pin configuration for an +arbitrary number of pins. The name of the pin group node is optional and not +used. + +A pin group node only affects the properties specified in the node, and has no +effect on any properties that are omitted. + +The pin group node accepts a subset of the generic pin config properties. For +details generic pin config properties, please refer to pinctrl-bindings.txt +and include/linux/pinctrl/pinconfig-generic.h. + +Each pin controlled by this pin controller belong to one of three types: +Standard, I2C, and HDMI. Each type accepts a different set of pin config +properties. A list of pins and their types is provided below. + +Required Properties (applicable to all pins): + +- pins:Multiple strings. Specifies the name(s) of one or more pins to + be configured by this node. + +Optional Properties (for standard pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: alt1, alt2, alt3, alt4 +- input-schmitt-enable:No arguments. Enable schmitt-trigger mode. +- input-schmitt-disable: No arguments. Disable schmitt-trigger mode. +- bias-pull-up:No arguments. Pull up on pin. +- bias-pull-down: No arguments. Pull down on pin. +- bias-disable:No arguments. Disable pin bias. +- slew-rate: Integer. Meaning depends on configured pin mux: + *_SCL or *_SDA: + 0: Standard(100kbps) Fast(400kbps) mode + 1: Highspeed (3.4Mbps) mode + IC_DM or IC_DP: + 0: normal slew rate + 1: fast slew rate + Otherwise: + 0: fast slew rate + 1: normal slew rate +- input-enable:No arguements. Enable input (does not affect + output.) +- input-disable: No arguements. Disable input (does not affect + output.) +- drive-strength: Integer. Drive strength in mA. Valid values are + 2, 4, 6, 8, 10, 12, 14, 16 mA. + +Optional Properties (for I2C pins): + +- function:String. Specifies the pin mux selection. Values + must be one of: alt1, alt2, alt3, alt4 +- bias-pull-up:Integer. Pull up strength in Ohm: + 1: 1.2 kOhm + 2: 1.8 kOhm + 3: 720 Ohm + 4: 2.7 kOhm
[PATCH v3 3/6] pinctrl: Make PINCTRL selectable by defconfig/menuconfig
Adds a string to the PINCTRL config option so that 1) CONFIG_PINCTRL=y would not be erased by make config, and 2) PINCTRL option would show up in menuconfig. Signed-off-by: Sherman Yin s...@broadcom.com --- v3: added to patchset drivers/pinctrl/Kconfig |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 33f9dc1..a921ff1 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -3,7 +3,7 @@ # config PINCTRL - bool + bool Enable the pinctrl framework if PINCTRL -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 0/6] Add Broadcom Capri pinctrl driver
The following patches adds a pinctrl driver for Broadcom Capri (BCM281xx) SoCs. The first patch, adding the void * to pinctrl_pin_desc, has been previously discussed with LinusW. See this thread: http://lists.infradead.org/pipermail/linux-arm-kernel/2013-April/165880.html --- v3: Re-worked driver to be based on generic pinconfig, addressed review comments and other supporting changes: - moved config selection from Kconfig to defconfig - added slew-rate, input enable, input disable properties for generic pinconfig - added a description for PINCTRL config v2: Use hyphens instead of underscore in DT property names. Sherman Yin (6): pinctrl: Add void * to pinctrl_pin_desc pinctrl: Adds slew-rate, input-enable/disable pinctrl: Make PINCTRL selectable by defconfig/menuconfig pinctrl: Add pinctrl binding for Broadcom Capri SoCs ARM: pinctrl: Add Broadcom Capri pinctrl driver pinctrl: Enable pinctrl for Broadcom Capri SoCs .../bindings/pinctrl/brcm,capri-pinctrl.txt| 429 ++ .../bindings/pinctrl/pinctrl-bindings.txt |3 + arch/arm/boot/dts/bcm11351.dtsi|4 + arch/arm/configs/bcm_defconfig |5 + drivers/pinctrl/Kconfig| 13 +- drivers/pinctrl/Makefile |1 + drivers/pinctrl/pinconf-generic.c |4 + drivers/pinctrl/pinctrl-capri.c| 1408 include/linux/pinctrl/pinconf-generic.h|4 + include/linux/pinctrl/pinctrl.h|2 + 10 files changed, 1872 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt create mode 100644 drivers/pinctrl/pinctrl-capri.c -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 6/6] pinctrl: Enable pinctrl for Broadcom Capri SoCs
Enable pinctrl for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v3: no change v2: no change --- arch/arm/boot/dts/bcm11351.dtsi |4 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi index b0c0610..dd8e878 100644 --- a/arch/arm/boot/dts/bcm11351.dtsi +++ b/arch/arm/boot/dts/bcm11351.dtsi @@ -142,4 +142,8 @@ status = disabled; }; + pinctrl@35004800 { + compatible = brcm,capri-pinctrl; + reg = 0x35004800 0x430; + }; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 2/6] pinctrl: Adds slew-rate, input-enable/disable
This commit adds slew-rate and input-enable/disable support for pinconf -generic. Signed-off-by: Sherman Yin s...@broadcom.com --- v3: added to patchset .../bindings/pinctrl/pinctrl-bindings.txt |3 +++ drivers/pinctrl/pinconf-generic.c |4 include/linux/pinctrl/pinconf-generic.h|4 3 files changed, 11 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt index 1958ca9..4414163 100644 --- a/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt +++ b/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt @@ -151,6 +151,8 @@ drive-push-pull - drive actively high and low drive-open-drain - drive with open drain drive-open-source - drive with open source drive-strength - sink or source at most X mA +input-enable - enable input on pin (no effect on output) +input-disable - disable input on pin (no effect on output) input-schmitt-enable - enable schmitt-trigger mode input-schmitt-disable - disable schmitt-trigger mode input-debounce - debounce mode with debound time X @@ -158,6 +160,7 @@ low-power-enable- enable low power mode low-power-disable - disable low power mode output-low - set the pin to output mode with low level output-high- set the pin to output mode with high level +slew-rate - set the slew rate Some of the generic properties take arguments. For those that do, the arguments are described below. diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c index 55a0ebe..3d9a999 100644 --- a/drivers/pinctrl/pinconf-generic.c +++ b/drivers/pinctrl/pinconf-generic.c @@ -48,6 +48,7 @@ static struct pin_config_item conf_items[] = { PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, output drive open drain, NULL), PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, output drive open source, NULL), PCONFDUMP(PIN_CONFIG_DRIVE_STRENGTH, output drive strength, mA), + PCONFDUMP(PIN_CONFIG_INPUT_ENABLE, input enabled, NULL), PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT_ENABLE, input schmitt enabled, NULL), PCONFDUMP(PIN_CONFIG_INPUT_SCHMITT, input schmitt trigger, NULL), PCONFDUMP(PIN_CONFIG_INPUT_DEBOUNCE, input debounce, usec), @@ -160,6 +161,8 @@ static struct pinconf_generic_dt_params dt_params[] = { { drive-open-drain, PIN_CONFIG_DRIVE_OPEN_DRAIN, 0 }, { drive-open-source, PIN_CONFIG_DRIVE_OPEN_SOURCE, 0 }, { drive-strength, PIN_CONFIG_DRIVE_STRENGTH, 0 }, + { input-enable, PIN_CONFIG_INPUT_ENABLE, 1 }, + { input-disable, PIN_CONFIG_INPUT_ENABLE, 0 }, { input-schmitt-enable, PIN_CONFIG_INPUT_SCHMITT_ENABLE, 1 }, { input-schmitt-disable, PIN_CONFIG_INPUT_SCHMITT_ENABLE, 0 }, { input-debounce, PIN_CONFIG_INPUT_DEBOUNCE, 0 }, @@ -167,6 +170,7 @@ static struct pinconf_generic_dt_params dt_params[] = { { low-power-disable, PIN_CONFIG_LOW_POWER_MODE, 0 }, { output-low, PIN_CONFIG_OUTPUT, 0, }, { output-high, PIN_CONFIG_OUTPUT, 1, }, + { slew-rate, PIN_CONFIG_SLEW_RATE, 0}, }; /** diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index fb90ef5..0db67bf 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h @@ -61,6 +61,9 @@ * argument is ignored. * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current * passed as argument. The argument is in mA. + * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not + * affect the pin's ability to drive output. 1 enables input, 0 disables + * input. * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, * schmitt-trigger mode is disabled. @@ -99,6 +102,7 @@ enum pin_config_param { PIN_CONFIG_DRIVE_OPEN_DRAIN, PIN_CONFIG_DRIVE_OPEN_SOURCE, PIN_CONFIG_DRIVE_STRENGTH, + PIN_CONFIG_INPUT_ENABLE, PIN_CONFIG_INPUT_SCHMITT_ENABLE, PIN_CONFIG_INPUT_SCHMITT, PIN_CONFIG_INPUT_DEBOUNCE, -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v3 5/6] ARM: pinctrl: Add Broadcom Capri pinctrl driver
Adds pinctrl driver for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v3: Re-work driver to be based on generic pin config. Moved config selection from Kconfig to bcm_defconfig. v2: Use hyphens instead of underscore in DT property names. --- arch/arm/configs/bcm_defconfig |5 + drivers/pinctrl/Kconfig | 11 + drivers/pinctrl/Makefile|1 + drivers/pinctrl/pinctrl-capri.c | 1408 +++ 4 files changed, 1425 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-capri.c diff --git a/arch/arm/configs/bcm_defconfig b/arch/arm/configs/bcm_defconfig index 287ac1d..6b94987 100644 --- a/arch/arm/configs/bcm_defconfig +++ b/arch/arm/configs/bcm_defconfig @@ -126,3 +126,8 @@ CONFIG_CRC_ITU_T=y CONFIG_CRC7=y CONFIG_XZ_DEC=y CONFIG_AVERAGE=y +CONFIG_PINCTRL=y +CONFIG_PINMUX=y +CONFIG_PINCONF=y +CONFIG_GENERIC_PINCONF=y +CONFIG_PINCTRL_CAPRI=y diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index a921ff1..664c8e6 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -104,6 +104,17 @@ config PINCTRL_BCM2835 select PINMUX select PINCONF +config PINCTRL_CAPRI + bool Broadcom Capri pinctrl driver + select PINMUX + select PINCONF + select GENERIC_PINCONF + help + Say Y here to support Broadcom Capri pinctrl driver, which is used for + the BCM281xx SoC family, including BCM11130, BCM11140, BCM11351, + BCM28145, and BCM28155 SoCs. This driver requires the pinctrl + framework. GPIO is provided by a separate GPIO driver. + config PINCTRL_IMX bool select PINMUX diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index 4f7be29..86cac40 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -21,6 +21,7 @@ obj-$(CONFIG_PINCTRL_BF60x) += pinctrl-adi2-bf60x.o obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o obj-$(CONFIG_PINCTRL_BAYTRAIL) += pinctrl-baytrail.o +obj-$(CONFIG_PINCTRL_CAPRI)+= pinctrl-capri.o obj-$(CONFIG_PINCTRL_IMX) += pinctrl-imx.o obj-$(CONFIG_PINCTRL_IMX1_CORE)+= pinctrl-imx1-core.o obj-$(CONFIG_PINCTRL_IMX27)+= pinctrl-imx27.o diff --git a/drivers/pinctrl/pinctrl-capri.c b/drivers/pinctrl/pinctrl-capri.c new file mode 100644 index 000..d468de6 --- /dev/null +++ b/drivers/pinctrl/pinctrl-capri.c @@ -0,0 +1,1408 @@ +/* + * Copyright (C) 2013 Broadcom Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed as is WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ +#include linux/err.h +#include linux/io.h +#include linux/module.h +#include linux/of.h +#include linux/platform_device.h +#include linux/pinctrl/pinctrl.h +#include linux/pinctrl/pinmux.h +#include linux/pinctrl/pinconf.h +#include linux/pinctrl/pinconf-generic.h +#include linux/slab.h +#include core.h +#include pinctrl-utils.h + +/* Capri Pin Control Registers Definitions */ + +/* Function Select bits are the same for all pin control registers */ +#define CAPRI_PIN_REG_F_SEL_MASK 0x0700 +#define CAPRI_PIN_REG_F_SEL_SHIFT 8 + +/* Standard pin register */ +#define CAPRI_STD_PIN_REG_DRV_STR_MASK 0x0007 +#define CAPRI_STD_PIN_REG_DRV_STR_SHIFT0 +#define CAPRI_STD_PIN_REG_INPUT_DIS_MASK 0x0008 +#define CAPRI_STD_PIN_REG_INPUT_DIS_SHIFT 3 +#define CAPRI_STD_PIN_REG_SLEW_MASK0x0010 +#define CAPRI_STD_PIN_REG_SLEW_SHIFT 4 +#define CAPRI_STD_PIN_REG_PULL_UP_MASK 0x0020 +#define CAPRI_STD_PIN_REG_PULL_UP_SHIFT5 +#define CAPRI_STD_PIN_REG_PULL_DN_MASK 0x0040 +#define CAPRI_STD_PIN_REG_PULL_DN_SHIFT6 +#define CAPRI_STD_PIN_REG_HYST_MASK0x0080 +#define CAPRI_STD_PIN_REG_HYST_SHIFT 7 + +/* I2C pin register */ +#define CAPRI_I2C_PIN_REG_INPUT_DIS_MASK 0x0004 +#define CAPRI_I2C_PIN_REG_INPUT_DIS_SHIFT 2 +#define CAPRI_I2C_PIN_REG_SLEW_MASK0x0008 +#define CAPRI_I2C_PIN_REG_SLEW_SHIFT 3 +#define CAPRI_I2C_PIN_REG_PULL_UP_STR_MASK 0x0070 +#define CAPRI_I2C_PIN_REG_PULL_UP_STR_SHIFT4 + +/* HDMI pin register */ +#define CAPRI_HDMI_PIN_REG_INPUT_DIS_MASK 0x0008 +#define CAPRI_HDMI_PIN_REG_INPUT_DIS_SHIFT 3 +#define CAPRI_HDMI_PIN_REG_MODE_MASK 0x0010 +#define CAPRI_HDMI_PIN_REG_MODE_SHIFT 4 + +/** + * capri_pin_type - types of pin register + */ +enum capri_pin_type
Re: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-10-17 08:31 AM, Christian Daudt wrote: On Thu, Oct 17, 2013 at 7:54 AM, Stephen Warren wrote: On 10/17/2013 12:03 AM, Christian Daudt wrote: On Thu, Oct 3, 2013 at 5:23 PM, Sherman Yin wrote: Adds pinctrl driver for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- arch/arm/mach-bcm/Kconfig |2 + drivers/pinctrl/Kconfig | 10 + drivers/pinctrl/Makefile|1 + drivers/pinctrl/pinctrl-capri.c | 1727 +++ 4 files changed, 1740 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-capri.c diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index 69d67f7..2546365 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -10,6 +10,8 @@ config ARCH_BCM select GENERIC_CLOCKEVENTS select GENERIC_TIME select GPIO_BCM + select PINCTRL + select PINCTRL_CAPRI select SPARSE_IRQ select TICK_ONESHOT select CACHE_L2X0 On your subsequent patchset pls move this from Kconfig to arm/configs/bcm_defconfig, and break that modification into a separate patch from the drivers/* modification. The other SoCs I'm familiar with all select this from their ARCH_xxx config symbol. I had a discussion on what is best left under ARCH and what is best left to defconfig with Kevin Hilman a while back and the conclusion was that any config not strictly required for bootup is best left to defconfig. This will allow multiplatform kernels to switch to using them as loadable modules later on, something not possible with configs put under ARCH_xxx. Thanks, csd I was just trying to move "select PINCTRL" to a defconfig as Christian suggested. However, CONFIG_PINCTRL is not selectable by a defconfig file (the option will be gone by the time .config is generated), even though PINCTRL has no dependency. Also, this option is not visible in menuconfig. I found that by adding a string after "bool" in the PINCTRL config definition (see diff below), CONFIG_PINCTRL will be selectable in a defconfig file and this option will also be visible in menuconfig. Was this intentional or is this a bug? To address Christian's comment, I'll need to add the following patch. Regards, Sherman == diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 6c70fc5..664c8e6 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -3,7 +3,7 @@ # config PINCTRL - bool + bool "Enable the pinctrl framework" if PINCTRL == -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-10-17 08:31 AM, Christian Daudt wrote: On Thu, Oct 17, 2013 at 7:54 AM, Stephen Warren swar...@wwwdotorg.org wrote: On 10/17/2013 12:03 AM, Christian Daudt wrote: On Thu, Oct 3, 2013 at 5:23 PM, Sherman Yin s...@broadcom.com wrote: Adds pinctrl driver for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- arch/arm/mach-bcm/Kconfig |2 + drivers/pinctrl/Kconfig | 10 + drivers/pinctrl/Makefile|1 + drivers/pinctrl/pinctrl-capri.c | 1727 +++ 4 files changed, 1740 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-capri.c diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index 69d67f7..2546365 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -10,6 +10,8 @@ config ARCH_BCM select GENERIC_CLOCKEVENTS select GENERIC_TIME select GPIO_BCM + select PINCTRL + select PINCTRL_CAPRI select SPARSE_IRQ select TICK_ONESHOT select CACHE_L2X0 On your subsequent patchset pls move this from Kconfig to arm/configs/bcm_defconfig, and break that modification into a separate patch from the drivers/* modification. The other SoCs I'm familiar with all select this from their ARCH_xxx config symbol. I had a discussion on what is best left under ARCH and what is best left to defconfig with Kevin Hilman a while back and the conclusion was that any config not strictly required for bootup is best left to defconfig. This will allow multiplatform kernels to switch to using them as loadable modules later on, something not possible with configs put under ARCH_xxx. Thanks, csd I was just trying to move select PINCTRL to a defconfig as Christian suggested. However, CONFIG_PINCTRL is not selectable by a defconfig file (the option will be gone by the time .config is generated), even though PINCTRL has no dependency. Also, this option is not visible in menuconfig. I found that by adding a string after bool in the PINCTRL config definition (see diff below), CONFIG_PINCTRL will be selectable in a defconfig file and this option will also be visible in menuconfig. Was this intentional or is this a bug? To address Christian's comment, I'll need to add the following patch. Regards, Sherman == diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index 6c70fc5..664c8e6 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -3,7 +3,7 @@ # config PINCTRL - bool + bool Enable the pinctrl framework if PINCTRL == -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
timer: catching new timers in migrated tvec_base
Hi all, I'm looking for feedback regarding explicitly invalidating the list_heads in tvec_base.tv1 .. tv5 after a migration, for example by doing a list_del(head) at the end of migrate_timer_list(). This is not meant to fix any bugs, but to help catch attempts to add timers to the migrated tvec_base. Bugs like this could be difficult to catch without this change (example below). If I understand correctly, after migration of timers from one cpu (the one being shut down, say cpu1) to another (say cpu0), no one should be adding any timers to the tvec_base of cpu1. When cpu1 later comes back up, new timers can be added only after init_timers_cpu(1). If a buggy driver tries to add a timer to cpu1 after it has shut down, eg with add_timer_on(1), there is no indication that this is an invalid operation (no BUG_ON, no return code). The following is what happened in my case: 1. cpu1 shuts down, all timers migrated to cpu0 2. driverA adds a timerX to cpu1's tvec_base.tv1[n] (bug) 3. cpu1 returns, all lists in tvec_base.tv1 re-initialized without checking if the lists are indeed empty. 4. timerX is now "orphaned"; its entry->next and entry->prev points to cpu1's tvec_base.tv1[n], but tvec_base.tv1[n] is an empty list. 5. driverB adds a timerY to cpu1's tvec_base.tv[n] and becomes the only entry in that list. 6. driverA removes timerX, which eventually calls __list_del on timerX.entry. 7. Since timerX.entry points to cpu1's tvec_base.tv1[n], tvec_base.tv1[n] will now become an empty list, and timerY is now "orphaned". 8. timerY never fires This bug was difficult to catch because it will only happen if timerX and timerY are both added to the same slot tv1[n]. The likelihood may be low so the bug might be very difficult to reproduce. By invalidating the list_heads in tv[1..5] right after migration, we can catch this bug at step 2. A patch might look like: --- a/kernel/timer.c +++ b/kernel/timer.c @@ -1585,6 +1585,14 @@ static void migrate_timer_list(struct tvec_base *new_base, struct list_head *hea timer_set_base(timer, new_base); internal_add_timer(new_base, timer); } + + /* +* After existing timers are migrated, new timers should never be added +* to this list until after the next init_timers_cpu(). Deleting +* list_head here will not affect timer behavior but will help catch +* anyone trying to add to this list when they shouldn't. +*/ + list_del(head); } static void __cpuinit migrate_timers(int cpu) Is there anything I missed or failed to consider here? Thanks, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
timer: catching new timers in migrated tvec_base
Hi all, I'm looking for feedback regarding explicitly invalidating the list_heads in tvec_base.tv1 .. tv5 after a migration, for example by doing a list_del(head) at the end of migrate_timer_list(). This is not meant to fix any bugs, but to help catch attempts to add timers to the migrated tvec_base. Bugs like this could be difficult to catch without this change (example below). If I understand correctly, after migration of timers from one cpu (the one being shut down, say cpu1) to another (say cpu0), no one should be adding any timers to the tvec_base of cpu1. When cpu1 later comes back up, new timers can be added only after init_timers_cpu(1). If a buggy driver tries to add a timer to cpu1 after it has shut down, eg with add_timer_on(1), there is no indication that this is an invalid operation (no BUG_ON, no return code). The following is what happened in my case: 1. cpu1 shuts down, all timers migrated to cpu0 2. driverA adds a timerX to cpu1's tvec_base.tv1[n] (bug) 3. cpu1 returns, all lists in tvec_base.tv1 re-initialized without checking if the lists are indeed empty. 4. timerX is now orphaned; its entry-next and entry-prev points to cpu1's tvec_base.tv1[n], but tvec_base.tv1[n] is an empty list. 5. driverB adds a timerY to cpu1's tvec_base.tv[n] and becomes the only entry in that list. 6. driverA removes timerX, which eventually calls __list_del on timerX.entry. 7. Since timerX.entry points to cpu1's tvec_base.tv1[n], tvec_base.tv1[n] will now become an empty list, and timerY is now orphaned. 8. timerY never fires This bug was difficult to catch because it will only happen if timerX and timerY are both added to the same slot tv1[n]. The likelihood may be low so the bug might be very difficult to reproduce. By invalidating the list_heads in tv[1..5] right after migration, we can catch this bug at step 2. A patch might look like: --- a/kernel/timer.c +++ b/kernel/timer.c @@ -1585,6 +1585,14 @@ static void migrate_timer_list(struct tvec_base *new_base, struct list_head *hea timer_set_base(timer, new_base); internal_add_timer(new_base, timer); } + + /* +* After existing timers are migrated, new timers should never be added +* to this list until after the next init_timers_cpu(). Deleting +* list_head here will not affect timer behavior but will help catch +* anyone trying to add to this list when they shouldn't. +*/ + list_del(head); } static void __cpuinit migrate_timers(int cpu) Is there anything I missed or failed to consider here? Thanks, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-11-11 02:01 AM, Linus Walleij wrote: I would imagine that the platform-specific device tree bindings would need to clearly explain what the valid values are, as they should. But this is not a platform-specific binding. These are the generic pin configuration bindings we're talking about. Yes, the properties are generic, but I was under the impression that the values can be "custom", such as these: * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in * schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis, * the threshold value is given on a custom format as argument when * setting pins to this mode. and * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to * this parameter (on a custom format) tells the driver which alternative * slew rate to use. If we're using integers, we could either have a) !0 and 0, or b) just 1 and 0, and everything else is an error. Or c) the platform could decide that the value provides addition info like pull-up-strength, so 0 = no pull up, >0 = pull up enabled and the number is the pull up strength in Ohm (bindings should indicate which values are valid), and everything else is an error. That seems to make sense, I've just not seen any system (using device tree) that can actually set the pull up/down resistance. That said, if you can patch the OF core and the generic pin config parser to do what you want with lists like that, it's your pick. It may take some time though. I don't mind patching the generic pin config, and I don't think the core needs to change, If you want arrays of booleans that is a matter for the OF core parser I think. I was thinking of just using integers and accepting only 1 and 0, everything else is error. What about you patch include/linux/pinctrl/pinconf-generic.h to add PIN_CONFIG_INPUT_DISABLE with this semantic and also patch the generic pinconf parser in drivers/pinctrl/pinconf-generic.c to handle this? Sure, I can add PIN_CONFIG_INPUT_DISABLE. However I suspect people might be confused by this and PIN_CONFIG_OUTPUT. Just make sure you put in good documentation in that file right there, it's using kerneldoc and for a good reason... Thanks, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-11-11 02:01 AM, Linus Walleij wrote: I would imagine that the platform-specific device tree bindings would need to clearly explain what the valid values are, as they should. But this is not a platform-specific binding. These are the generic pin configuration bindings we're talking about. Yes, the properties are generic, but I was under the impression that the values can be custom, such as these: * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in * schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis, * the threshold value is given on a custom format as argument when * setting pins to this mode. and * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to * this parameter (on a custom format) tells the driver which alternative * slew rate to use. If we're using integers, we could either have a) !0 and 0, or b) just 1 and 0, and everything else is an error. Or c) the platform could decide that the value provides addition info like pull-up-strength, so 0 = no pull up, 0 = pull up enabled and the number is the pull up strength in Ohm (bindings should indicate which values are valid), and everything else is an error. That seems to make sense, I've just not seen any system (using device tree) that can actually set the pull up/down resistance. That said, if you can patch the OF core and the generic pin config parser to do what you want with lists like that, it's your pick. It may take some time though. I don't mind patching the generic pin config, and I don't think the core needs to change, If you want arrays of booleans that is a matter for the OF core parser I think. I was thinking of just using integers and accepting only 1 and 0, everything else is error. What about you patch include/linux/pinctrl/pinconf-generic.h to add PIN_CONFIG_INPUT_DISABLE with this semantic and also patch the generic pinconf parser in drivers/pinctrl/pinconf-generic.c to handle this? Sure, I can add PIN_CONFIG_INPUT_DISABLE. However I suspect people might be confused by this and PIN_CONFIG_OUTPUT. Just make sure you put in good documentation in that file right there, it's using kerneldoc and for a good reason... Thanks, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-11-06 01:40 AM, Linus Walleij wrote: On Wed, Nov 6, 2013 at 3:02 AM, Sherman Yin wrote: When Linus asked me to try using generic pinconf instead, I ran into problems with this feature due to how the generic pinconf properties are defined differently than my properties - perhaps this feature just doesn't work for generic pinconf-based drivers with the (Unless we are ok with using 1/0 for boolean properties, but it has already been pointed out that these should be valueless.). Well it seems you would need a way to pass an array of the same boolean property and that seems a bit more complex and hard to read than the generic boolean bindings. You would have to patch the OF core to do something like that: bias-pull-up = ; 1/0 isn't so good I think, what should the parser do with e.g. 2? This is more to the point. I would imagine that the platform-specific device tree bindings would need to clearly explain what the valid values are, as they should. If we're using integers, we could either have a) !0 and 0, or b) just 1 and 0, and everything else is an error. Or c) the platform could decide that the value provides addition info like pull-up-strength, so 0 = no pull up, >0 = pull up enabled and the number is the pull up strength in Ohm (bindings should indicate which values are valid), and everything else is an error. While I'd love to be able define my pin config nodes this way, if I have to use generic pinconf for the driver to be upstreamed, then I'm fine with it. Well you need to use generic pin config because all the custom stuff - i.MX comes to mind - is creating a mess. I prefer that we share bindings and code, as any programmer would... Ok That said, if you can patch the OF core and the generic pin config parser to do what you want with lists like that, it's your pick. It may take some time though. I don't mind patching the generic pin config, and I don't think the core needs to change, but first there needs to be an agreement on the changes since other drivers will need to use pinconf-generic. Am I the only one who would like to see this feature, or do others see value in being able to group more pins together - resulting in fewer sub-nodes? Do the pros out-weight the cons? "input disable" This setting disconnects the input (DIN) to the internal logic from >the pin pad. However, the output (DOUT) can still drive the pad. It seems to match PIN_CONFIG_OUTPUT, but the current generic option is either "output-low" or "output-high" - are these referring to a static output of 0 and 1? What's the best property to use in this case? Seems like a new case. What about you patch include/linux/pinctrl/pinconf-generic.h to add PIN_CONFIG_INPUT_DISABLE with this semantic and also patch the generic pinconf parser in drivers/pinctrl/pinconf-generic.c to handle this? Sure, I can add PIN_CONFIG_INPUT_DISABLE. However I suspect people might be confused by this and PIN_CONFIG_OUTPUT. "mode" This controls several aspect of the pin (slew rate, pull up strength, etc) to meet I2C specs for Standard/Fast mode vs High Speed mode. I think the best way is to map this to slew rate, which would require some explanation because the meaning of slew rate differs depending on what pin function is selected: - When I2C (*_SCL or *_SDA) function is selected for the pin: 0: Standard (100kbps) & Fast mode (400kbps), 1: High Speed mode (3.4Mbps) - When IC_DM or IC_DP function is selected, 0: normal slew rate, 1: fast slew rate - Else: 0: fast slew rate, 1: normal slew rate Do we agree that the "slew rate" is the best property to use for "mode"? It seems to be indeed mostly related to slew rate. However if you want a custom brcm,mode binding that should be possible too, as well as augmenting the driver to use *both* generic pinconf *and* some custom config options on top. That has not been done so far though I think, so you might need a bit of hacking to do that. I think I'll stick with slew rate. :) Regards, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-11-06 09:00 AM, Stephen Warren wrote: You probably don't want to reference the individual xxx1/2/3 nodes in the client pinctrl properties, but instead wrap them in a higher-level node that represents the whole pinctrl state. Then, the client pinctrl properties can reference just that single parent node, instead of many small nodes. In other words: pinctrl@... { ... sx: state_xxx { xxx1 { ... }; xxx2 { ... }; xxx3 { ... }; }; sy: state_yyy { yyy1 { ... }; yyy2 { ... }; }; } some_client@... { ... pinctrl-names = "default"; pinctrl-0 = <>; }; other_client@... { ... pinctrl-names = "default"; pinctrl-0 = <>; }; rather than: pinctrl@... { ... sx1: xxx1 { ... }; sx2: xxx2 { ... }; sx3: xxx3 { ... }; sy1: yyy1 { ... }; sy2: yyy2 { ... }; } some_client@... { ... pinctrl-names = "default"; pinctrl-0 = < >; }; other_client@... { ... pinctrl-names = "default"; pinctrl-0 = < >; }; This is exactly how the Tegra pinctrl bindings work for example. Ok, right, I mistakenly thought the "xxx1" nodes are pin config nodes. Actually that's the way my original driver works as well, other than the fact that I don't have as many "xxx1" type nodes as decribed in the "xxx" node below. This works fine. However, I'm just thinking that it would have been easier if we could specify just one node: xxx { pins = , , ; function = <...>; pull-up = <1 1 0>; } This "feature" seems a bit more concise to me and is what I did for my original pinctrl driver. The only downside is that with this method, one cannot specify "don't touch this option for this pin" if the same property must provide values for other pins. The other downside is that if the lists get even slightly long, it get really hard to match up the entries in the t properties. Agree that it would start to get difficult to read if a subnode has too many pins. I guess the solution would be to somehow split up the pins to more subnodes with fewer pins each. Regards, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-11-06 09:00 AM, Stephen Warren wrote: You probably don't want to reference the individual xxx1/2/3 nodes in the client pinctrl properties, but instead wrap them in a higher-level node that represents the whole pinctrl state. Then, the client pinctrl properties can reference just that single parent node, instead of many small nodes. In other words: pinctrl@... { ... sx: state_xxx { xxx1 { ... }; xxx2 { ... }; xxx3 { ... }; }; sy: state_yyy { yyy1 { ... }; yyy2 { ... }; }; } some_client@... { ... pinctrl-names = default; pinctrl-0 = sx; }; other_client@... { ... pinctrl-names = default; pinctrl-0 = sy; }; rather than: pinctrl@... { ... sx1: xxx1 { ... }; sx2: xxx2 { ... }; sx3: xxx3 { ... }; sy1: yyy1 { ... }; sy2: yyy2 { ... }; } some_client@... { ... pinctrl-names = default; pinctrl-0 = sx1 sx2 sx3; }; other_client@... { ... pinctrl-names = default; pinctrl-0 = sy1 sy2; }; This is exactly how the Tegra pinctrl bindings work for example. Ok, right, I mistakenly thought the xxx1 nodes are pin config nodes. Actually that's the way my original driver works as well, other than the fact that I don't have as many xxx1 type nodes as decribed in the xxx node below. This works fine. However, I'm just thinking that it would have been easier if we could specify just one node: xxx { pins = PINA, PINB, PINC; function = ...; pull-up = 1 1 0; } This feature seems a bit more concise to me and is what I did for my original pinctrl driver. The only downside is that with this method, one cannot specify don't touch this option for this pin if the same property must provide values for other pins. The other downside is that if the lists get even slightly long, it get really hard to match up the entries in the t properties. Agree that it would start to get difficult to read if a subnode has too many pins. I guess the solution would be to somehow split up the pins to more subnodes with fewer pins each. Regards, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-11-06 01:40 AM, Linus Walleij wrote: On Wed, Nov 6, 2013 at 3:02 AM, Sherman Yin s...@broadcom.com wrote: When Linus asked me to try using generic pinconf instead, I ran into problems with this feature due to how the generic pinconf properties are defined differently than my properties - perhaps this feature just doesn't work for generic pinconf-based drivers with the (Unless we are ok with using 1/0 for boolean properties, but it has already been pointed out that these should be valueless.). Well it seems you would need a way to pass an array of the same boolean property and that seems a bit more complex and hard to read than the generic boolean bindings. You would have to patch the OF core to do something like that: bias-pull-up = true true false; 1/0 isn't so good I think, what should the parser do with e.g. 2? This is more to the point. I would imagine that the platform-specific device tree bindings would need to clearly explain what the valid values are, as they should. If we're using integers, we could either have a) !0 and 0, or b) just 1 and 0, and everything else is an error. Or c) the platform could decide that the value provides addition info like pull-up-strength, so 0 = no pull up, 0 = pull up enabled and the number is the pull up strength in Ohm (bindings should indicate which values are valid), and everything else is an error. While I'd love to be able define my pin config nodes this way, if I have to use generic pinconf for the driver to be upstreamed, then I'm fine with it. Well you need to use generic pin config because all the custom stuff - i.MX comes to mind - is creating a mess. I prefer that we share bindings and code, as any programmer would... Ok That said, if you can patch the OF core and the generic pin config parser to do what you want with lists like that, it's your pick. It may take some time though. I don't mind patching the generic pin config, and I don't think the core needs to change, but first there needs to be an agreement on the changes since other drivers will need to use pinconf-generic. Am I the only one who would like to see this feature, or do others see value in being able to group more pins together - resulting in fewer sub-nodes? Do the pros out-weight the cons? input disable This setting disconnects the input (DIN) to the internal logic from the pin pad. However, the output (DOUT) can still drive the pad. It seems to match PIN_CONFIG_OUTPUT, but the current generic option is either output-low or output-high - are these referring to a static output of 0 and 1? What's the best property to use in this case? Seems like a new case. What about you patch include/linux/pinctrl/pinconf-generic.h to add PIN_CONFIG_INPUT_DISABLE with this semantic and also patch the generic pinconf parser in drivers/pinctrl/pinconf-generic.c to handle this? Sure, I can add PIN_CONFIG_INPUT_DISABLE. However I suspect people might be confused by this and PIN_CONFIG_OUTPUT. mode This controls several aspect of the pin (slew rate, pull up strength, etc) to meet I2C specs for Standard/Fast mode vs High Speed mode. I think the best way is to map this to slew rate, which would require some explanation because the meaning of slew rate differs depending on what pin function is selected: - When I2C (*_SCL or *_SDA) function is selected for the pin: 0: Standard (100kbps) Fast mode (400kbps), 1: High Speed mode (3.4Mbps) - When IC_DM or IC_DP function is selected, 0: normal slew rate, 1: fast slew rate - Else: 0: fast slew rate, 1: normal slew rate Do we agree that the slew rate is the best property to use for mode? It seems to be indeed mostly related to slew rate. However if you want a custom brcm,mode binding that should be possible too, as well as augmenting the driver to use *both* generic pinconf *and* some custom config options on top. That has not been done so far though I think, so you might need a bit of hacking to do that. I think I'll stick with slew rate. :) Regards, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-11-04 04:04 PM, Stephen Warren wrote: On 11/04/2013 04:26 PM, Heiko Stübner wrote: I remember we had a discussion about how things like bias-disable explicitly shouldn't have a value, when they are represented in the list-format: pcfg_pull_none: pcfg_pull_none { bias-disable; }; so a bias-disable = <1> was explicitly "forbidden" [for a lack of a better word]. And it was similar for other options, the parameter not meant to be indicating if they are active but really only setting the "strength" or so. Pure Boolean values should be represented as a valueless property. If the property is present, the value is true, otherwise false. However, pinctrl bindings often don't represent Boolean values, but rather tri-states, with the following values: * Don't touch this configuration option at all (missing) * Enable the option (<1>) * Disable the option (<0>) The reason for using tri-states being that you might want to write: xxx1 { pins = , , ; function = <...>; // this node doesn't affect pullup } xxx2 { pins = , ; // this node doesn't affect function pull-up = <1>; // change, and enable } xxx3 { pins = ; // this node doesn't affect function pull-up = <0>; // change, and disable } If I understand correctly, in Stephen's example, if a certain driver wants to configure PINA PINB and PINC, the pin configuration nodes "xxx1", "xxx2", and "xxx3" will all have to be selected for the particular pin state. This works fine. However, I'm just thinking that it would have been easier if we could specify just one node: xxx { pins = , , ; function = <...>; pull-up = <1 1 0>; } This "feature" seems a bit more concise to me and is what I did for my original pinctrl driver. The only downside is that with this method, one cannot specify "don't touch this option for this pin" if the same property must provide values for other pins. When Linus asked me to try using generic pinconf instead, I ran into problems with this feature due to how the generic pinconf properties are defined differently than my properties - perhaps this feature just doesn't work for generic pinconf-based drivers with the (Unless we are ok with using 1/0 for boolean properties, but it has already been pointed out that these should be valueless.). While I'd love to be able define my pin config nodes this way, if I have to use generic pinconf for the driver to be upstreamed, then I'm fine with it. Going back to some questions regarding generic pinconf properties - could I get some help with these? >"input disable" >This setting disconnects the input (DIN) to the internal logic from >the pin pad. However, the output (DOUT) can still drive the pad. It >seems to match PIN_CONFIG_OUTPUT, but the current generic option is >either "output-low" or "output-high" - are these referring to a static >output of 0 and 1? What's the best property to use in this case? >"mode" >This controls several aspect of the pin (slew rate, pull up strength, >etc) to meet I2C specs for Standard/Fast mode vs High Speed mode. I >think the best way is to map this to slew rate, which would require >some explanation because the meaning of slew rate differs depending on >what pin function is selected: >- When I2C (*_SCL or *_SDA) function is selected for the pin: 0: > Standard (100kbps) > & Fast mode (400kbps), 1: High Speed mode (3.4Mbps) >- When IC_DM or IC_DP function is selected, 0: normal slew rate, 1: > fast slew rate >- Else: 0: fast slew rate, 1: normal slew rate Do we agree that the "slew rate" is the best property to use for "mode"? Thanks, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
On 13-11-04 04:04 PM, Stephen Warren wrote: On 11/04/2013 04:26 PM, Heiko Stübner wrote: I remember we had a discussion about how things like bias-disable explicitly shouldn't have a value, when they are represented in the list-format: pcfg_pull_none: pcfg_pull_none { bias-disable; }; so a bias-disable = 1 was explicitly forbidden [for a lack of a better word]. And it was similar for other options, the parameter not meant to be indicating if they are active but really only setting the strength or so. Pure Boolean values should be represented as a valueless property. If the property is present, the value is true, otherwise false. However, pinctrl bindings often don't represent Boolean values, but rather tri-states, with the following values: * Don't touch this configuration option at all (missing) * Enable the option (1) * Disable the option (0) The reason for using tri-states being that you might want to write: xxx1 { pins = PINA, PINB, PINC; function = ...; // this node doesn't affect pullup } xxx2 { pins = PINA, PINB; // this node doesn't affect function pull-up = 1; // change, and enable } xxx3 { pins = PINAC; // this node doesn't affect function pull-up = 0; // change, and disable } If I understand correctly, in Stephen's example, if a certain driver wants to configure PINA PINB and PINC, the pin configuration nodes xxx1, xxx2, and xxx3 will all have to be selected for the particular pin state. This works fine. However, I'm just thinking that it would have been easier if we could specify just one node: xxx { pins = PINA, PINB, PINC; function = ...; pull-up = 1 1 0; } This feature seems a bit more concise to me and is what I did for my original pinctrl driver. The only downside is that with this method, one cannot specify don't touch this option for this pin if the same property must provide values for other pins. When Linus asked me to try using generic pinconf instead, I ran into problems with this feature due to how the generic pinconf properties are defined differently than my properties - perhaps this feature just doesn't work for generic pinconf-based drivers with the (Unless we are ok with using 1/0 for boolean properties, but it has already been pointed out that these should be valueless.). While I'd love to be able define my pin config nodes this way, if I have to use generic pinconf for the driver to be upstreamed, then I'm fine with it. Going back to some questions regarding generic pinconf properties - could I get some help with these? input disable This setting disconnects the input (DIN) to the internal logic from the pin pad. However, the output (DOUT) can still drive the pad. It seems to match PIN_CONFIG_OUTPUT, but the current generic option is either output-low or output-high - are these referring to a static output of 0 and 1? What's the best property to use in this case? mode This controls several aspect of the pin (slew rate, pull up strength, etc) to meet I2C specs for Standard/Fast mode vs High Speed mode. I think the best way is to map this to slew rate, which would require some explanation because the meaning of slew rate differs depending on what pin function is selected: - When I2C (*_SCL or *_SDA) function is selected for the pin: 0: Standard (100kbps) Fast mode (400kbps), 1: High Speed mode (3.4Mbps) - When IC_DM or IC_DP function is selected, 0: normal slew rate, 1: fast slew rate - Else: 0: fast slew rate, 1: normal slew rate Do we agree that the slew rate is the best property to use for mode? Thanks, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
>As well as all this stuff... OK. Will see if I can find something suitable for "input disable" and "mode" >>> >>>Let's discuss this. What exactly does "input disable" and "mode" >>>mean, in electrical terms? >>> >>>When you come down to what actually happens it may turn out that >>>"input disable" is PIN_CONFIG_OUTPUT, which implicitly turns >>>off input does it not? >> >>I'm going to verify the details with our hardware team first, and will let you >>know if we think we can use one of the existing generic parameters or if we >>need a new one. > >"input disable" >This setting disconnects the input (DIN) to the internal logic from the pin >pad. >However, the output (DOUT) can still drive the pad. It seems to match >PIN_CONFIG_OUTPUT, but the current generic option is either "output-low" or >"output-high" - are these referring to a static output of 0 and 1? > >"mode" >This controls several aspect of the pin (slew rate, pull up strength, etc) to >meet >I2C specs for Standard/Fast mode vs High Speed mode. I think the best >way is to map this to slew rate, which would require some explanation because >the meaning of slew rate differs depending on what pin function is selected: >- When I2C (*_SCL or *_SDA) function is selected for the pin: 0: Standard >(100kbps) > & Fast mode (400kbps), 1: High Speed mode (3.4Mbps) >- When IC_DM or IC_DP function is selected, 0: normal slew rate, 1: fast slew >rate >- Else: 0: fast slew rate, 1: normal slew rate > >Also, it seems like I have to add "slew-rate" to dt_params[] in >pinconf-generic.c and >pinctrl-bindings.txt. Hi Linus, So I will go ahead and make the change in pinconf-generic.c and pinctrl-bindings.txt to include parsing of the "slew-rate" property and submit it as part of my pinctrl changes. Question regarding pinctrl-generic: in pinctrl-bindings.txt, this is said about the "function" property: 169- function takes a list of function names/IDs as a required argument. The 170 specific binding for the hardware defines: 171 - Whether the entries are integers or strings, and their meaning. 172 - Whether only a single entry is allowed (which is applied to all entries 173in the pins property), or whether there may alternatively be one entry per 174entry in the pins property, in which case the list lengths must match, and 175for each list index i, the function at list index i is applied to the pin 176at list index i. (Although it looks like pinconf_generic_dt_subnode_to_map() does not support the "one entry per pin feature" for the "function" property yet.) In my driver, I have the "one entry per pin" support for all my properties instead of just the function property, like the "drive_str" property below: + grp_1 { + brcm,pins = "pin1", "pin2", "pin3"; + brcm,function = "alt1", "alt2", "alt1"; + brcm,drive_str = <2 4 6>; + brcm,slew = <1>; + }; I thought that would be convenient and allow users to group pins together based on functionality and without the restriction that the pins must have the same properties. Do you think that's a good idea and are there plans to support that in the generic pinconfig? If so, I can look into porting my implementation to pinconf-generic.c - but first I have to figure out how some of the properties would work if more than one value could be specified (eg. "bias-disable" which takes no values) Thanks, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
As well as all this stuff... OK. Will see if I can find something suitable for input disable and mode Let's discuss this. What exactly does input disable and mode mean, in electrical terms? When you come down to what actually happens it may turn out that input disable is PIN_CONFIG_OUTPUT, which implicitly turns off input does it not? I'm going to verify the details with our hardware team first, and will let you know if we think we can use one of the existing generic parameters or if we need a new one. input disable This setting disconnects the input (DIN) to the internal logic from the pin pad. However, the output (DOUT) can still drive the pad. It seems to match PIN_CONFIG_OUTPUT, but the current generic option is either output-low or output-high - are these referring to a static output of 0 and 1? mode This controls several aspect of the pin (slew rate, pull up strength, etc) to meet I2C specs for Standard/Fast mode vs High Speed mode. I think the best way is to map this to slew rate, which would require some explanation because the meaning of slew rate differs depending on what pin function is selected: - When I2C (*_SCL or *_SDA) function is selected for the pin: 0: Standard (100kbps) Fast mode (400kbps), 1: High Speed mode (3.4Mbps) - When IC_DM or IC_DP function is selected, 0: normal slew rate, 1: fast slew rate - Else: 0: fast slew rate, 1: normal slew rate Also, it seems like I have to add slew-rate to dt_params[] in pinconf-generic.c and pinctrl-bindings.txt. Hi Linus, So I will go ahead and make the change in pinconf-generic.c and pinctrl-bindings.txt to include parsing of the slew-rate property and submit it as part of my pinctrl changes. Question regarding pinctrl-generic: in pinctrl-bindings.txt, this is said about the function property: 169- function takes a list of function names/IDs as a required argument. The 170 specific binding for the hardware defines: 171 - Whether the entries are integers or strings, and their meaning. 172 - Whether only a single entry is allowed (which is applied to all entries 173in the pins property), or whether there may alternatively be one entry per 174entry in the pins property, in which case the list lengths must match, and 175for each list index i, the function at list index i is applied to the pin 176at list index i. (Although it looks like pinconf_generic_dt_subnode_to_map() does not support the one entry per pin feature for the function property yet.) In my driver, I have the one entry per pin support for all my properties instead of just the function property, like the drive_str property below: + grp_1 { + brcm,pins = pin1, pin2, pin3; + brcm,function = alt1, alt2, alt1; + brcm,drive_str = 2 4 6; + brcm,slew = 1; + }; I thought that would be convenient and allow users to group pins together based on functionality and without the restriction that the pins must have the same properties. Do you think that's a good idea and are there plans to support that in the generic pinconfig? If so, I can look into porting my implementation to pinconf-generic.c - but first I have to figure out how some of the properties would work if more than one value could be specified (eg. bias-disable which takes no values) Thanks, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
> +static const struct capri_cfg_param capri_pinconf_params[] = { > + {"brcm,hysteresis", CAPRI_PINCONF_PARAM_HYST}, > + {"brcm,pull", CAPRI_PINCONF_PARAM_PULL}, > + {"brcm,slew", CAPRI_PINCONF_PARAM_SLEW}, > + {"brcm,input_dis", CAPRI_PINCONF_PARAM_INPUT_DIS}, > + {"brcm,drive_str", CAPRI_PINCONF_PARAM_DRV_STR}, > + {"brcm,pull_up_str",CAPRI_PINCONF_PARAM_PULL_UP_STR}, > + {"brcm,mode", CAPRI_PINCONF_PARAM_MODE}, > +}; As well as all this stuff... >>> >>> OK. Will see if I can find something suitable for "input disable" and >>> "mode" >> >>Let's discuss this. What exactly does "input disable" and "mode" >>mean, in electrical terms? >> >>When you come down to what actually happens it may turn out that >>"input disable" is PIN_CONFIG_OUTPUT, which implicitly turns >>off input does it not? > >I'm going to verify the details with our hardware team first, and will let you >know if we think we can use one of the existing generic parameters or if we >need a new one. "input disable" This setting disconnects the input (DIN) to the internal logic from the pin pad. However, the output (DOUT) can still drive the pad. It seems to match PIN_CONFIG_OUTPUT, but the current generic option is either "output-low" or "output-high" - are these referring to a static output of 0 and 1? "mode" This controls several aspect of the pin (slew rate, pull up strength, etc) to meet I2C specs for Standard/Fast mode vs High Speed mode. I think the best way is to map this to slew rate, which would require some explanation because the meaning of slew rate differs depending on what pin function is selected: - When I2C (*_SCL or *_SDA) function is selected for the pin: 0: Standard (100kbps) & Fast mode (400kbps), 1: High Speed mode (3.4Mbps) - When IC_DM or IC_DP function is selected, 0: normal slew rate, 1: fast slew rate - Else: 0: fast slew rate, 1: normal slew rate Also, it seems like I have to add "slew-rate" to dt_params[] in pinconf-generic.c and pinctrl-bindings.txt. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
+static const struct capri_cfg_param capri_pinconf_params[] = { + {brcm,hysteresis, CAPRI_PINCONF_PARAM_HYST}, + {brcm,pull, CAPRI_PINCONF_PARAM_PULL}, + {brcm,slew, CAPRI_PINCONF_PARAM_SLEW}, + {brcm,input_dis, CAPRI_PINCONF_PARAM_INPUT_DIS}, + {brcm,drive_str, CAPRI_PINCONF_PARAM_DRV_STR}, + {brcm,pull_up_str,CAPRI_PINCONF_PARAM_PULL_UP_STR}, + {brcm,mode, CAPRI_PINCONF_PARAM_MODE}, +}; As well as all this stuff... OK. Will see if I can find something suitable for input disable and mode Let's discuss this. What exactly does input disable and mode mean, in electrical terms? When you come down to what actually happens it may turn out that input disable is PIN_CONFIG_OUTPUT, which implicitly turns off input does it not? I'm going to verify the details with our hardware team first, and will let you know if we think we can use one of the existing generic parameters or if we need a new one. input disable This setting disconnects the input (DIN) to the internal logic from the pin pad. However, the output (DOUT) can still drive the pad. It seems to match PIN_CONFIG_OUTPUT, but the current generic option is either output-low or output-high - are these referring to a static output of 0 and 1? mode This controls several aspect of the pin (slew rate, pull up strength, etc) to meet I2C specs for Standard/Fast mode vs High Speed mode. I think the best way is to map this to slew rate, which would require some explanation because the meaning of slew rate differs depending on what pin function is selected: - When I2C (*_SCL or *_SDA) function is selected for the pin: 0: Standard (100kbps) Fast mode (400kbps), 1: High Speed mode (3.4Mbps) - When IC_DM or IC_DP function is selected, 0: normal slew rate, 1: fast slew rate - Else: 0: fast slew rate, 1: normal slew rate Also, it seems like I have to add slew-rate to dt_params[] in pinconf-generic.c and pinctrl-bindings.txt. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
+static const struct capri_cfg_param capri_pinconf_params[] = { + {"brcm,hysteresis", CAPRI_PINCONF_PARAM_HYST}, + {"brcm,pull", CAPRI_PINCONF_PARAM_PULL}, + {"brcm,slew", CAPRI_PINCONF_PARAM_SLEW}, + {"brcm,input_dis", CAPRI_PINCONF_PARAM_INPUT_DIS}, + {"brcm,drive_str", CAPRI_PINCONF_PARAM_DRV_STR}, + {"brcm,pull_up_str",CAPRI_PINCONF_PARAM_PULL_UP_STR}, + {"brcm,mode", CAPRI_PINCONF_PARAM_MODE}, +}; >>> >>>As well as all this stuff... >> >> OK. Will see if I can find something suitable for "input disable" and "mode" > >Let's discuss this. What exactly does "input disable" and "mode" >mean, in electrical terms? > >When you come down to what actually happens it may turn out that >"input disable" is PIN_CONFIG_OUTPUT, which implicitly turns >off input does it not? I'm going to verify the details with our hardware team first, and will let you know if we think we can use one of the existing generic parameters or if we need a new one. Regards, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
+static const struct capri_cfg_param capri_pinconf_params[] = { + {brcm,hysteresis, CAPRI_PINCONF_PARAM_HYST}, + {brcm,pull, CAPRI_PINCONF_PARAM_PULL}, + {brcm,slew, CAPRI_PINCONF_PARAM_SLEW}, + {brcm,input_dis, CAPRI_PINCONF_PARAM_INPUT_DIS}, + {brcm,drive_str, CAPRI_PINCONF_PARAM_DRV_STR}, + {brcm,pull_up_str,CAPRI_PINCONF_PARAM_PULL_UP_STR}, + {brcm,mode, CAPRI_PINCONF_PARAM_MODE}, +}; As well as all this stuff... OK. Will see if I can find something suitable for input disable and mode Let's discuss this. What exactly does input disable and mode mean, in electrical terms? When you come down to what actually happens it may turn out that input disable is PIN_CONFIG_OUTPUT, which implicitly turns off input does it not? I'm going to verify the details with our hardware team first, and will let you know if we think we can use one of the existing generic parameters or if we need a new one. Regards, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
>> +config PINCTRL_CAPRI >> + bool "Broadcom Capri pinctrl driver" >> + select PINMUX >> + select PINCONF >> + help >> + Say Y here to support Broadcom Capri pinctrl driver, which is used >> for >> + the BCM281xx SoC family, including BCM11130, BCM11140, BCM11351, >> + BCM28145, and BCM28155 SoCs. This driver requires the pinctrl >> + framework. GPIO is provided by a separate GPIO driver. > >As mentioned this should be selecting and using GENERIC_PINCONF. >Basically I want that to happen before we look further at this code. > >(But I'll take a quick glance anyway...) Sure, working on it. >> +#define CAPRI_PINCONF_PACK(val, mask) (((val) << 16) | ((mask) & >> 0x)) >> +#define CAPRI_PINCONF_UNPACK_VAL(conf)((conf) >> 16) >> +#define CAPRI_PINCONF_UNPACK_MASK(conf) ((conf) & 0x) > >This custom horror goes away by using the macros from genric pin config > instead. Actually these are used differently than the pack/unpack functions in the pinconf- generic.h. These pack the bit value and bit mask to be written to a register, whereas the pinconf-generic ones pack the parameter id and value. But I get what you're saying and will try to reuse as much as possible from the pinconf generic functions and utils. >> +static const struct capri_cfg_param capri_pinconf_params[] = { >> + {"brcm,hysteresis", CAPRI_PINCONF_PARAM_HYST}, >> + {"brcm,pull", CAPRI_PINCONF_PARAM_PULL}, >> + {"brcm,slew", CAPRI_PINCONF_PARAM_SLEW}, >> + {"brcm,input_dis", CAPRI_PINCONF_PARAM_INPUT_DIS}, >> + {"brcm,drive_str", CAPRI_PINCONF_PARAM_DRV_STR}, >> + {"brcm,pull_up_str",CAPRI_PINCONF_PARAM_PULL_UP_STR}, >> + {"brcm,mode", CAPRI_PINCONF_PARAM_MODE}, >> +}; > >As well as all this stuff... OK. Will see if I can find something suitable for "input disable" and "mode" >> +/* Standard pin register */ > >Add some more elaborate explanation here. I am half-guessing that >most of the registers are laid out like this and then there are >two exceptions, then write that right here in the comment. > >(BTW: this is a HW/driver detail and should not be written in the >device tree doc as was done in patch 2) Yes you guessed correctly. Most of the pin have bit-field definitions like the "standard" or "std" pin register. There are 12 pins that have the i2c definitions, and 2 pins that have the hdmi definitions. Will add explanation to the code. However, I wanted to explain this in the DT doc as well because, for example, setting a slew rate for an hdmi pin would be invalid. >> +/* Macro to update reg with new pin config param */ >> +#define CAPRI_PIN_REG_SET(reg, type, param, val) \ >> + (((reg) & ~CAPRI_ ## type ## _PIN_REG_ ## param ## _MASK) \ >> + | (((val) << CAPRI_ ## type ## _PIN_REG_ ## param ## _SHIFT)\ >> + & CAPRI_ ## type ## _PIN_REG_ ## param ## _MASK)) > >No thanks. > >Rewrite this into a static inline which has the same effect when >compiling, but produces *WAY* more readable code than this >horrid thing. Plus you can type the arguments. Ok. The reason I used a macro is to take shortcuts given how the SHIFT and MASK #defines follow the format CAPRI__PIN_REG__ I'll try to simply this. >> +#define _PIN(offset) (offset) > >This macro isn't exactly useful. > >> +/* >> + * Pin number definition. The order here must be the same as defined in the >> + * PADCTRLREG block in the RDB. >> + */ >> +#define CAPRI_PIN_ADCSYNC _PIN(0) > >If it's just going to be like that, then skip the _PIN() macro. Removed. Was following pinctrl-tegra20.c where they have the _GPIO and _PIN macros. I guess it would be useful if we need to change the order of the enums in the future, but that's not the case at the moment for capri. >> +/* Process the pin configuration node */ >> +static int capri_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, >> + struct device_node *pnode, >> + struct pinctrl_map **map, >> + unsigned *nmaps) >> +{ > >Make use of these from pinctrl-utils.c: >pinctrl_utils_reserve_map() >pinctrl_utils_add_map_mux() >pinctrl_utils_add_map_configs() >pinctrl_utils_dt_free_map() > >Then you get rid of another big chunk of boilerplate code. > >After these changes the driver will be much smaller and >cleaner and we can take a closer look. Yea actually the generic code is similar to what I have, there are some differences in terms of pre-allocating / re-allocating the pinctrl_maps. Seems like there are very few users of these functions at the moment. Anyway I'll try to make use of them. Thanks for the review. Regards, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo
RE: [PATCH 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
>This should *all* be using generic pin config. > >For the devicetree side of this, read: >Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt > >Your driver should also be selecting GENERIC_PINCONF in >drivers/pinctrl/Kconfig so you use the generic pinconf >library. > >Read >include/linux/pinctrl/pinconf-generic.h >for definitions of the generic config options. > >Your driver should be calling >pinconf_generic_parse_dt_config() and >pinconf_generic_dt_subnode_to_map() to get the config >out of the device tree nodes. > >I don't understand the brcm,mode. Can this be selected on >all pins or just for I2C? I would suspect it be related to >things like disabling the schmitt-trigger, but elaborate on this >so we understand what this is. It may need to be added to the >generic options if it turns out to be unique enough. > >New options can be added but first we need to exactly understand >those to see that their definitions does not overlap with already >existing generic pin config terminology. > >> +The following are valid pin names and their pin types: >> + >> + "adcsync", std > >std? std what? > >Sorry I don't get anything from this list... you need to be way >more specific in defining what is happening here. Ok, I think some new APIs have been added since I first wrote this driver early this year. I'll take a look at the generic pin code and rework this driver. Thanks, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
This should *all* be using generic pin config. For the devicetree side of this, read: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt Your driver should also be selecting GENERIC_PINCONF in drivers/pinctrl/Kconfig so you use the generic pinconf library. Read include/linux/pinctrl/pinconf-generic.h for definitions of the generic config options. Your driver should be calling pinconf_generic_parse_dt_config() and pinconf_generic_dt_subnode_to_map() to get the config out of the device tree nodes. I don't understand the brcm,mode. Can this be selected on all pins or just for I2C? I would suspect it be related to things like disabling the schmitt-trigger, but elaborate on this so we understand what this is. It may need to be added to the generic options if it turns out to be unique enough. New options can be added but first we need to exactly understand those to see that their definitions does not overlap with already existing generic pin config terminology. +The following are valid pin names and their pin types: + + adcsync, std std? std what? Sorry I don't get anything from this list... you need to be way more specific in defining what is happening here. Ok, I think some new APIs have been added since I first wrote this driver early this year. I'll take a look at the generic pin code and rework this driver. Thanks, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
+config PINCTRL_CAPRI + bool Broadcom Capri pinctrl driver + select PINMUX + select PINCONF + help + Say Y here to support Broadcom Capri pinctrl driver, which is used for + the BCM281xx SoC family, including BCM11130, BCM11140, BCM11351, + BCM28145, and BCM28155 SoCs. This driver requires the pinctrl + framework. GPIO is provided by a separate GPIO driver. As mentioned this should be selecting and using GENERIC_PINCONF. Basically I want that to happen before we look further at this code. (But I'll take a quick glance anyway...) Sure, working on it. +#define CAPRI_PINCONF_PACK(val, mask) (((val) 16) | ((mask) 0x)) +#define CAPRI_PINCONF_UNPACK_VAL(conf)((conf) 16) +#define CAPRI_PINCONF_UNPACK_MASK(conf) ((conf) 0x) This custom horror goes away by using the macros from genric pin config linux/pinctrl/pinconf-generic.h instead. Actually these are used differently than the pack/unpack functions in the pinconf- generic.h. These pack the bit value and bit mask to be written to a register, whereas the pinconf-generic ones pack the parameter id and value. But I get what you're saying and will try to reuse as much as possible from the pinconf generic functions and utils. +static const struct capri_cfg_param capri_pinconf_params[] = { + {brcm,hysteresis, CAPRI_PINCONF_PARAM_HYST}, + {brcm,pull, CAPRI_PINCONF_PARAM_PULL}, + {brcm,slew, CAPRI_PINCONF_PARAM_SLEW}, + {brcm,input_dis, CAPRI_PINCONF_PARAM_INPUT_DIS}, + {brcm,drive_str, CAPRI_PINCONF_PARAM_DRV_STR}, + {brcm,pull_up_str,CAPRI_PINCONF_PARAM_PULL_UP_STR}, + {brcm,mode, CAPRI_PINCONF_PARAM_MODE}, +}; As well as all this stuff... OK. Will see if I can find something suitable for input disable and mode +/* Standard pin register */ Add some more elaborate explanation here. I am half-guessing that most of the registers are laid out like this and then there are two exceptions, then write that right here in the comment. (BTW: this is a HW/driver detail and should not be written in the device tree doc as was done in patch 2) Yes you guessed correctly. Most of the pin have bit-field definitions like the standard or std pin register. There are 12 pins that have the i2c definitions, and 2 pins that have the hdmi definitions. Will add explanation to the code. However, I wanted to explain this in the DT doc as well because, for example, setting a slew rate for an hdmi pin would be invalid. +/* Macro to update reg with new pin config param */ +#define CAPRI_PIN_REG_SET(reg, type, param, val) \ + (((reg) ~CAPRI_ ## type ## _PIN_REG_ ## param ## _MASK) \ + | (((val) CAPRI_ ## type ## _PIN_REG_ ## param ## _SHIFT)\ +CAPRI_ ## type ## _PIN_REG_ ## param ## _MASK)) No thanks. Rewrite this into a static inline which has the same effect when compiling, but produces *WAY* more readable code than this horrid thing. Plus you can type the arguments. Ok. The reason I used a macro is to take shortcuts given how the SHIFT and MASK #defines follow the format CAPRI_pin type_PIN_REG_parameter name_mask or shift I'll try to simply this. +#define _PIN(offset) (offset) This macro isn't exactly useful. +/* + * Pin number definition. The order here must be the same as defined in the + * PADCTRLREG block in the RDB. + */ +#define CAPRI_PIN_ADCSYNC _PIN(0) If it's just going to be like that, then skip the _PIN() macro. Removed. Was following pinctrl-tegra20.c where they have the _GPIO and _PIN macros. I guess it would be useful if we need to change the order of the enums in the future, but that's not the case at the moment for capri. +/* Process the pin configuration node */ +static int capri_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, + struct device_node *pnode, + struct pinctrl_map **map, + unsigned *nmaps) +{ Make use of these from pinctrl-utils.c: pinctrl_utils_reserve_map() pinctrl_utils_add_map_mux() pinctrl_utils_add_map_configs() pinctrl_utils_dt_free_map() Then you get rid of another big chunk of boilerplate code. After these changes the driver will be much smaller and cleaner and we can take a closer look. Yea actually the generic code is similar to what I have, there are some differences in terms of pre-allocating / re-allocating the pinctrl_maps. Seems like there are very few users of these functions at the moment. Anyway I'll try to make use of them. Thanks for the review. Regards, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at
RE: [PATCH 1/4] pinctrl: Add void * to pinctrl_pin_desc
>> --- >> Change-Id: I78b2c44b93d88b04897fd0af80ffce213e338d6b > >Why are you giving me this funky Gerrit stuff along with the patch? >It's not like I have any use for it, and anything below the three >dashes will be deleted when applying. > >The patch is OK but won't be applied until some driver is >using it (i.e. this BRCM one...) Sorry, I didn't remove it since it's after the 3 dashes and will be discarded anyway. Will remove Change-Id: from future patches. Regards, Sherman -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
RE: [PATCH 1/4] pinctrl: Add void * to pinctrl_pin_desc
--- Change-Id: I78b2c44b93d88b04897fd0af80ffce213e338d6b Why are you giving me this funky Gerrit stuff along with the patch? It's not like I have any use for it, and anything below the three dashes will be deleted when applying. The patch is OK but won't be applied until some driver is using it (i.e. this BRCM one...) Sorry, I didn't remove it since it's after the 3 dashes and will be discarded anyway. Will remove Change-Id: from future patches. Regards, Sherman -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 0/4] Add Broadcom Capri pinctrl driver
The following patches adds a pinctrl driver for Broadcom Capri (BCM281xx) SoCs. The first patch, adding the void * to pinctrl_pin_desc, has been previously discussed with LinusW. See this thread: http://lists.infradead.org/pipermail/linux-arm-kernel/2013-April/165880.html --- v2: Use hyphens instead of underscore in DT property names. Sherman Yin (4): pinctrl: Add void * to pinctrl_pin_desc pinctrl: Add pinctrl binding for Broadcom Capri SoCs ARM: pinctrl: Add Broadcom Capri pinctrl driver pinctrl: Enable pinctrl for Broadcom Capri SoCs .../bindings/pinctrl/brcm,capri-pinctrl.txt| 419 + arch/arm/boot/dts/bcm11351.dtsi|4 + arch/arm/mach-bcm/Kconfig |2 + drivers/pinctrl/Kconfig| 10 + drivers/pinctrl/Makefile |1 + drivers/pinctrl/pinctrl-capri.c| 1727 include/linux/pinctrl/pinctrl.h|2 + 7 files changed, 2165 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt create mode 100644 drivers/pinctrl/pinctrl-capri.c -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 4/4] pinctrl: Enable pinctrl for Broadcom Capri SoCs
Enable pinctrl for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v2: Use hyphens instead of underscore in DT property names. --- arch/arm/boot/dts/bcm11351.dtsi |4 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi index 05a5aab..f497a40 100644 --- a/arch/arm/boot/dts/bcm11351.dtsi +++ b/arch/arm/boot/dts/bcm11351.dtsi @@ -96,4 +96,8 @@ status = "disabled"; }; + pinctrl@35004800 { + compatible = "brcm,capri-pinctrl"; + reg = <0x35004800 0x430>; + }; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
Adds pinctrl driver for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v2: Use hyphens instead of underscore in DT property names. --- arch/arm/mach-bcm/Kconfig |2 + drivers/pinctrl/Kconfig | 10 + drivers/pinctrl/Makefile|1 + drivers/pinctrl/pinctrl-capri.c | 1727 +++ 4 files changed, 1740 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-capri.c diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index 69d67f7..2546365 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -10,6 +10,8 @@ config ARCH_BCM select GENERIC_CLOCKEVENTS select GENERIC_TIME select GPIO_BCM + select PINCTRL + select PINCTRL_CAPRI select SPARSE_IRQ select TICK_ONESHOT select CACHE_L2X0 diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index b6e864e..f97eb11 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -75,6 +75,16 @@ config PINCTRL_BCM2835 select PINMUX select PINCONF +config PINCTRL_CAPRI + bool "Broadcom Capri pinctrl driver" + select PINMUX + select PINCONF + help + Say Y here to support Broadcom Capri pinctrl driver, which is used for + the BCM281xx SoC family, including BCM11130, BCM11140, BCM11351, + BCM28145, and BCM28155 SoCs. This driver requires the pinctrl + framework. GPIO is provided by a separate GPIO driver. + config PINCTRL_IMX bool select PINMUX diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index 496d9bf..5e1a68e 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -17,6 +17,7 @@ obj-$(CONFIG_PINCTRL_AB8505) += pinctrl-ab8505.o obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o obj-$(CONFIG_PINCTRL_BAYTRAIL) += pinctrl-baytrail.o +obj-$(CONFIG_PINCTRL_CAPRI)+= pinctrl-capri.o obj-$(CONFIG_PINCTRL_IMX) += pinctrl-imx.o obj-$(CONFIG_PINCTRL_IMX35)+= pinctrl-imx35.o obj-$(CONFIG_PINCTRL_IMX51)+= pinctrl-imx51.o diff --git a/drivers/pinctrl/pinctrl-capri.c b/drivers/pinctrl/pinctrl-capri.c new file mode 100644 index 000..5ec17d0 --- /dev/null +++ b/drivers/pinctrl/pinctrl-capri.c @@ -0,0 +1,1727 @@ +/* + * Copyright (C) 2013 Broadcom Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "core.h" + +#define CAPRI_PINCONF_PACK(val, mask) (((val) << 16) | ((mask) & 0x)) +#define CAPRI_PINCONF_UNPACK_VAL(conf)((conf) >> 16) +#define CAPRI_PINCONF_UNPACK_MASK(conf) ((conf) & 0x) + +enum capri_pinconf_param { + CAPRI_PINCONF_PARAM_NONE = 0, + CAPRI_PINCONF_PARAM_HYST, + CAPRI_PINCONF_PARAM_PULL, + CAPRI_PINCONF_PARAM_SLEW, + CAPRI_PINCONF_PARAM_INPUT_DIS, + CAPRI_PINCONF_PARAM_DRV_STR, + CAPRI_PINCONF_PARAM_PULL_UP_STR, + CAPRI_PINCONF_PARAM_MODE, +}; + +struct capri_cfg_param { + const char *property; + enum capri_pinconf_param id; +}; + +static const struct capri_cfg_param capri_pinconf_params[] = { + {"brcm,hysteresis", CAPRI_PINCONF_PARAM_HYST}, + {"brcm,pull", CAPRI_PINCONF_PARAM_PULL}, + {"brcm,slew", CAPRI_PINCONF_PARAM_SLEW}, + {"brcm,input-dis", CAPRI_PINCONF_PARAM_INPUT_DIS}, + {"brcm,drive-str", CAPRI_PINCONF_PARAM_DRV_STR}, + {"brcm,pull-up-str",CAPRI_PINCONF_PARAM_PULL_UP_STR}, + {"brcm,mode", CAPRI_PINCONF_PARAM_MODE}, +}; + +/* Capri Pin Control Registers Definitions */ + +/* Functionn Select bits are the same for all pin control registers */ +#define CAPRI_PIN_REG_F_SEL_MASK 0x0700 +#define CAPRI_PIN_REG_F_SEL_SHIFT 8 + +/* Standard pin register */ +#define CAPRI_STD_PIN_REG_DRV_STR_MASK 0x0007 +#define CAPRI_STD_PIN_REG_DRV_STR_SHIFT0 +#define CAPRI_STD_PIN_REG_INPUT_DIS_MASK 0x0008 +#define CAPRI_STD_PIN_REG_INPUT_DIS_SHIFT 3 +#define CAPRI_STD_PIN_REG_SLEW_MASK0x0010 +#define CAPRI_STD_PIN_REG_SLEW_SHIFT 4 +#define CAPRI_STD_PIN_REG_PULL_MASK0x0060 +#define CAPRI_STD_PIN_REG_PULL_SHIFT 5 +#define CAPRI_STD_
[PATCH v2 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- v2: Use hyphens instead of underscore in DT property names. --- .../bindings/pinctrl/brcm,capri-pinctrl.txt| 419 1 file changed, 419 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt new file mode 100644 index 000..efee207 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt @@ -0,0 +1,419 @@ +Broadcom Capri Pin Controller + +This is a pin controller for the Broadcom BCM281xx SoC family, which includes +BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. + +=== Pin Controller Node === + +Required Properties: + +- compatible: Must be "brcm,capri-pinctrl". +- reg: Base address of the PAD Controller register block and the size + of the block. + +For example, the following is the bare minimum node: + + pinctrl@35004800 { + compatible = "brcm,capri-pinctrl"; + reg = <0x35004800 0x430>; + }; + +As a Pin Controller Device, in addition to the required properties, this node +should also contain the pin configuration nodes that client devices reference, +if any. + +=== Pin Configuration Node === + +Each pin configuration node is a sub-node of the pin controller node and is a +container of an arbitrary number of subnodes, called group nodes. + +Please refer to the pinctrl-bindings.txt in this directory for details of the +common pinctrl bindings used by client devices, including the definition of a +"pin configuration node". + +=== Group Node === + +A group node specifies the desired pin mux and/or pin configuration for an +arbitrary number of pins. The group node only affect the properties specified +in the node, and has no effect on any properties that are omitted. + +The names of the group nodes are optional and not used. The group nodes have +the following properties: + +Required Properties: + +- brcm,pins: Multiple strings. Specifies the name(s) of one or more pins to + be configured by this node. + +Optional Properties: + +- brcm,function: Multiple strings. Specifies the pin mux selection. Values are: + "alt1", "alt2", "alt3", "alt4" +- brcm,hysteresis: Multiple integers, applicable to standard pins only. Turns + on hysteresis of input. + 0: TTL input, 1: Schmitt Trigger input +- brcm,pull: Multiple integers, applicable to standard pins only. Specifies + pull-up or pull-down. + 0: neither, 1: pull-up, 2: pull-down, 3: both +- brcm,input-dis: Multiple integers, applicable to all pins. Input disable + control. + 0: off, 1: input disabled +- brcm,slew: Multiple integers. Slew rate of output. + 0: fast output, 1: normal output (most pins) + 0: normal output, 1: fast output (IC_DM and IC_DP) + 0: Fast mode, 1: High speed mode (I2C) +- brcm,drive-str: Multiple integers. Drive strength. + 0: 2 mA + 1: 4 mA + 2: 6 mA + 3: 8 mA + 4: 10 mA + 5: 12 mA + 6: 14 mA + 7: 16 mA +- brcm,pull-up-str: Multiple integers. Pull Up strength. + 0: No pull-up + 1: 1.2 kOhm + 2: 1.8 kOhm + 3: 720 Ohm + 4: 2.7 kOhm + 5: 831 Ohm + 6: 1.08 kOhm + 7: 568 Ohm +- brcm,mode: Multiple integers. Mode select. + 0: Fast mode, 1: High Speed mode (I2C) + +Any optional property must have 1 or n values, where n is the number of pins +specified in the brcm,pins property: +- If 1 value is specified for a property, this value is applied to all pins + listed in the brcm,pins property. +- If n values are specified, the i th value is applied to the i th pin, where + i is the index in the array of values and pins, and (0 <= i < n). This + provides an easy way to set different values for different pins in the same + group. + +Example: + + // pin configuration node + dev_a_active { + //group node + grp_1 { + brcm,pins = "pin1", "pin2", "pin3"; + brcm,function = "alt1"; + brcm,drive-str = <2 4 6>; + brcm,slew = <1>; + }; + + grp_2 { + ... + }; + + ... + }; + +In the example above, "dev_a_active"
[PATCH v2 1/4] pinctrl: Add void * to pinctrl_pin_desc
drv_data is added to the pinctrl_pin_desc for drivers to define additional driver-specific per-pin data. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- Change-Id: I78b2c44b93d88b04897fd0af80ffce213e338d6b v2: Use hyphens instead of underscore in DT property names. --- include/linux/pinctrl/pinctrl.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 5979147..c8e42c4 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -32,10 +32,12 @@ struct device_node; * pins, pads or other muxable units in this struct * @number: unique pin number from the global pin number space * @name: a name for this pin + * @drv_data: driver-defined per-pin data. pinctrl core does not touch this */ struct pinctrl_pin_desc { unsigned number; const char *name; + void *drv_data; }; /* Convenience macro to define a single named or anonymous pin descriptor */ -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 1/4] pinctrl: Add void * to pinctrl_pin_desc
drv_data is added to the pinctrl_pin_desc for drivers to define additional driver-specific per-pin data. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- Change-Id: I78b2c44b93d88b04897fd0af80ffce213e338d6b v2: Use hyphens instead of underscore in DT property names. --- include/linux/pinctrl/pinctrl.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 5979147..c8e42c4 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -32,10 +32,12 @@ struct device_node; * pins, pads or other muxable units in this struct * @number: unique pin number from the global pin number space * @name: a name for this pin + * @drv_data: driver-defined per-pin data. pinctrl core does not touch this */ struct pinctrl_pin_desc { unsigned number; const char *name; + void *drv_data; }; /* Convenience macro to define a single named or anonymous pin descriptor */ -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 2/4] pinctrl: Add pinctrl binding for Broadcom Capri SoCs
Adds pinctrl driver devicetree binding for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v2: Use hyphens instead of underscore in DT property names. --- .../bindings/pinctrl/brcm,capri-pinctrl.txt| 419 1 file changed, 419 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt diff --git a/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt new file mode 100644 index 000..efee207 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt @@ -0,0 +1,419 @@ +Broadcom Capri Pin Controller + +This is a pin controller for the Broadcom BCM281xx SoC family, which includes +BCM11130, BCM11140, BCM11351, BCM28145, and BCM28155 SoCs. + +=== Pin Controller Node === + +Required Properties: + +- compatible: Must be brcm,capri-pinctrl. +- reg: Base address of the PAD Controller register block and the size + of the block. + +For example, the following is the bare minimum node: + + pinctrl@35004800 { + compatible = brcm,capri-pinctrl; + reg = 0x35004800 0x430; + }; + +As a Pin Controller Device, in addition to the required properties, this node +should also contain the pin configuration nodes that client devices reference, +if any. + +=== Pin Configuration Node === + +Each pin configuration node is a sub-node of the pin controller node and is a +container of an arbitrary number of subnodes, called group nodes. + +Please refer to the pinctrl-bindings.txt in this directory for details of the +common pinctrl bindings used by client devices, including the definition of a +pin configuration node. + +=== Group Node === + +A group node specifies the desired pin mux and/or pin configuration for an +arbitrary number of pins. The group node only affect the properties specified +in the node, and has no effect on any properties that are omitted. + +The names of the group nodes are optional and not used. The group nodes have +the following properties: + +Required Properties: + +- brcm,pins: Multiple strings. Specifies the name(s) of one or more pins to + be configured by this node. + +Optional Properties: + +- brcm,function: Multiple strings. Specifies the pin mux selection. Values are: + alt1, alt2, alt3, alt4 +- brcm,hysteresis: Multiple integers, applicable to standard pins only. Turns + on hysteresis of input. + 0: TTL input, 1: Schmitt Trigger input +- brcm,pull: Multiple integers, applicable to standard pins only. Specifies + pull-up or pull-down. + 0: neither, 1: pull-up, 2: pull-down, 3: both +- brcm,input-dis: Multiple integers, applicable to all pins. Input disable + control. + 0: off, 1: input disabled +- brcm,slew: Multiple integers. Slew rate of output. + 0: fast output, 1: normal output (most pins) + 0: normal output, 1: fast output (IC_DM and IC_DP) + 0: Fast mode, 1: High speed mode (I2C) +- brcm,drive-str: Multiple integers. Drive strength. + 0: 2 mA + 1: 4 mA + 2: 6 mA + 3: 8 mA + 4: 10 mA + 5: 12 mA + 6: 14 mA + 7: 16 mA +- brcm,pull-up-str: Multiple integers. Pull Up strength. + 0: No pull-up + 1: 1.2 kOhm + 2: 1.8 kOhm + 3: 720 Ohm + 4: 2.7 kOhm + 5: 831 Ohm + 6: 1.08 kOhm + 7: 568 Ohm +- brcm,mode: Multiple integers. Mode select. + 0: Fast mode, 1: High Speed mode (I2C) + +Any optional property must have 1 or n values, where n is the number of pins +specified in the brcm,pins property: +- If 1 value is specified for a property, this value is applied to all pins + listed in the brcm,pins property. +- If n values are specified, the i th value is applied to the i th pin, where + i is the index in the array of values and pins, and (0 = i n). This + provides an easy way to set different values for different pins in the same + group. + +Example: + + // pin configuration node + dev_a_active { + //group node + grp_1 { + brcm,pins = pin1, pin2, pin3; + brcm,function = alt1; + brcm,drive-str = 2 4 6; + brcm,slew = 1; + }; + + grp_2 { + ... + }; + + ... + }; + +In the example above, dev_a_active is a pin configuration node and has a +number of sub-nodes. In the group node grp_1, 3 pins are defined in the +brcm
[PATCH v2 4/4] pinctrl: Enable pinctrl for Broadcom Capri SoCs
Enable pinctrl for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v2: Use hyphens instead of underscore in DT property names. --- arch/arm/boot/dts/bcm11351.dtsi |4 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/bcm11351.dtsi b/arch/arm/boot/dts/bcm11351.dtsi index 05a5aab..f497a40 100644 --- a/arch/arm/boot/dts/bcm11351.dtsi +++ b/arch/arm/boot/dts/bcm11351.dtsi @@ -96,4 +96,8 @@ status = disabled; }; + pinctrl@35004800 { + compatible = brcm,capri-pinctrl; + reg = 0x35004800 0x430; + }; }; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
Adds pinctrl driver for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin s...@broadcom.com Reviewed-by: Christian Daudt b...@fixthebug.org Reviewed-by: Matt Porter matt.por...@linaro.org --- v2: Use hyphens instead of underscore in DT property names. --- arch/arm/mach-bcm/Kconfig |2 + drivers/pinctrl/Kconfig | 10 + drivers/pinctrl/Makefile|1 + drivers/pinctrl/pinctrl-capri.c | 1727 +++ 4 files changed, 1740 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-capri.c diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index 69d67f7..2546365 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -10,6 +10,8 @@ config ARCH_BCM select GENERIC_CLOCKEVENTS select GENERIC_TIME select GPIO_BCM + select PINCTRL + select PINCTRL_CAPRI select SPARSE_IRQ select TICK_ONESHOT select CACHE_L2X0 diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index b6e864e..f97eb11 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -75,6 +75,16 @@ config PINCTRL_BCM2835 select PINMUX select PINCONF +config PINCTRL_CAPRI + bool Broadcom Capri pinctrl driver + select PINMUX + select PINCONF + help + Say Y here to support Broadcom Capri pinctrl driver, which is used for + the BCM281xx SoC family, including BCM11130, BCM11140, BCM11351, + BCM28145, and BCM28155 SoCs. This driver requires the pinctrl + framework. GPIO is provided by a separate GPIO driver. + config PINCTRL_IMX bool select PINMUX diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index 496d9bf..5e1a68e 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -17,6 +17,7 @@ obj-$(CONFIG_PINCTRL_AB8505) += pinctrl-ab8505.o obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o obj-$(CONFIG_PINCTRL_BAYTRAIL) += pinctrl-baytrail.o +obj-$(CONFIG_PINCTRL_CAPRI)+= pinctrl-capri.o obj-$(CONFIG_PINCTRL_IMX) += pinctrl-imx.o obj-$(CONFIG_PINCTRL_IMX35)+= pinctrl-imx35.o obj-$(CONFIG_PINCTRL_IMX51)+= pinctrl-imx51.o diff --git a/drivers/pinctrl/pinctrl-capri.c b/drivers/pinctrl/pinctrl-capri.c new file mode 100644 index 000..5ec17d0 --- /dev/null +++ b/drivers/pinctrl/pinctrl-capri.c @@ -0,0 +1,1727 @@ +/* + * Copyright (C) 2013 Broadcom Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed as is WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include linux/err.h +#include linux/io.h +#include linux/module.h +#include linux/of.h +#include linux/platform_device.h +#include linux/pinctrl/pinctrl.h +#include linux/pinctrl/pinmux.h +#include linux/pinctrl/pinconf.h +#include linux/slab.h +#include core.h + +#define CAPRI_PINCONF_PACK(val, mask) (((val) 16) | ((mask) 0x)) +#define CAPRI_PINCONF_UNPACK_VAL(conf)((conf) 16) +#define CAPRI_PINCONF_UNPACK_MASK(conf) ((conf) 0x) + +enum capri_pinconf_param { + CAPRI_PINCONF_PARAM_NONE = 0, + CAPRI_PINCONF_PARAM_HYST, + CAPRI_PINCONF_PARAM_PULL, + CAPRI_PINCONF_PARAM_SLEW, + CAPRI_PINCONF_PARAM_INPUT_DIS, + CAPRI_PINCONF_PARAM_DRV_STR, + CAPRI_PINCONF_PARAM_PULL_UP_STR, + CAPRI_PINCONF_PARAM_MODE, +}; + +struct capri_cfg_param { + const char *property; + enum capri_pinconf_param id; +}; + +static const struct capri_cfg_param capri_pinconf_params[] = { + {brcm,hysteresis, CAPRI_PINCONF_PARAM_HYST}, + {brcm,pull, CAPRI_PINCONF_PARAM_PULL}, + {brcm,slew, CAPRI_PINCONF_PARAM_SLEW}, + {brcm,input-dis, CAPRI_PINCONF_PARAM_INPUT_DIS}, + {brcm,drive-str, CAPRI_PINCONF_PARAM_DRV_STR}, + {brcm,pull-up-str,CAPRI_PINCONF_PARAM_PULL_UP_STR}, + {brcm,mode, CAPRI_PINCONF_PARAM_MODE}, +}; + +/* Capri Pin Control Registers Definitions */ + +/* Functionn Select bits are the same for all pin control registers */ +#define CAPRI_PIN_REG_F_SEL_MASK 0x0700 +#define CAPRI_PIN_REG_F_SEL_SHIFT 8 + +/* Standard pin register */ +#define CAPRI_STD_PIN_REG_DRV_STR_MASK 0x0007 +#define CAPRI_STD_PIN_REG_DRV_STR_SHIFT0 +#define CAPRI_STD_PIN_REG_INPUT_DIS_MASK 0x0008 +#define CAPRI_STD_PIN_REG_INPUT_DIS_SHIFT 3 +#define CAPRI_STD_PIN_REG_SLEW_MASK0x0010 +#define CAPRI_STD_PIN_REG_SLEW_SHIFT 4 +#define CAPRI_STD_PIN_REG_PULL_MASK0x0060 +#define
[PATCH v2 0/4] Add Broadcom Capri pinctrl driver
The following patches adds a pinctrl driver for Broadcom Capri (BCM281xx) SoCs. The first patch, adding the void * to pinctrl_pin_desc, has been previously discussed with LinusW. See this thread: http://lists.infradead.org/pipermail/linux-arm-kernel/2013-April/165880.html --- v2: Use hyphens instead of underscore in DT property names. Sherman Yin (4): pinctrl: Add void * to pinctrl_pin_desc pinctrl: Add pinctrl binding for Broadcom Capri SoCs ARM: pinctrl: Add Broadcom Capri pinctrl driver pinctrl: Enable pinctrl for Broadcom Capri SoCs .../bindings/pinctrl/brcm,capri-pinctrl.txt| 419 + arch/arm/boot/dts/bcm11351.dtsi|4 + arch/arm/mach-bcm/Kconfig |2 + drivers/pinctrl/Kconfig| 10 + drivers/pinctrl/Makefile |1 + drivers/pinctrl/pinctrl-capri.c| 1727 include/linux/pinctrl/pinctrl.h|2 + 7 files changed, 2165 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt create mode 100644 drivers/pinctrl/pinctrl-capri.c -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 3/4] ARM: pinctrl: Add Broadcom Capri pinctrl driver
Adds pinctrl driver for Broadcom Capri (BCM281xx) SoCs. Signed-off-by: Sherman Yin Reviewed-by: Christian Daudt Reviewed-by: Matt Porter --- arch/arm/mach-bcm/Kconfig |2 + drivers/pinctrl/Kconfig | 10 + drivers/pinctrl/Makefile|1 + drivers/pinctrl/pinctrl-capri.c | 1727 +++ 4 files changed, 1740 insertions(+) create mode 100644 drivers/pinctrl/pinctrl-capri.c diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig index 69d67f7..2546365 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -10,6 +10,8 @@ config ARCH_BCM select GENERIC_CLOCKEVENTS select GENERIC_TIME select GPIO_BCM + select PINCTRL + select PINCTRL_CAPRI select SPARSE_IRQ select TICK_ONESHOT select CACHE_L2X0 diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index b6e864e..f97eb11 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig @@ -75,6 +75,16 @@ config PINCTRL_BCM2835 select PINMUX select PINCONF +config PINCTRL_CAPRI + bool "Broadcom Capri pinctrl driver" + select PINMUX + select PINCONF + help + Say Y here to support Broadcom Capri pinctrl driver, which is used for + the BCM281xx SoC family, including BCM11130, BCM11140, BCM11351, + BCM28145, and BCM28155 SoCs. This driver requires the pinctrl + framework. GPIO is provided by a separate GPIO driver. + config PINCTRL_IMX bool select PINMUX diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index 496d9bf..5e1a68e 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile @@ -17,6 +17,7 @@ obj-$(CONFIG_PINCTRL_AB8505) += pinctrl-ab8505.o obj-$(CONFIG_PINCTRL_AT91) += pinctrl-at91.o obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o obj-$(CONFIG_PINCTRL_BAYTRAIL) += pinctrl-baytrail.o +obj-$(CONFIG_PINCTRL_CAPRI)+= pinctrl-capri.o obj-$(CONFIG_PINCTRL_IMX) += pinctrl-imx.o obj-$(CONFIG_PINCTRL_IMX35)+= pinctrl-imx35.o obj-$(CONFIG_PINCTRL_IMX51)+= pinctrl-imx51.o diff --git a/drivers/pinctrl/pinctrl-capri.c b/drivers/pinctrl/pinctrl-capri.c new file mode 100644 index 000..2a4dcf1 --- /dev/null +++ b/drivers/pinctrl/pinctrl-capri.c @@ -0,0 +1,1727 @@ +/* + * Copyright (C) 2013 Broadcom Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "core.h" + +#define CAPRI_PINCONF_PACK(val, mask) (((val) << 16) | ((mask) & 0x)) +#define CAPRI_PINCONF_UNPACK_VAL(conf)((conf) >> 16) +#define CAPRI_PINCONF_UNPACK_MASK(conf) ((conf) & 0x) + +enum capri_pinconf_param { + CAPRI_PINCONF_PARAM_NONE = 0, + CAPRI_PINCONF_PARAM_HYST, + CAPRI_PINCONF_PARAM_PULL, + CAPRI_PINCONF_PARAM_SLEW, + CAPRI_PINCONF_PARAM_INPUT_DIS, + CAPRI_PINCONF_PARAM_DRV_STR, + CAPRI_PINCONF_PARAM_PULL_UP_STR, + CAPRI_PINCONF_PARAM_MODE, +}; + +struct capri_cfg_param { + const char *property; + enum capri_pinconf_param id; +}; + +static const struct capri_cfg_param capri_pinconf_params[] = { + {"brcm,hysteresis", CAPRI_PINCONF_PARAM_HYST}, + {"brcm,pull", CAPRI_PINCONF_PARAM_PULL}, + {"brcm,slew", CAPRI_PINCONF_PARAM_SLEW}, + {"brcm,input_dis", CAPRI_PINCONF_PARAM_INPUT_DIS}, + {"brcm,drive_str", CAPRI_PINCONF_PARAM_DRV_STR}, + {"brcm,pull_up_str",CAPRI_PINCONF_PARAM_PULL_UP_STR}, + {"brcm,mode", CAPRI_PINCONF_PARAM_MODE}, +}; + +/* Capri Pin Control Registers Definitions */ + +/* Functionn Select bits are the same for all pin control registers */ +#define CAPRI_PIN_REG_F_SEL_MASK 0x0700 +#define CAPRI_PIN_REG_F_SEL_SHIFT 8 + +/* Standard pin register */ +#define CAPRI_STD_PIN_REG_DRV_STR_MASK 0x0007 +#define CAPRI_STD_PIN_REG_DRV_STR_SHIFT0 +#define CAPRI_STD_PIN_REG_INPUT_DIS_MASK 0x0008 +#define CAPRI_STD_PIN_REG_INPUT_DIS_SHIFT 3 +#define CAPRI_STD_PIN_REG_SLEW_MASK0x0010 +#define CAPRI_STD_PIN_REG_SLEW_SHIFT 4 +#define CAPRI_STD_PIN_REG_PULL_MASK0x0060 +#define CAPRI_STD_PIN_REG_PULL_SHIFT 5 +#define CAPRI_STD_PIN_REG_HYST_MASK0x0080 +#define CAPRI_STD_
[PATCH 0/4] Add Broadcom Capri pinctrl driver
The following patches adds a pinctrl driver for Broadcom Capri (BCM281xx) SoCs. The first patch, adding the void * to pinctrl_pin_desc, has been previously discussed with LinusW. See this thread: http://lists.infradead.org/pipermail/linux-arm-kernel/2013-April/165880.html Sherman Yin (4): pinctrl: Add void * to pinctrl_pin_desc pinctrl: Add pinctrl binding for Broadcom Capri SoCs ARM: pinctrl: Add Broadcom Capri pinctrl driver pinctrl: Enable pinctrl for Broadcom Capri SoCs .../bindings/pinctrl/brcm,capri-pinctrl.txt| 419 + arch/arm/boot/dts/bcm11351.dtsi|4 + arch/arm/mach-bcm/Kconfig |2 + drivers/pinctrl/Kconfig| 10 + drivers/pinctrl/Makefile |1 + drivers/pinctrl/pinctrl-capri.c| 1727 include/linux/pinctrl/pinctrl.h|2 + 7 files changed, 2165 insertions(+) create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,capri-pinctrl.txt create mode 100644 drivers/pinctrl/pinctrl-capri.c -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/