From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: linux-kernel@vger.kernel.org, Magnus Damm <magnus.damm@gmail.com>,
linux-sh@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>,
Simon Horman <horms@verge.net.au>,
Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Subject: Re: [PATCH v2 1/5] pinctrl: sh-pfc: r8a7790: add pin definitions for the I2C3 interface
Date: Fri, 27 Sep 2013 00:09:38 +0000 [thread overview]
Message-ID: <9143344.9DYEcn8tXu@avalon> (raw)
In-Reply-To: <1380216060-14506-2-git-send-email-g.liakhovetski@gmx.de>
Hi Guennadi,
Thank you for the patch.
On Thursday 26 September 2013 19:20:56 Guennadi Liakhovetski wrote:
> There are four I2C interfaces on r8a7790, each of them can be connected to
> one of the two respective I2C controllers, e.g. interface #0 can be
> configured to work with I2C0 or with IIC0. Additionally some of those
> interfaces can also use one of several pin sets. Interface #3 is special,
> because it can be used in automatic mode for DVFS. It only has one set
> of pins available and those pins cannot be used for anything else, they
> also lack the GPIO function.
>
> This patch uses the sh-pfc ability to configure pins, not associated with
> GPIOs and adds support for I2C3 to the r8a7790 PFC set up.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
I've taken the patch in my tree and sent an update to my previous pull request
for the pinctrl tree.
> ---
>
> v2: s/16/31/ in pin number calculation, thanks to Laurent for pointing out.
>
> drivers/pinctrl/sh-pfc/pfc-r8a7790.c | 28 ++++++++++++++++++++++++++++
> 1 files changed, 28 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
> b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c index 5c2657b..72786fc 100644
> --- a/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
> +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7790.c
> @@ -781,6 +781,8 @@ enum {
> ADICS_SAMP_MARK, DU2_CDE_MARK, QPOLB_MARK, SCIFA2_RXD_B_MARK,
> USB1_PWEN_MARK, AUDIO_CLKOUT_D_MARK, USB1_OVC_MARK,
> TCLK1_B_MARK,
> +
> + I2C3_SCL_MARK, I2C3_SDA_MARK,
> PINMUX_MARK_END,
> };
>
> @@ -1719,10 +1721,22 @@ static const u16 pinmux_data[] = {
> PINMUX_IPSR_DATA(IP16_6, AUDIO_CLKOUT_D),
> PINMUX_IPSR_DATA(IP16_7, USB1_OVC),
> PINMUX_IPSR_MODSEL_DATA(IP16_7, TCLK1_B, SEL_TMU1_1),
> +
> + PINMUX_DATA(I2C3_SCL_MARK, FN_SEL_IICDVFS_1),
> + PINMUX_DATA(I2C3_SDA_MARK, FN_SEL_IICDVFS_1),
> };
>
> +/* R8A7790 has 6 banks with 32 GPIOs in each = 192 GPIOs */
> +#define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r))
> +#define PIN_NUMBER(r, c) (((r) - 'A') * 31 + (c) + 200)
> +#define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c)
> +
> static struct sh_pfc_pin pinmux_pins[] = {
> PINMUX_GPIO_GP_ALL(),
> +
> + /* Pins not associated with a GPIO port */
> + SH_PFC_PIN_NAMED(ROW_GROUP_A('J'), 15, AJ15),
> + SH_PFC_PIN_NAMED(ROW_GROUP_A('H'), 15, AH15),
> };
>
> /* - DU RGB
> ----------------------------------------------------------------- */ @@
> -2048,6 +2062,14 @@ static const unsigned int i2c2_e_pins[] = { static
> const unsigned int i2c2_e_mux[] = {
> I2C2_SCL_E_MARK, I2C2_SDA_E_MARK,
> };
> +/* - I2C3
> ------------------------------------------------------------------- */
> +static const unsigned int i2c3_pins[] = {
> + /* SCL, SDA */
> + PIN_A_NUMBER('J', 15), PIN_A_NUMBER('H', 15),
> +};
> +static const unsigned int i2c3_mux[] = {
> + I2C3_SCL_MARK, I2C3_SDA_MARK,
> +};
> /* - INTC
> ------------------------------------------------------------------- */
> static const unsigned int intc_irq0_pins[] = {
> /* IRQ */
> @@ -3113,6 +3135,7 @@ static const struct sh_pfc_pin_group pinmux_groups[] > { SH_PFC_PIN_GROUP(i2c2_c),
> SH_PFC_PIN_GROUP(i2c2_d),
> SH_PFC_PIN_GROUP(i2c2_e),
> + SH_PFC_PIN_GROUP(i2c3),
> SH_PFC_PIN_GROUP(intc_irq0),
> SH_PFC_PIN_GROUP(intc_irq1),
> SH_PFC_PIN_GROUP(intc_irq2),
> @@ -3323,6 +3346,10 @@ static const char * const i2c2_groups[] = {
> "i2c2_e",
> };
>
> +static const char * const i2c3_groups[] = {
> + "i2c3",
> +};
> +
> static const char * const intc_groups[] = {
> "intc_irq0",
> "intc_irq1",
> @@ -3551,6 +3578,7 @@ static const struct sh_pfc_function pinmux_functions[]
> = { SH_PFC_FUNCTION(hscif1),
> SH_PFC_FUNCTION(i2c1),
> SH_PFC_FUNCTION(i2c2),
> + SH_PFC_FUNCTION(i2c3),
> SH_PFC_FUNCTION(intc),
> SH_PFC_FUNCTION(mmc0),
> SH_PFC_FUNCTION(mmc1),
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-09-27 0:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-26 17:20 [PATCH v2 0/5] ARM: shmobile: CPUFreq support on Lager Guennadi Liakhovetski
2013-09-26 17:20 ` [PATCH v2 1/5] pinctrl: sh-pfc: r8a7790: add pin definitions for the I2C3 interface Guennadi Liakhovetski
2013-09-27 0:09 ` Laurent Pinchart [this message]
2013-09-26 17:20 ` [PATCH v2 2/5] ARM: shmobile: r8a7790: add I2C clocks and aliases for the DT mode Guennadi Liakhovetski
2013-09-27 4:49 ` Simon Horman
2013-09-26 17:20 ` [PATCH v2 3/5] ARM: shmobile: r8a7790: add I2C DT nodes Guennadi Liakhovetski
2013-09-27 4:48 ` Simon Horman
2013-09-26 17:20 ` [PATCH v2 4/5] ARM: shmobile: r8a7790: add CPUFreq clock support Guennadi Liakhovetski
2013-09-26 17:21 ` [PATCH v2 5/5] ARM: shmobile: lager: (DEVEL) add CPUFreq support Guennadi Liakhovetski
2013-09-26 18:23 ` Sergei Shtylyov
2013-09-27 8:37 ` Guennadi Liakhovetski
2013-09-26 23:59 ` Laurent Pinchart
2013-09-27 6:32 ` Guennadi Liakhovetski
2013-09-30 15:25 ` [PATCH v2 0/5] ARM: shmobile: CPUFreq support on Lager Guennadi Liakhovetski
2013-09-30 23:53 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9143344.9DYEcn8tXu@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=g.liakhovetski+renesas@gmail.com \
--cc=g.liakhovetski@gmx.de \
--cc=horms@verge.net.au \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox