Re: [PATCH 07/10] mmc: s3cmci: Use the slot GPIO descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 12 Nov 2018 at 15:13, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
>
> Simplify things by making the S3CMCI driver just use
> slot GPIO with descriptors instead of passing around the global
> GPIO numbers that we want to get rid of.
>
> Getting the names of the GPIO chips into the machine
> descriptor tables was a bit of a challenge but I think
> I have them right.
>
> The platform data supports passing in inversion flags, but
> no platform is using them, and it is highly unlikely
> that we will add more, so drop them. The long term plan
> is to let the inversion flags on the GPIO machine
> descriptor do the job.
>
> Even if the slot GPIO core discards the inversion
> semantics on the GPIO lines we take special care to
> specify them right.
>
> Cc: Jaehoon Chung <jh80.chung@xxxxxxxxxxx>
> Cc: Sylwester Nawrocki <s.nawrocki@xxxxxxxxxxx>
> Cc: Krzysztof Kozlowski <k.kozlowski@xxxxxxxxxxx>

This address does not work since long time. mailmap should point you
to current one (krzk@xxxxxxxxxx)...

> Cc: Sergio Prado <sergio.prado@xxxxxxxxxxxxxx>
> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> ---
> Some testing of this would be greatly appreciated.

These are legacy platforms (although I heard that still used by some
users/companies) and I don't have the boards. I can just quickly look
at the code.

Does this patch depend on anything? What tree shall take it?

