From patchwork Tue Sep 4 20:36:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cedric Roux X-Patchwork-Id: 10587863 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 64FEF5A4 for ; Tue, 4 Sep 2018 20:34:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 524EE288A9 for ; Tue, 4 Sep 2018 20:34:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4648A29F76; Tue, 4 Sep 2018 20:34:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF750288A9 for ; Tue, 4 Sep 2018 20:34:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726284AbeIEBBQ (ORCPT ); Tue, 4 Sep 2018 21:01:16 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:64479 "EHLO smtp2-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726090AbeIEBBP (ORCPT ); Tue, 4 Sep 2018 21:01:15 -0400 Received: from [IPv6:2a01:cb1d:1a3:2a00:dacb:8aff:fef1:ed46] (unknown [IPv6:2a01:cb1d:1a3:2a00:dacb:8aff:fef1:ed46]) (Authenticated sender: sed) by smtp2-g21.free.fr (Postfix) with ESMTPSA id 99E5D2003D9; Tue, 4 Sep 2018 22:34:20 +0200 (CEST) To: Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org From: Cedric Roux Subject: [PATCH] mini2440 MMC correct write protect detection Message-ID: <85dac0df-2b75-9cc4-fde1-f62136974a1e@free.fr> Date: Tue, 4 Sep 2018 22:36:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Language: en-US Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP mini2440 MMC correct write protect detection 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 --- arch/arm/mach-s3c24xx/mach-mini2440.c.orig 2018-09-04 22:15:20.696087528 +0200 +++ arch/arm/mach-s3c24xx/mach-mini2440.c 2018-09-04 22:15:32.708088023 +0200 @@ -232,6 +232,7 @@ static struct s3c2410fb_mach_info mini24 /* MMC/SD */ static struct s3c24xx_mci_pdata mini2440_mmc_cfg __initdata = { + .wprotect_invert = 1, .gpio_detect = S3C2410_GPG(8), .gpio_wprotect = S3C2410_GPH(8), .set_power = NULL,