Skip to contentSkip to conversation

pinctrl: intel: Add Intel Merrifield pin controller support

PATCH In review Andy Shevchenko 3 participants 5 messages Jun 23, 2016 – Sep 7, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 pinctrl: intel: Add Intel Merrifield pin controller support

This driver adds pinctrl support for Intel Merrifield. The IP block which is called Family-Level Interface Shim is a separate entity in SoC. The GPIO driver (gpio-intel-mid.c) will be updated accordingly to support pinctrl interface.

---
In v4:
- make style consistent
- name driver "pinctrl-merrifield"
- add tag

 drivers/pinctrl/intel/Kconfig              |  11 +
 drivers/pinctrl/intel/Makefile             |   1 +
 drivers/pinctrl/intel/pinctrl-merrifield.c | 911 +++++++++++++++++++++++++++++
 3 files changed, 923 insertions(+)
 create mode 100644 drivers/pinctrl/intel/pinctrl-merrifield.c
drivers/pinctrl/intel/Kconfig +11 -0
index 1c74e03..00fb055 100644
@@ -29,6 +29,17 @@ config PINCTRL_CHERRYVIEW
 	  Cherryview/Braswell pinctrl driver provides an interface that
 	  allows configuring of SoC pins and using them as GPIOs.
 
+config PINCTRL_MERRIFIELD
+	tristate "Intel Merrifield pinctrl driver"
+	depends on X86_INTEL_MID
+	select PINMUX
+	select PINCONF
+	select GENERIC_PINCONF
+	help
+	  Merrifield Family-Level Interface Shim (FLIS) driver provides an
+	  interface that allows configuring of SoC pins and using them as
+	  GPIOs.
+
 config PINCTRL_INTEL
 	tristate
 	select PINMUX
drivers/pinctrl/intel/Makefile +1 -0
index 03bc68e..3080307 100644
@@ -2,6 +2,7 @@
 
 obj-$(CONFIG_PINCTRL_BAYTRAIL)		+= pinctrl-baytrail.o
 obj-$(CONFIG_PINCTRL_CHERRYVIEW)	+= pinctrl-cherryview.o
+obj-$(CONFIG_PINCTRL_MERRIFIELD)	+= pinctrl-merrifield.o
 obj-$(CONFIG_PINCTRL_INTEL)		+= pinctrl-intel.o
 obj-$(CONFIG_PINCTRL_BROXTON)		+= pinctrl-broxton.o
 obj-$(CONFIG_PINCTRL_SUNRISEPOINT)	+= pinctrl-sunrisepoint.o
drivers/pinctrl/intel/pinctrl-merrifield.c new file +911 -0

911 lines not on this page · raw message

Signature · 1 line
2.8.1
#2 lore raw

PATCH 1/1 pinctrl: intel: merrifield: fix dup size in probe

In reply to Andy Shevchenko

In function mrfld_pinctrl_probe(), when duplicating the mrfld_families array the requested memory region length is multiplied once too many by the number of elements in the original array. Fix this to spare some memory.

Fixes 4e80c8f505741cbd ("pinctrl: intel: Add Intel Merrifield pin controller support")
Cc Andy Shevchenko <[email protected]>
Cc Linus Walleij <[email protected]>
---
 drivers/pinctrl/intel/pinctrl-merrifield.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/intel/pinctrl-merrifield.c +1 -1
index 7fb7656..7826c7f 100644
@@ -854,7 +854,7 @@ static int mrfld_pinctrl_probe(struct platform_device *pdev)
 	 */
 	nfamilies = ARRAY_SIZE(mrfld_families),
 	families = devm_kmemdup(&pdev->dev, mrfld_families,
-					    nfamilies * sizeof(mrfld_families),
+					    sizeof(mrfld_families),
 					    GFP_KERNEL);
 	if (!families)
 		return -ENOMEM;
Signature · 1 line
2.9.3
author Acked-by on v1 1/1
#3 lore raw

Re: [PATCH] pinctrl: intel: merrifield: fix dup size in probe

Quoted 5 lines · Vincent Stehlé

In function mrfld_pinctrl_probe(), when duplicating the mrfld_families array the requested memory region length is multiplied once too many by the
number of elements in the original array. Fix this to spare some memory.

Good catch!

P.S. Linus, perhaps this is material for -rc5.

Quoted 26 lines
Fixes 4e80c8f505741cbd ("pinctrl: intel: Add Intel Merrifield pin

controller support")

Cc Andy Shevchenko <[email protected]>
Cc Linus Walleij <[email protected]>

---
 drivers/pinctrl/intel/pinctrl-merrifield.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/intel/pinctrl-merrifield.c +1 -1
index 7fb7656..7826c7f 100644
@@ -854,7 +854,7 @@ static int mrfld_pinctrl_probe(struct
 platform_device *pdev)
  	 */
  	nfamilies = ARRAY_SIZE(mrfld_families),
  	families = devm_kmemdup(&pdev->dev, mrfld_families,
-					    nfamilies *
 sizeof(mrfld_families),
+					    sizeof(mrfld_families),
  					    GFP_KERNEL);

  if (!families)
  return -ENOMEM;

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#4 lore raw

Re: [PATCH] pinctrl: intel: merrifield: fix dup size in probe

In reply to Vincent Stehlé
Quoted 8 lines · Vincent Stehlé

In function mrfld_pinctrl_probe(), when duplicating the mrfld_families array the requested memory region length is multiplied once too many by the number of elements in the original array. Fix this to spare some memory.

Fixes 4e80c8f505741cbd ("pinctrl: intel: Add Intel Merrifield pin controller support")
Cc Andy Shevchenko <[email protected]>
Cc Linus Walleij <[email protected]>

Patch applied for fixes with Andy's ACK.

Yours,
Linus Walleij