From patchwork Mon Jul 28 02:29:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 4631971 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 93E4F9F3B4 for ; Mon, 28 Jul 2014 02:32:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB3F920120 for ; Mon, 28 Jul 2014 02:32:25 +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 EB78820127 for ; Mon, 28 Jul 2014 02:32:24 +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 1XBaiD-0003vV-NE; Mon, 28 Jul 2014 02:30:53 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XBahT-0002Pa-WA for linux-arm-kernel@lists.infradead.org; Mon, 28 Jul 2014 02:30:08 +0000 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9E007LQHLHRG40@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 28 Jul 2014 11:29:41 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 2D.9F.14752.595B5D35; Mon, 28 Jul 2014 11:29:41 +0900 (KST) X-AuditID: cbfee68f-b7fa26d0000039a0-cf-53d5b595530d Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 7C.9D.05196.595B5D35; Mon, 28 Jul 2014 11:29:41 +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 <0N9E00LI2HLGTD40@mmp2.samsung.com>; Mon, 28 Jul 2014 11:29:41 +0900 (KST) From: Jaehoon Chung To: linux-mmc Subject: [PATCHv7 5/5] mmc: dw_mmc: replace "disable-wp" from slot's quirk to host's quirk Date: Mon, 28 Jul 2014 11:29:39 +0900 Message-id: <1406514579-3769-6-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1406514579-3769-1-git-send-email-jh80.chung@samsung.com> References: <1406514579-3769-1-git-send-email-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrIIsWRmVeSWpSXmKPExsWyRsSkRHfq1qvBBp/3a1g0byq2mHB5O6PF /CPnWC2OX1rMbPH/0WtWixu/2lgtehdcZbPY9Pgaq8WR//2MFjPO72OyWHr9IpPFh/sXmS2O rw134PVo3TuBzWPNvDWMHneu7WHz2Lyk3uPGq4VMHn1bVjF6bL82j9lj8+lqj8+b5AI4o7hs UlJzMstSi/TtErgyJvTPZiu4LlCxeIlHA+Mb3i5GTg4JAROJibtPs0DYYhIX7q1n62Lk4hAS WMoo8W7zNRaYoqUTNzNCJKYzSnxrOckO4bQxSdw/388EUsUmoCOx/dtxMFtEQFOic/tKsFHM Ai+YJH6umQ/UwcEhLBAjcelkAUgNi4CqxOP159hAbF4BV4m/d8+xgJRICChIzJlkAxLmFHCT WHZoASNIWAio5P5tN4h77rFLfJ3PBzFFQOLb5ENQnbISmw4wQ5RIShxccYNlAqPwAkaGVYyi qQXJBcVJ6UXGes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N2ibZ8vVGHNztDh2HrR8dLBY4+dm3JuZ8wpK65Z xMd6erWSyzUVRT1+YYdpPPauXb16QdUztALWLhG/vLdIT2Kp18tz12ZXXeBcdq0ofMKNOCap 2jv+NYuSOI91/f93KNpzhdUDp7cb7U5M+bfh21wlluKMREMt5qLiRACl8gsI5AIAAA== 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-20140727_193008_195538_70BB0580 X-CRM114-Status: GOOD ( 11.85 ) 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 , Jaehoon Chung , linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, afaerber@suse.de, 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.5 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;