> ---
>  arch/arm/mach-s3c24xx/mach-at2440evb.c   | 14 +++++++++--
>  arch/arm/mach-s3c24xx/mach-h1940.c       | 15 +++++++++--
>  arch/arm/mach-s3c24xx/mach-mini2440.c    | 16 +++++++++---
>  arch/arm/mach-s3c24xx/mach-n30.c         | 15 +++++++++--
>  arch/arm/mach-s3c24xx/mach-rx1950.c      | 15 +++++++++--
>  drivers/mmc/host/s3cmci.c                | 32 ++++++++----------------
>  include/linux/platform_data/mmc-s3cmci.h |  4 ---
>  7 files changed, 75 insertions(+), 36 deletions(-)
>
> diff --git a/arch/arm/mach-s3c24xx/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c
> index 68a4fa94257a..2d370f7f75fa 100644
> --- a/arch/arm/mach-s3c24xx/mach-at2440evb.c
> +++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c
> @@ -9,7 +9,7 @@
>
>  #include <linux/kernel.h>
>  #include <linux/types.h>
> -#include <linux/gpio.h>
> +#include <linux/gpio/machine.h>
>  #include <linux/interrupt.h>
>  #include <linux/list.h>
>  #include <linux/timer.h>
> @@ -136,7 +136,16 @@ static struct platform_device at2440evb_device_eth = {
>  };
>
>  static struct s3c24xx_mci_pdata at2440evb_mci_pdata __initdata = {
> -       .gpio_detect    = S3C2410_GPG(10),
> +       /* Intentionally left blank */
> +};
> +
> +static struct gpiod_lookup_table at2440evb_mci_gpio_table = {
> +       .dev_id = "s3c2410-sdi",
> +       .table = {
> +               /* Card detect S3C2410_GPG(10) */
> +               GPIO_LOOKUP("GPIOG", 10, "cd", GPIO_ACTIVE_LOW),

I missed few changes around this... What is the "chip_label" here?
Name of bank? In general the bank names follow different name
convention:
https://elixir.bootlin.com/linux/latest/source/drivers/pinctrl/samsung/pinctrl-s3c24xx.c#L58
https://elixir.bootlin.com/linux/latest/source/drivers/pinctrl/samsung/pinctrl-s3c24xx.c#L563
so I think it should be "gpg".

> +               { },
> +       },
>  };
>
>  /* 7" LCD panel */
> @@ -200,6 +209,7 @@ static void __init at2440evb_init_time(void)
>  static void __init at2440evb_init(void)
>  {
>         s3c24xx_fb_set_platdata(&at2440evb_fb_info);
> +       gpiod_add_lookup_table(&at2440evb_mci_gpio_table);
>         s3c24xx_mci_set_platdata(&at2440evb_mci_pdata);
>         s3c_nand_set_platdata(&at2440evb_nand_info);
>         s3c_i2c0_set_platdata(NULL);
> diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
> index e064c73a57d3..8d9d8e7c71d4 100644
> --- a/arch/arm/mach-s3c24xx/mach-h1940.c
> +++ b/arch/arm/mach-s3c24xx/mach-h1940.c
> @@ -18,6 +18,7 @@
>  #include <linux/platform_device.h>
>  #include <linux/io.h>
>  #include <linux/gpio.h>
> +#include <linux/gpio/machine.h>
>  #include <linux/input.h>
>  #include <linux/gpio_keys.h>
>  #include <linux/pwm.h>
> @@ -459,12 +460,21 @@ static void h1940_set_mmc_power(unsigned char power_mode, unsigned short vdd)
>  }
>
>  static struct s3c24xx_mci_pdata h1940_mmc_cfg __initdata = {
> -       .gpio_detect   = S3C2410_GPF(5),
> -       .gpio_wprotect = S3C2410_GPH(8),
>         .set_power     = h1940_set_mmc_power,
>         .ocr_avail     = MMC_VDD_32_33,
>  };
>
> +static struct gpiod_lookup_table h1940_mmc_gpio_table = {
> +       .dev_id = "s3c2410-sdi",
> +       .table = {
> +               /* Card detect S3C2410_GPF(5) */
> +               GPIO_LOOKUP("GPIOF", 5, "cd", GPIO_ACTIVE_LOW),
> +               /* Write protect S3C2410_GPH(8) */
> +               GPIO_LOOKUP("GPIOH", 8, "wp", GPIO_ACTIVE_LOW),
> +               { },
> +       },
> +};
> +
>  static struct pwm_lookup h1940_pwm_lookup[] = {
>         PWM_LOOKUP("samsung-pwm", 0, "pwm-backlight", NULL, 36296,
>                    PWM_POLARITY_NORMAL),
> @@ -680,6 +690,7 @@ static void __init h1940_init(void)
>         u32 tmp;
>
>         s3c24xx_fb_set_platdata(&h1940_fb_info);
> +       gpiod_add_lookup_table(&h1940_mmc_gpio_table);
>         s3c24xx_mci_set_platdata(&h1940_mmc_cfg);
>         s3c24xx_udc_set_platdata(&h1940_udc_cfg);
>         s3c24xx_ts_set_platdata(&h1940_ts_cfg);
> diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
> index 50d67d760efd..8c5f222126d2 100644
> --- a/arch/arm/mach-s3c24xx/mach-mini2440.c
> +++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
> @@ -15,6 +15,7 @@
>  #include <linux/timer.h>
>  #include <linux/init.h>
>  #include <linux/gpio.h>
> +#include <linux/gpio/machine.h>
>  #include <linux/input.h>
>  #include <linux/io.h>
>  #include <linux/serial_core.h>
> @@ -234,13 +235,21 @@ static struct s3c2410fb_mach_info mini2440_fb_info __initdata = {
>  /* MMC/SD  */
>
>  static struct s3c24xx_mci_pdata mini2440_mmc_cfg __initdata = {
> -       .gpio_detect            = S3C2410_GPG(8),
> -       .gpio_wprotect          = S3C2410_GPH(8),
> -       .wprotect_invert        = 1,
>         .set_power              = NULL,
>         .ocr_avail              = MMC_VDD_32_33|MMC_VDD_33_34,
>  };
>
> +static struct gpiod_lookup_table mini2440_mmc_gpio_table = {
> +       .dev_id = "s3c2410-sdi",
> +       .table = {
> +               /* Card detect S3C2410_GPG(8) */
> +               GPIO_LOOKUP("GPIOG", 8, "cd", GPIO_ACTIVE_LOW),
> +               /* Write protect S3C2410_GPH(8) */
> +               GPIO_LOOKUP("GPIOH", 8, "wp", GPIO_ACTIVE_LOW),

What about the wprotect_invert? You mentioned that no platform is
using them but it was in mini2440_mmc_cfg.

Best regards,
Krzysztof



[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux