linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ARM: s3c24xx: Correct SD card write protect detection on Mini2440
@ 2018-09-06 20:35 Cedric Roux
  2018-09-07 12:37 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 2+ messages in thread
From: Cedric Roux @ 2018-09-06 20:35 UTC (permalink / raw)
  To: Kukjin Kim, Krzysztof Kozlowski, Russell King, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

The mini2440 computer uses "active high" to signal that the "write protect"
of the inserted MMC is set. The current code uses the opposite, leading to
a wrong detection of write protection. The solution is simply to use
".wprotect_invert = 1" in the description of the MMC.

Signed-off-by: Cedric Roux <sed@free.fr>
---
 arch/arm/mach-s3c24xx/mach-mini2440.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
index 95753e0..4cd8d45 100644
--- a/arch/arm/mach-s3c24xx/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
@@ -232,10 +232,11 @@ 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),
-   .set_power     = NULL,
-   .ocr_avail     = MMC_VDD_32_33|MMC_VDD_33_34,
+	.wprotect_invert = 1,
+	.gpio_detect   = S3C2410_GPG(8),
+	.gpio_wprotect = S3C2410_GPH(8),
+	.set_power     = NULL,
+	.ocr_avail     = MMC_VDD_32_33|MMC_VDD_33_34,
 };
 
 /* NAND Flash on MINI2440 board */
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] ARM: s3c24xx: Correct SD card write protect detection on Mini2440
  2018-09-06 20:35 [PATCH v2] ARM: s3c24xx: Correct SD card write protect detection on Mini2440 Cedric Roux
@ 2018-09-07 12:37 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2018-09-07 12:37 UTC (permalink / raw)
  To: sed; +Cc: kgene, linux, linux-arm-kernel, linux-samsung-soc, linux-kernel

On Thu, 6 Sep 2018 at 23:27, Cedric Roux <sed@free.fr> wrote:
>
> The mini2440 computer uses "active high" to signal that the "write protect"
> of the inserted MMC is set. The current code uses the opposite, leading to
> a wrong detection of write protection. The solution is simply to use
> ".wprotect_invert = 1" in the description of the MMC.
>
> Signed-off-by: Cedric Roux <sed@free.fr>
> ---
>  arch/arm/mach-s3c24xx/mach-mini2440.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
> index 95753e0..4cd8d45 100644
> --- a/arch/arm/mach-s3c24xx/mach-mini2440.c
> +++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
> @@ -232,10 +232,11 @@ 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),
> -   .set_power     = NULL,
> -   .ocr_avail     = MMC_VDD_32_33|MMC_VDD_33_34,
> +       .wprotect_invert = 1,
> +       .gpio_detect   = S3C2410_GPG(8),
> +       .gpio_wprotect = S3C2410_GPH(8),
> +       .set_power     = NULL,
> +       .ocr_avail     = MMC_VDD_32_33|MMC_VDD_33_34,

I see that entire struct has wrong indentation. In such case can you
send a separate patch cleaning it up, prior to introducing new
feature? First patch would be cleanup and second new feature.

While at cleanup you can also get rid of other checkpatch errors, like:
ERROR: Macros with complex values should be enclosed in parentheses
ERROR: space required after that ',' (ctx:VxV)
WARNING: please, no space before tabs
ERROR: trailing whitespace
WARNING: Avoid unnecessary line continuations
ERROR: "foo * bar" should be "foo *bar"
ERROR: space prohibited before that close parenthesis ')'
WARNING: quoted string split across lines
WARNING: printk() should include KERN_<LEVEL> facility level

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-07 12:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06 20:35 [PATCH v2] ARM: s3c24xx: Correct SD card write protect detection on Mini2440 Cedric Roux
2018-09-07 12:37 ` Krzysztof Kozlowski

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).