* [PATCH v3] pinctrl: sh-pfc: r8a7791: Add ADI pinconf support
2016-11-29 9:11 [PATCH] " Jacopo Mondi
@ 2016-12-01 22:14 ` Jacopo Mondi
2016-12-09 9:03 ` Geert Uytterhoeven
0 siblings, 1 reply; 4+ messages in thread
From: Jacopo Mondi @ 2016-12-01 22:14 UTC (permalink / raw)
To: geert+renesas, magnus.damm, laurent.pinchart, linus.walleij
Cc: linux-renesas-soc, linux-gpio, linux-kernel, Jacopo Mondi
Add pin configuration support for Gyro-ADC, named ADI on r8a7791 SoC.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
Compiled only, not tested with an actual ADC.
For reference only, these are the changes introduced by Geert's private
review of first sketch of this patch:
* separate ADI chsel in 3 overlapping groups:
the user can now select how many pins to assign to channel selection
function.
v1 -> v2:
* let the user freely select the single CHS line to use.
This requires the configuration to match the ADI mode in use, but
allows users to select CHS1 or CHS2 lines alone, and dedicate other
pins to other functions.
v2 -> v3:
* Update commit message which I forgot to do in v2 :/
---
drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 86 ++++++++++++++++++++++++++++++++++++
1 file changed, 86 insertions(+)
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
index 7ca37c3..75c9882 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7791.c
@@ -1691,6 +1691,72 @@ static const struct sh_pfc_pin pinmux_pins[] = {
PINMUX_GPIO_GP_ALL(),
};
+/* - ADI -------------------------------------------------------------------- */
+static const unsigned int adi_common_pins[] = {
+ /* ADIDATA, ADICS/SAMP, ADICLK */
+ RCAR_GP_PIN(6, 24), RCAR_GP_PIN(6, 25), RCAR_GP_PIN(6, 26),
+};
+static const unsigned int adi_common_mux[] = {
+ /* ADIDATA, ADICS/SAMP, ADICLK */
+ ADIDATA_MARK, ADICS_SAMP_MARK, ADICLK_MARK,
+};
+static const unsigned int adi_chsel0_pins[] = {
+ /* ADICHS 0 */
+ RCAR_GP_PIN(6, 27),
+};
+static const unsigned int adi_chsel0_mux[] = {
+ /* ADICHS 0 */
+ ADICHS0_MARK,
+};
+static const unsigned int adi_chsel1_pins[] = {
+ /* ADICHS 1 */
+ RCAR_GP_PIN(6, 28),
+};
+static const unsigned int adi_chsel1_mux[] = {
+ /* ADICHS 1 */
+ ADICHS1_MARK,
+};
+static const unsigned int adi_chsel2_pins[] = {
+ /* ADICHS 2 */
+ RCAR_GP_PIN(6, 29),
+};
+static const unsigned int adi_chsel2_mux[] = {
+ /* ADICHS 2 */
+ ADICHS2_MARK,
+};
+static const unsigned int adi_common_b_pins[] = {
+ /* ADIDATA B, ADICS/SAMP B, ADICLK B */
+ RCAR_GP_PIN(5, 25), RCAR_GP_PIN(5, 26), RCAR_GP_PIN(5, 27),
+};
+static const unsigned int adi_common_b_mux[] = {
+ /* ADIDATA B, ADICS/SAMP B, ADICLK B */
+ ADIDATA_B_MARK, ADICS_SAMP_B_MARK, ADICLK_B_MARK,
+};
+static const unsigned int adi_chsel0_b_pins[] = {
+ /* ADICHS B 0 */
+ RCAR_GP_PIN(5, 28),
+};
+static const unsigned int adi_chsel0_b_mux[] = {
+ /* ADICHS B 0 */
+ ADICHS0_B_MARK,
+};
+static const unsigned int adi_chsel1_b_pins[] = {
+ /* ADICHS B 1 */
+ RCAR_GP_PIN(5, 29),
+};
+static const unsigned int adi_chsel1_b_mux[] = {
+ /* ADICHS B 1 */
+ ADICHS1_B_MARK,
+};
+static const unsigned int adi_chsel2_b_pins[] = {
+ /* ADICHS B 2 */
+ RCAR_GP_PIN(5, 30),
+};
+static const unsigned int adi_chsel2_b_mux[] = {
+ /* ADICHS B 2 */
+ ADICHS2_B_MARK,
+};
+
/* - Audio Clock ------------------------------------------------------------ */
static const unsigned int audio_clk_a_pins[] = {
/* CLK */
@@ -4343,6 +4409,14 @@ static const unsigned int vin2_clk_mux[] = {
};
static const struct sh_pfc_pin_group pinmux_groups[] = {
+ SH_PFC_PIN_GROUP(adi_common),
+ SH_PFC_PIN_GROUP(adi_chsel0),
+ SH_PFC_PIN_GROUP(adi_chsel1),
+ SH_PFC_PIN_GROUP(adi_chsel2),
+ SH_PFC_PIN_GROUP(adi_common_b),
+ SH_PFC_PIN_GROUP(adi_chsel0_b),
+ SH_PFC_PIN_GROUP(adi_chsel1_b),
+ SH_PFC_PIN_GROUP(adi_chsel2_b),
SH_PFC_PIN_GROUP(audio_clk_a),
SH_PFC_PIN_GROUP(audio_clk_b),
SH_PFC_PIN_GROUP(audio_clk_b_b),
@@ -4687,6 +4761,17 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
SH_PFC_PIN_GROUP(vin2_clk),
};
+static const char * const adi_groups[] = {
+ "adi_common",
+ "adi_chsel0",
+ "adi_chsel1",
+ "adi_chsel2",
+ "adi_common_b",
+ "adi_chsel0_b",
+ "adi_chsel1_b",
+ "adi_chsel2_b",
+};
+
static const char * const audio_clk_groups[] = {
"audio_clk_a",
"audio_clk_b",
@@ -5192,6 +5277,7 @@ static const char * const vin2_groups[] = {
};
static const struct sh_pfc_function pinmux_functions[] = {
+ SH_PFC_FUNCTION(adi),
SH_PFC_FUNCTION(audio_clk),
SH_PFC_FUNCTION(avb),
SH_PFC_FUNCTION(can0),
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v3] pinctrl: sh-pfc: r8a7791: Add ADI pinconf support
2016-12-01 22:14 ` [PATCH v3] " Jacopo Mondi
@ 2016-12-09 9:03 ` Geert Uytterhoeven
0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2016-12-09 9:03 UTC (permalink / raw)
To: Jacopo Mondi
Cc: Geert Uytterhoeven, Magnus Damm, Laurent Pinchart, Linus Walleij,
Linux-Renesas, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org
Hi Jacopo,
On Thu, Dec 1, 2016 at 11:14 PM, Jacopo Mondi <jacopo@jmondi.org> wrote:
> Add pin configuration support for Gyro-ADC, named ADI on r8a7791 SoC.
Thanks!
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
I'll wait with queuing it up for upstream until it's been tested, but in
the mean time, I'll add it to a topic branch in renesas-drivers.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] pinctrl: sh-pfc: r8a7791: Add ADI pinconf support
@ 2017-01-19 16:06 Marek Vasut
2017-01-19 17:10 ` jacopo mondi
0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2017-01-19 16:06 UTC (permalink / raw)
To: linux-gpio
Please add my
Tested-by: Marek Vasut <marek.vasut@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v3] pinctrl: sh-pfc: r8a7791: Add ADI pinconf support
2017-01-19 16:06 [PATCH v3] pinctrl: sh-pfc: r8a7791: Add ADI pinconf support Marek Vasut
@ 2017-01-19 17:10 ` jacopo mondi
0 siblings, 0 replies; 4+ messages in thread
From: jacopo mondi @ 2017-01-19 17:10 UTC (permalink / raw)
To: 1480630452-10958-1-git-send-email-jacopo, linux-gpio,
Linux-Renesas
Hi Marek,
On 19/01/2017 17:06, Marek Vasut wrote:
> Please add my
>
> Tested-by: Marek Vasut <marek.vasut@gmail.com>
Thanks!
Sending to renesas-soc list as well as, if I'm not wrong, PFC patches go
through Geert's tree
> --
> To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-01-19 17:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-19 16:06 [PATCH v3] pinctrl: sh-pfc: r8a7791: Add ADI pinconf support Marek Vasut
2017-01-19 17:10 ` jacopo mondi
-- strict thread matches above, loose matches on Subject: below --
2016-11-29 9:11 [PATCH] " Jacopo Mondi
2016-12-01 22:14 ` [PATCH v3] " Jacopo Mondi
2016-12-09 9:03 ` Geert Uytterhoeven
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).