All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/8 V2] EXYNOS: PINMUX: Add pinmux support for I2C
Date: Mon, 11 Jun 2012 22:47:16 -0700	[thread overview]
Message-ID: <CAPnjgZ3xz8SBb1TQ5FewKE7VOQxPSuUm0AYrVO-H8qWMhze7ig@mail.gmail.com> (raw)
In-Reply-To: <1339049394-4816-4-git-send-email-rajeshwari.s@samsung.com>

On Wed, Jun 6, 2012 at 11:09 PM, Rajeshwari Shinde <rajeshwari.s@samsung.com
> wrote:

> This patch adds pinmux code for I2C.
>
> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
> Acked-by: Simon Glass <sjg@chromium.org>
> ---
> Changes in V2:
>        - Aligned the pinmux functionality as per the latest comments.
>

Acked-by: Simon Glass <sjg@chromium.org>


> This patch depends on the following patch:
> "[U-Boot] [PATCH 1/2 V6] EXYNOS5: PINMUX: Added default pinumx settings"
>  arch/arm/cpu/armv7/exynos/pinmux.c        |   52
> +++++++++++++++++++++++++++++
>  arch/arm/include/asm/arch-exynos/periph.h |    8 ++++
>  2 files changed, 60 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c
> b/arch/arm/cpu/armv7/exynos/pinmux.c
> index 597e487..d3314a1 100644
> --- a/arch/arm/cpu/armv7/exynos/pinmux.c
> +++ b/arch/arm/cpu/armv7/exynos/pinmux.c
> @@ -182,6 +182,48 @@ static void exynos5_sromc_config(int flags)
>        }
>  }
>
> +static void exynos5_i2c_config(int peripheral, int flags)
> +{
> +
> +       struct exynos5_gpio_part1 *gpio1 =
> +               (struct exynos5_gpio_part1 *)
> samsung_get_base_gpio_part1();
> +
> +       switch (peripheral) {
> +       case PERIPH_ID_I2C0:
> +               s5p_gpio_cfg_pin(&gpio1->b3, 0, GPIO_FUNC(0x2));
> +               s5p_gpio_cfg_pin(&gpio1->b3, 1, GPIO_FUNC(0x2));
> +               break;
> +       case PERIPH_ID_I2C1:
> +               s5p_gpio_cfg_pin(&gpio1->b3, 2, GPIO_FUNC(0x2));
> +               s5p_gpio_cfg_pin(&gpio1->b3, 3, GPIO_FUNC(0x2));
> +               break;
> +       case PERIPH_ID_I2C2:
> +               s5p_gpio_cfg_pin(&gpio1->a0, 6, GPIO_FUNC(0x3));
> +               s5p_gpio_cfg_pin(&gpio1->a0, 7, GPIO_FUNC(0x3));
> +               break;
> +       case PERIPH_ID_I2C3:
> +               s5p_gpio_cfg_pin(&gpio1->a1, 2, GPIO_FUNC(0x3));
> +               s5p_gpio_cfg_pin(&gpio1->a1, 3, GPIO_FUNC(0x3));
> +               break;
> +       case PERIPH_ID_I2C4:
> +               s5p_gpio_cfg_pin(&gpio1->a2, 0, GPIO_FUNC(0x3));
> +               s5p_gpio_cfg_pin(&gpio1->a2, 1, GPIO_FUNC(0x3));
> +               break;
> +       case PERIPH_ID_I2C5:
> +               s5p_gpio_cfg_pin(&gpio1->a2, 2, GPIO_FUNC(0x3));
> +               s5p_gpio_cfg_pin(&gpio1->a2, 3, GPIO_FUNC(0x3));
> +               break;
> +       case PERIPH_ID_I2C6:
> +               s5p_gpio_cfg_pin(&gpio1->b1, 3, GPIO_FUNC(0x4));
> +               s5p_gpio_cfg_pin(&gpio1->b1, 4, GPIO_FUNC(0x4));
> +               break;
> +       case PERIPH_ID_I2C7:
> +               s5p_gpio_cfg_pin(&gpio1->b2, 2, GPIO_FUNC(0x3));
> +               s5p_gpio_cfg_pin(&gpio1->b2, 3, GPIO_FUNC(0x3));
> +               break;
> +       }
> +}
> +
>  static int exynos5_pinmux_config(int peripheral, int flags)
>  {
>        switch (peripheral) {
> @@ -200,6 +242,16 @@ static int exynos5_pinmux_config(int peripheral, int
> flags)
>        case PERIPH_ID_SROMC:
>                exynos5_sromc_config(flags);
>                break;
> +       case PERIPH_ID_I2C0:
> +       case PERIPH_ID_I2C1:
> +       case PERIPH_ID_I2C2:
> +       case PERIPH_ID_I2C3:
> +       case PERIPH_ID_I2C4:
> +       case PERIPH_ID_I2C5:
> +       case PERIPH_ID_I2C6:
> +       case PERIPH_ID_I2C7:
> +               exynos5_i2c_config(peripheral, flags);
> +               break;
>        default:
>                debug("%s: invalid peripheral %d", __func__, peripheral);
>                return -1;
> diff --git a/arch/arm/include/asm/arch-exynos/periph.h
> b/arch/arm/include/asm/arch-exynos/periph.h
> index 5db25aa..b861d7d 100644
> --- a/arch/arm/include/asm/arch-exynos/periph.h
> +++ b/arch/arm/include/asm/arch-exynos/periph.h
> @@ -30,6 +30,14 @@
>  *
>  */
>  enum periph_id {
> +       PERIPH_ID_I2C0,
> +       PERIPH_ID_I2C1,
> +       PERIPH_ID_I2C2,
> +       PERIPH_ID_I2C3,
> +       PERIPH_ID_I2C4,
> +       PERIPH_ID_I2C5,
> +       PERIPH_ID_I2C6,
> +       PERIPH_ID_I2C7,
>        PERIPH_ID_SDMMC0,
>        PERIPH_ID_SDMMC1,
>        PERIPH_ID_SDMMC2,
> --
> 1.7.4.4
>
>

  reply	other threads:[~2012-06-12  5:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07  6:09 [U-Boot] [PATCH 0/8 V2] EXYNOS5: Enable I2C support Rajeshwari Shinde
2012-06-07  6:09 ` [U-Boot] [PATCH 1/8 V2] EXYNOS: CLK: Add i2c clock Rajeshwari Shinde
2012-06-12  5:46   ` Simon Glass
2012-06-07  6:09 ` [U-Boot] [PATCH 2/8 V2] EXYNOS: Add I2C base address Rajeshwari Shinde
2012-06-07  6:09 ` [U-Boot] [PATCH 3/8 V2] EXYNOS: PINMUX: Add pinmux support for I2C Rajeshwari Shinde
2012-06-12  5:47   ` Simon Glass [this message]
2012-06-07  6:09 ` [U-Boot] [PATCH 4/8 V2] I2C: Move struct s3c24x0_i2c to a common place Rajeshwari Shinde
2012-06-07  6:09 ` [U-Boot] [PATCH 5/8 V2] I2C: S3C24X0: Add offset to calculate next i2c channel base address Rajeshwari Shinde
2012-06-07  6:09 ` [U-Boot] [PATCH 6/8 V2] I2C: Modify the I2C driver for EXYNOS5 Rajeshwari Shinde
2012-06-12  5:52   ` Simon Glass
2012-06-15  7:10   ` Joonyoung Shim
2012-06-19  5:38     ` Rajeshwari Birje
2012-06-19  7:15       ` Joonyoung Shim
2012-06-19  7:28         ` Rajeshwari Birje
2012-06-07  6:09 ` [U-Boot] [PATCH 7/8 V2] I2C: Add support for Multi channel Rajeshwari Shinde
2012-06-15  7:15   ` Joonyoung Shim
2012-06-19  5:44     ` Rajeshwari Birje
2012-06-19  7:30       ` Joonyoung Shim
2012-06-07  6:09 ` [U-Boot] [PATCH 8/8 V2] CONFIG: SMDK5250: I2C: Enable I2C Rajeshwari Shinde

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=CAPnjgZ3xz8SBb1TQ5FewKE7VOQxPSuUm0AYrVO-H8qWMhze7ig@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.