From patchwork Fri Jul 25 01:11:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 4621101 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 69FF7C0514 for ; Fri, 25 Jul 2014 01:14:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8EFFB201F2 for ; Fri, 25 Jul 2014 01:14:54 +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 B4017201ED for ; Fri, 25 Jul 2014 01:14:53 +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 1XAU4P-0003KC-F4; Fri, 25 Jul 2014 01:13:13 +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 1XAU3f-0002S9-1B for linux-arm-kernel@lists.infradead.org; Fri, 25 Jul 2014 01:12:27 +0000 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N98006YKTZVB7C0@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 25 Jul 2014 10:11:55 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.115]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 16.4D.24374.BDEA1D35; Fri, 25 Jul 2014 10:11:55 +0900 (KST) X-AuditID: cbfee68d-b7fd46d000005f36-0c-53d1aedba4d0 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 9E.00.04943.BDEA1D35; Fri, 25 Jul 2014 10:11:55 +0900 (KST) Received: from localhost.localdomain ([10.252.81.186]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N9800C0OTZUFH50@mmp2.samsung.com>; Fri, 25 Jul 2014 10:11:55 +0900 (KST) From: Jaehoon Chung To: linux-mmc Subject: [PATCHv6 5/5] mmc: dw_mmc: replace "disable-wp" from slot's quirk to host's quirk Date: Fri, 25 Jul 2014 10:11:53 +0900 Message-id: <1406250713-22604-6-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1406250713-22604-1-git-send-email-jh80.chung@samsung.com> References: <1406250713-22604-1-git-send-email-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNIsWRmVeSWpSXmKPExsWyRsSkWPf2uovBBhO/qVpMuLyd0WL+kXOs FscvLWa2+P/oNavFjV9trBa9C66yWWx6fI3V4sj/fkaLGef3MVksvX6RyeLD/YvMFsfXhjvw eLTuncDmsWbeGkaPO9f2sHlsXlLvcePVQiaPvi2rGD22X5vH7PF5k1wARxSXTUpqTmZZapG+ XQJXxoT+2WwF1wUqFi/xaGB8w9vFyMkhIWAisXRtOyuELSZx4d56ti5GLg4hgaWMEmf2vGCB KZp64BULRGI6o8SX9k1QThuTxKHPa5lAqtgEdCS2fzsOZosIaEp0bl8JNopZ4AqTxNk7W8B2 CAvESKz89pYdxGYRUJVomLgaLM4r4Caxfs1NoKkcQOsUJOZMsgEJcwq4S8z5eJsVJCwEVHJ3 hgbISAmBc+wSJzb8YIQYIyDxbfIhqFZZiU0HmCGOlpQ4uOIGywRG4QWMDKsYRVMLkguKk9KL DPWKE3OLS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Y5NDYr+ffvaMY11nW6jOFM60OZVJAQ4HQr43Ws8IP6R1f0+V xp5DKk4ZR/l0tq835l64bkeCVGF5/N4jszb6mL6yDzbiLGmS/fDpcOY0NeFizT8p4nopIctr VvcpdnEkWLywKzwb49uzMOfVfCWW4oxEQy3mouJEAJTbOObdAgAA 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-20140724_181227_238292_B24216D7 X-CRM114-Status: GOOD ( 12.13 ) X-Spam-Score: -5.0 (-----) Cc: Mark Rutland , devicetree@vger.kernel.org, Ulf Hansson , kgene.kim@samsung.com, heiko@sntech.de, tgih.jun@samsung.com, Chris Ball , Jaehoon Chung , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 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=-1.9 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 | 12 +++++------- include/linux/mmc/dw_mmc.h | 6 ++---- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 1ac227c..4a4f66f 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -997,7 +997,7 @@ 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->host->quirks & DW_MCI_QUIRK_NO_WRITE_PROTECT) read_only = 0; else if (!IS_ERR_VALUE(gpio_ro)) read_only = gpio_ro; @@ -2006,12 +2006,7 @@ static struct device_node *dw_mci_of_find_slot_node(struct device *dev, u8 slot) static struct dw_mci_of_slot_quirks { char *quirk; int id; -} of_slot_quirks[] = { - { - .quirk = "disable-wp", - .id = DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT, - }, -}; +} of_slot_quirks[] = {}; static int dw_mci_of_get_slot_quirks(struct device *dev, u8 slot) { @@ -2238,6 +2233,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..8b4b2d8 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h @@ -213,10 +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) - -/* Slot level quirks */ -/* This slot has no write protect */ -#define DW_MCI_SLOT_QUIRK_NO_WRITE_PROTECT BIT(0) +/* No write protect */ +#define DW_MCI_QUIRK_NO_WRITE_PROTECT BIT(4) struct dma_pdata;