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: 4631941 Return-Path: X-Original-To: patchwork-linux-mmc@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 F25A39F3B4 for ; Mon, 28 Jul 2014 02:30:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 25DC520125 for ; Mon, 28 Jul 2014 02:30:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 36A4B2011E for ; Mon, 28 Jul 2014 02:29:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752723AbaG1C3z (ORCPT ); Sun, 27 Jul 2014 22:29:55 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:16311 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752734AbaG1C3t (ORCPT ); Sun, 27 Jul 2014 22:29:49 -0400 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>; Mon, 28 Jul 2014 11:29:42 +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 Cc: Chris Ball , Ulf Hansson , tgih.jun@samsung.com, devicetree@vger.kernel.org, heiko@sntech.de, dinguyen@altera.com, Mark Rutland , kgene.kim@samsung.com, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, afaerber@suse.de, Jaehoon Chung 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 WHZoASNIWAio5P5tN4h77rFLfJ3PBzFFQOLb5ENQnbISmw4wQ5RISh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qYODil Ghijmw5JTGXkvzU99URK8tOOreculrat+N2ibZ8vVGHNztDh2HrR8dLBY4+dm3JuZ8wpK65Z xMd6erWSyzUVRT1+YYdpPPauXb16QdUztALWLhG/vLdIT2Kp18tz12ZXXeBcdq0ofMKNOCap 2jv+NYuSOI91/f93KNpzhdUDp7cb7U5M+bfh21wlluKMREMt5qLiRACl8gsI5AIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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;