From patchwork Wed Jul 30 11:05:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 4647041 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 61F3BC0338 for ; Wed, 30 Jul 2014 11:08:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94F8620145 for ; Wed, 30 Jul 2014 11:08:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7E1220122 for ; Wed, 30 Jul 2014 11:08:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XCRi4-000271-1N; Wed, 30 Jul 2014 11:06:16 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XCRhV-0001cN-1f for linux-arm-kernel@lists.infradead.org; Wed, 30 Jul 2014 11:05:41 +0000 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9I00H3PUSNIC60@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 30 Jul 2014 20:05:11 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.114]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 3B.ED.14752.761D8D35; Wed, 30 Jul 2014 20:05:11 +0900 (KST) X-AuditID: cbfee68f-b7fa26d0000039a0-92-53d8d1679deb Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 20.88.04943.761D8D35; Wed, 30 Jul 2014 20:05:11 +0900 (KST) Received: from localhost.localdomain ([10.252.81.186]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N9I00KXXUSMND20@mmp1.samsung.com>; Wed, 30 Jul 2014 20:05:11 +0900 (KST) From: Jaehoon Chung To: linux-mmc Subject: [PATCHv8 5/5] mmc: dw_mmc: replace "disable-wp" from slot's quirk to host's quirk Date: Wed, 30 Jul 2014 20:05:10 +0900 Message-id: <1406718310-32078-6-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1406718310-32078-1-git-send-email-jh80.chung@samsung.com> References: <1406718310-32078-1-git-send-email-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrGIsWRmVeSWpSXmKPExsWyRsSkSDf94o1gg3eL9CwmXN7OaPHykKbF /CPnWC0WbF/JZHH80mJmi/+PXrNa3PjVxmrRu+Aqm8Wmx9dYLY7872e0mHF+H5PF0usXmSw+ 3L/IbHF8bbgDn0fr3glsHmvmrWH0WLCp1OPOtT1sHpuX1HvceLWQyaNvyypGj+3X5jF7fN4k F8AZxWWTkpqTWZZapG+XwJWx5f81poINfBVnv8g3MP7l7mLk5JAQMJHY2fGXGcIWk7hwbz1b FyMHh5DAUkaJeVIgJkjJlI9iXYxcQNFFjBJ/571lhnDamCT+3j/KAtLLJqAjsf3bcSYQW0RA U6Jz+0o2kCJmgV5miec7HoAVCQvESOyatwZsGYuAqsSM3nuMIDavgJvEieVHWCC2KUjMmWQD EuYUcJfYePE8K4gtBFQys/EwC8hMCYGX7BLnv7WyQMwRkPg2+RBUr6zEpgNQv0hKHFxxg2UC o/ACRoZVjKKp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TEktTs1NSC 1CKYPiYOTqkGRrlM9oOmzzsr53Xkx/s9DrxadbNt7ttPp36GRnz4GBW0+mVmSMwKDs9b3svm ze/0uzW9b6LO1qtpxUu2sF5nuWL0JtFofrtEFEPDXgsnds1vbPey11ivnXoj/7D67eu7VzHf FU581msp9/PtpWnBnUxfbRVrVHY1SOq859+TXaJ4uOa/DdtdbyWW4oxEQy3mouJEALkyDzjq AgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140730_040541_255164_3944D33F X-CRM114-Status: GOOD ( 12.46 ) X-Spam-Score: -5.7 (-----) Cc: Mark Rutland , devicetree@vger.kernel.org, Ulf Hansson , kgene.kim@samsung.com, heiko@sntech.de, tgih.jun@samsung.com, Chris Ball , Doug Anderson , Jaehoon Chung , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, cpgs@samsung.com, dinguyen@altera.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replaced the "disable-wp" into host's quirks. (Because the slot-node is removed at dt-file.) Signed-off-by: Jaehoon Chung Tested-by: Sachin Kamat Acked-by: Seungwon Jeon --- drivers/mmc/host/dw_mmc.c | 8 +++++++- include/linux/mmc/dw_mmc.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 1ac227c..8d9edc6 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -997,7 +997,10 @@ static int dw_mci_get_ro(struct mmc_host *mmc) int gpio_ro = mmc_gpio_get_ro(mmc); /* Use platform get_ro function, else try on board write protect */ - if (slot->quirks & DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT) + if (slot->quirks & DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT) { + dev_warn(slot->host->dev, "Recommend not to use 'disable-wp'" + "into slot-node. Change your dt-file!!"); + } else if (slot->host->quirks & DW_MCI_QUIRK_NO_WRITE_PROTECT) read_only = 0; else if (!IS_ERR_VALUE(gpio_ro)) read_only = gpio_ro; @@ -2238,6 +2241,9 @@ static struct dw_mci_of_quirks { { .quirk = "broken-cd", .id = DW_MCI_QUIRK_BROKEN_CARD_DETECTION, + }, { + .quirk = "disable-wp", + .id = DW_MCI_QUIRK_NO_WRITE_PROTECT, }, }; diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index babaea9..29ce014 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h @@ -213,6 +213,8 @@ struct dw_mci_dma_ops { #define DW_MCI_QUIRK_HIGHSPEED BIT(2) /* Unreliable card detection */ #define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) +/* No write protect */ +#define DW_MCI_QUIRK_NO_WRITE_PROTECT BIT(4) /* Slot level quirks */ /* This slot has no write protect */