* [PATCH 1/3] pinctrl: madera: Use local copy of pdata
@ 2019-07-22 9:10 Charles Keepax
2019-07-22 9:10 ` [PATCH 2/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L15 Charles Keepax
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Charles Keepax @ 2019-07-22 9:10 UTC (permalink / raw)
To: linus.walleij; +Cc: linux-gpio, patches
A local copy of the pdata exists and it should be used rather than
pulling a fresh copy.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
drivers/pinctrl/cirrus/pinctrl-madera-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/cirrus/pinctrl-madera-core.c b/drivers/pinctrl/cirrus/pinctrl-madera-core.c
index c6b9f65f23621..0c7fa1febc802 100644
--- a/drivers/pinctrl/cirrus/pinctrl-madera-core.c
+++ b/drivers/pinctrl/cirrus/pinctrl-madera-core.c
@@ -986,7 +986,7 @@ static struct pinctrl_desc madera_pin_desc = {
static int madera_pin_probe(struct platform_device *pdev)
{
struct madera *madera = dev_get_drvdata(pdev->dev.parent);
- const struct madera_pdata *pdata = dev_get_platdata(madera->dev);
+ const struct madera_pdata *pdata = &madera->pdata;
struct madera_pin_private *priv;
int ret;
@@ -1037,7 +1037,7 @@ static int madera_pin_probe(struct platform_device *pdev)
}
/* if the configuration is provided through pdata, apply it */
- if (pdata && pdata->gpio_configs) {
+ if (pdata->gpio_configs) {
ret = pinctrl_register_mappings(pdata->gpio_configs,
pdata->n_gpio_configs);
if (ret) {
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L15
2019-07-22 9:10 [PATCH 1/3] pinctrl: madera: Use local copy of pdata Charles Keepax
@ 2019-07-22 9:10 ` Charles Keepax
2019-08-05 9:47 ` Linus Walleij
2019-07-22 9:10 ` [PATCH 3/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L92 Charles Keepax
2019-08-05 9:46 ` [PATCH 1/3] pinctrl: madera: Use local copy of pdata Linus Walleij
2 siblings, 1 reply; 6+ messages in thread
From: Charles Keepax @ 2019-07-22 9:10 UTC (permalink / raw)
To: linus.walleij; +Cc: linux-gpio, patches
From: Richard Fitzgerald <rf@opensource.cirrus.com>
This adds the pinctrl configuration for the CS47L15 codec to
the madera pinctrl driver.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
drivers/pinctrl/cirrus/Kconfig | 3 +++
drivers/pinctrl/cirrus/Makefile | 3 +++
drivers/pinctrl/cirrus/pinctrl-cs47l15.c | 40 ++++++++++++++++++++++++++++
drivers/pinctrl/cirrus/pinctrl-madera-core.c | 4 +++
drivers/pinctrl/cirrus/pinctrl-madera.h | 1 +
5 files changed, 51 insertions(+)
create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs47l15.c
diff --git a/drivers/pinctrl/cirrus/Kconfig b/drivers/pinctrl/cirrus/Kconfig
index e546a6b75b4d7..ef01a0b062730 100644
--- a/drivers/pinctrl/cirrus/Kconfig
+++ b/drivers/pinctrl/cirrus/Kconfig
@@ -15,6 +15,9 @@ config PINCTRL_MADERA
select PINMUX
select GENERIC_PINCONF
+config PINCTRL_CS47L15
+ bool
+
config PINCTRL_CS47L35
bool
diff --git a/drivers/pinctrl/cirrus/Makefile b/drivers/pinctrl/cirrus/Makefile
index 0c5deb62153ef..491bcb658d8e1 100644
--- a/drivers/pinctrl/cirrus/Makefile
+++ b/drivers/pinctrl/cirrus/Makefile
@@ -3,6 +3,9 @@
obj-$(CONFIG_PINCTRL_LOCHNAGAR) += pinctrl-lochnagar.o
pinctrl-madera-objs := pinctrl-madera-core.o
+ifeq ($(CONFIG_PINCTRL_CS47L15),y)
+pinctrl-madera-objs += pinctrl-cs47l15.o
+endif
ifeq ($(CONFIG_PINCTRL_CS47L35),y)
pinctrl-madera-objs += pinctrl-cs47l35.o
endif
diff --git a/drivers/pinctrl/cirrus/pinctrl-cs47l15.c b/drivers/pinctrl/cirrus/pinctrl-cs47l15.c
new file mode 100644
index 0000000000000..a4bfec5281d07
--- /dev/null
+++ b/drivers/pinctrl/cirrus/pinctrl-cs47l15.c
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Pinctrl for Cirrus Logic CS47L15
+ *
+ * Copyright (C) 2018-2019 Cirrus Logic, Inc. and
+ * Cirrus Logic International Semiconductor Ltd.
+ */
+
+#include <linux/err.h>
+#include <linux/mfd/madera/core.h>
+
+#include "pinctrl-madera.h"
+
+/*
+ * The alt func groups are the most commonly used functions we place these at
+ * the lower function indexes for convenience, and the less commonly used gpio
+ * functions at higher indexes.
+ *
+ * To stay consistent with the datasheet the function names are the same as
+ * the group names for that function's pins
+ *
+ * Note - all 1 less than in datasheet because these are zero-indexed
+ */
+static const unsigned int cs47l15_aif1_pins[] = { 0, 1, 2, 3 };
+static const unsigned int cs47l15_aif2_pins[] = { 4, 5, 6, 7 };
+static const unsigned int cs47l15_aif3_pins[] = { 8, 9, 10, 11 };
+static const unsigned int cs47l15_spk1_pins[] = { 12, 13, 14 };
+
+static const struct madera_pin_groups cs47l15_pin_groups[] = {
+ { "aif1", cs47l15_aif1_pins, ARRAY_SIZE(cs47l15_aif1_pins) },
+ { "aif2", cs47l15_aif2_pins, ARRAY_SIZE(cs47l15_aif2_pins) },
+ { "aif3", cs47l15_aif3_pins, ARRAY_SIZE(cs47l15_aif3_pins) },
+ { "pdmspk1", cs47l15_spk1_pins, ARRAY_SIZE(cs47l15_spk1_pins) },
+};
+
+const struct madera_pin_chip cs47l15_pin_chip = {
+ .n_pins = CS47L15_NUM_GPIOS,
+ .pin_groups = cs47l15_pin_groups,
+ .n_pin_groups = ARRAY_SIZE(cs47l15_pin_groups),
+};
diff --git a/drivers/pinctrl/cirrus/pinctrl-madera-core.c b/drivers/pinctrl/cirrus/pinctrl-madera-core.c
index 0c7fa1febc802..64281ad5c1b9e 100644
--- a/drivers/pinctrl/cirrus/pinctrl-madera-core.c
+++ b/drivers/pinctrl/cirrus/pinctrl-madera-core.c
@@ -1004,6 +1004,10 @@ static int madera_pin_probe(struct platform_device *pdev)
pdev->dev.of_node = madera->dev->of_node;
switch (madera->type) {
+ case CS47L15:
+ if (IS_ENABLED(CONFIG_PINCTRL_CS47L15))
+ priv->chip = &cs47l15_pin_chip;
+ break;
case CS47L35:
if (IS_ENABLED(CONFIG_PINCTRL_CS47L35))
priv->chip = &cs47l35_pin_chip;
diff --git a/drivers/pinctrl/cirrus/pinctrl-madera.h b/drivers/pinctrl/cirrus/pinctrl-madera.h
index 4ae13918316fe..a10f0238dd928 100644
--- a/drivers/pinctrl/cirrus/pinctrl-madera.h
+++ b/drivers/pinctrl/cirrus/pinctrl-madera.h
@@ -30,6 +30,7 @@ struct madera_pin_private {
struct pinctrl_dev *pctl;
};
+extern const struct madera_pin_chip cs47l15_pin_chip;
extern const struct madera_pin_chip cs47l35_pin_chip;
extern const struct madera_pin_chip cs47l85_pin_chip;
extern const struct madera_pin_chip cs47l90_pin_chip;
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L92
2019-07-22 9:10 [PATCH 1/3] pinctrl: madera: Use local copy of pdata Charles Keepax
2019-07-22 9:10 ` [PATCH 2/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L15 Charles Keepax
@ 2019-07-22 9:10 ` Charles Keepax
2019-08-05 9:48 ` Linus Walleij
2019-08-05 9:46 ` [PATCH 1/3] pinctrl: madera: Use local copy of pdata Linus Walleij
2 siblings, 1 reply; 6+ messages in thread
From: Charles Keepax @ 2019-07-22 9:10 UTC (permalink / raw)
To: linus.walleij; +Cc: linux-gpio, patches
This adds the pinctrl configuration for the CS47L92 codec to
the madera pinctrl driver.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
drivers/pinctrl/cirrus/Kconfig | 3 +++
drivers/pinctrl/cirrus/Makefile | 3 +++
drivers/pinctrl/cirrus/pinctrl-cs47l92.c | 40 ++++++++++++++++++++++++++++
drivers/pinctrl/cirrus/pinctrl-madera-core.c | 16 +++++++++++
drivers/pinctrl/cirrus/pinctrl-madera.h | 1 +
5 files changed, 63 insertions(+)
create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs47l92.c
diff --git a/drivers/pinctrl/cirrus/Kconfig b/drivers/pinctrl/cirrus/Kconfig
index ef01a0b062730..f1806fd781a05 100644
--- a/drivers/pinctrl/cirrus/Kconfig
+++ b/drivers/pinctrl/cirrus/Kconfig
@@ -26,3 +26,6 @@ config PINCTRL_CS47L85
config PINCTRL_CS47L90
bool
+
+config PINCTRL_CS47L92
+ bool
diff --git a/drivers/pinctrl/cirrus/Makefile b/drivers/pinctrl/cirrus/Makefile
index 491bcb658d8e1..a484518c840e3 100644
--- a/drivers/pinctrl/cirrus/Makefile
+++ b/drivers/pinctrl/cirrus/Makefile
@@ -15,5 +15,8 @@ endif
ifeq ($(CONFIG_PINCTRL_CS47L90),y)
pinctrl-madera-objs += pinctrl-cs47l90.o
endif
+ifeq ($(CONFIG_PINCTRL_CS47L92),y)
+pinctrl-madera-objs += pinctrl-cs47l92.o
+endif
obj-$(CONFIG_PINCTRL_MADERA) += pinctrl-madera.o
diff --git a/drivers/pinctrl/cirrus/pinctrl-cs47l92.c b/drivers/pinctrl/cirrus/pinctrl-cs47l92.c
new file mode 100644
index 0000000000000..4e409734334e9
--- /dev/null
+++ b/drivers/pinctrl/cirrus/pinctrl-cs47l92.c
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Pinctrl for Cirrus Logic CS47L92
+ *
+ * Copyright (C) 2018-2019 Cirrus Logic, Inc. and
+ * Cirrus Logic International Semiconductor Ltd.
+ */
+
+#include <linux/err.h>
+#include <linux/mfd/madera/core.h>
+
+#include "pinctrl-madera.h"
+
+/*
+ * The alt func groups are the most commonly used functions we place these at
+ * the lower function indexes for convenience, and the less commonly used gpio
+ * functions at higher indexes.
+ *
+ * To stay consistent with the datasheet the function names are the same as
+ * the group names for that function's pins
+ *
+ * Note - all 1 less than in datasheet because these are zero-indexed
+ */
+static const unsigned int cs47l92_spk1_pins[] = { 2, 3 };
+static const unsigned int cs47l92_aif1_pins[] = { 4, 5, 6, 7 };
+static const unsigned int cs47l92_aif2_pins[] = { 8, 9, 10, 11 };
+static const unsigned int cs47l92_aif3_pins[] = { 12, 13, 14, 15 };
+
+static const struct madera_pin_groups cs47l92_pin_groups[] = {
+ { "aif1", cs47l92_aif1_pins, ARRAY_SIZE(cs47l92_aif1_pins) },
+ { "aif2", cs47l92_aif2_pins, ARRAY_SIZE(cs47l92_aif2_pins) },
+ { "aif3", cs47l92_aif3_pins, ARRAY_SIZE(cs47l92_aif3_pins) },
+ { "pdmspk1", cs47l92_spk1_pins, ARRAY_SIZE(cs47l92_spk1_pins) },
+};
+
+const struct madera_pin_chip cs47l92_pin_chip = {
+ .n_pins = CS47L92_NUM_GPIOS,
+ .pin_groups = cs47l92_pin_groups,
+ .n_pin_groups = ARRAY_SIZE(cs47l92_pin_groups),
+};
diff --git a/drivers/pinctrl/cirrus/pinctrl-madera-core.c b/drivers/pinctrl/cirrus/pinctrl-madera-core.c
index 64281ad5c1b9e..e2f72dcce4c9c 100644
--- a/drivers/pinctrl/cirrus/pinctrl-madera-core.c
+++ b/drivers/pinctrl/cirrus/pinctrl-madera-core.c
@@ -396,6 +396,16 @@ static const struct {
.group_names = madera_pin_single_group_names,
.func = 0x157
},
+ {
+ .name = "aux-pdm-clk",
+ .group_names = madera_pin_single_group_names,
+ .func = 0x280
+ },
+ {
+ .name = "aux-pdm-dat",
+ .group_names = madera_pin_single_group_names,
+ .func = 0x281
+ },
};
static u16 madera_pin_make_drv_str(struct madera_pin_private *priv,
@@ -1022,6 +1032,12 @@ static int madera_pin_probe(struct platform_device *pdev)
if (IS_ENABLED(CONFIG_PINCTRL_CS47L90))
priv->chip = &cs47l90_pin_chip;
break;
+ case CS42L92:
+ case CS47L92:
+ case CS47L93:
+ if (IS_ENABLED(CONFIG_PINCTRL_CS47L92))
+ priv->chip = &cs47l92_pin_chip;
+ break;
default:
break;
}
diff --git a/drivers/pinctrl/cirrus/pinctrl-madera.h b/drivers/pinctrl/cirrus/pinctrl-madera.h
index a10f0238dd928..c16a4dc19a2a0 100644
--- a/drivers/pinctrl/cirrus/pinctrl-madera.h
+++ b/drivers/pinctrl/cirrus/pinctrl-madera.h
@@ -34,5 +34,6 @@ extern const struct madera_pin_chip cs47l15_pin_chip;
extern const struct madera_pin_chip cs47l35_pin_chip;
extern const struct madera_pin_chip cs47l85_pin_chip;
extern const struct madera_pin_chip cs47l90_pin_chip;
+extern const struct madera_pin_chip cs47l92_pin_chip;
#endif
--
2.11.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/3] pinctrl: madera: Use local copy of pdata
2019-07-22 9:10 [PATCH 1/3] pinctrl: madera: Use local copy of pdata Charles Keepax
2019-07-22 9:10 ` [PATCH 2/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L15 Charles Keepax
2019-07-22 9:10 ` [PATCH 3/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L92 Charles Keepax
@ 2019-08-05 9:46 ` Linus Walleij
2 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2019-08-05 9:46 UTC (permalink / raw)
To: Charles Keepax; +Cc: open list:GPIO SUBSYSTEM, patches
On Mon, Jul 22, 2019 at 11:10 AM Charles Keepax
<ckeepax@opensource.cirrus.com> wrote:
> A local copy of the pdata exists and it should be used rather than
> pulling a fresh copy.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L15
2019-07-22 9:10 ` [PATCH 2/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L15 Charles Keepax
@ 2019-08-05 9:47 ` Linus Walleij
0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2019-08-05 9:47 UTC (permalink / raw)
To: Charles Keepax; +Cc: open list:GPIO SUBSYSTEM, patches
On Mon, Jul 22, 2019 at 11:10 AM Charles Keepax
<ckeepax@opensource.cirrus.com> wrote:
> From: Richard Fitzgerald <rf@opensource.cirrus.com>
>
> This adds the pinctrl configuration for the CS47L15 codec to
> the madera pinctrl driver.
>
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L92
2019-07-22 9:10 ` [PATCH 3/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L92 Charles Keepax
@ 2019-08-05 9:48 ` Linus Walleij
0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2019-08-05 9:48 UTC (permalink / raw)
To: Charles Keepax; +Cc: open list:GPIO SUBSYSTEM, patches
On Mon, Jul 22, 2019 at 11:10 AM Charles Keepax
<ckeepax@opensource.cirrus.com> wrote:
> This adds the pinctrl configuration for the CS47L92 codec to
> the madera pinctrl driver.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-08-05 9:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22 9:10 [PATCH 1/3] pinctrl: madera: Use local copy of pdata Charles Keepax
2019-07-22 9:10 ` [PATCH 2/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L15 Charles Keepax
2019-08-05 9:47 ` Linus Walleij
2019-07-22 9:10 ` [PATCH 3/3] pinctrl: madera: Add configuration for Cirrus Logic CS47L92 Charles Keepax
2019-08-05 9:48 ` Linus Walleij
2019-08-05 9:46 ` [PATCH 1/3] pinctrl: madera: Use local copy of pdata Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).