From patchwork Thu Aug 7 07:37:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 4689881 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 DF34F9F373 for ; Thu, 7 Aug 2014 07:38:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AF8E201D5 for ; Thu, 7 Aug 2014 07:38:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5DB6201CE for ; Thu, 7 Aug 2014 07:38:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754677AbaHGHiI (ORCPT ); Thu, 7 Aug 2014 03:38:08 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:27736 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754363AbaHGHiG (ORCPT ); Thu, 7 Aug 2014 03:38:06 -0400 Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9X001DVEJGYZ80@mailout1.samsung.com>; Thu, 07 Aug 2014 16:38:04 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.112]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 0C.8A.19786.BDC23E35; Thu, 07 Aug 2014 16:38:04 +0900 (KST) X-AuditID: cbfee68e-b7fab6d000004d4a-ac-53e32cdb79fb Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 20.12.04943.BDC23E35; Thu, 07 Aug 2014 16:38:03 +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 <0N9X00GKSEJFIBL0@mmp2.samsung.com>; Thu, 07 Aug 2014 16:38:03 +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, Jaehoon Chung Subject: [PATCHv10 1/5] mmc: dw_mmc: Slot quirk "disable-wp" is deprecated. Date: Thu, 07 Aug 2014 16:37:58 +0900 Message-id: <1407397082-32495-2-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1407397082-32495-1-git-send-email-jh80.chung@samsung.com> References: <1407397082-32495-1-git-send-email-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNIsWRmVeSWpSXmKPExsWyRsSkQPeOzuNgg8YoiwmXtzNazD9yjtXi +KXFzBb/H71mtbjxq43VonfBVTaLTY+vsVoc+d/PaDHj/D4mi6XXLzJZfLh/kdni+NpwBx6P 1r0T2DzWzFvD6HHn2h42j81L6j1uvFrI5NG3ZRWjx/Zr85g9Pm+SC+CI4rJJSc3JLEst0rdL 4MqYvHkZS0GfUMX09x1MDYwd/F2MHBwSAiYSy5cLdDFyApliEhfurWfrYuTiEBJYyiixoO8R I0TCRGLB4o3sEInpjBKLLh9lhnDamCRebX/HDlLFJqAjsf3bcSYQW0RAU6Jz+0qwUcwCV5gk zt7ZwgqSEBbwlrjxuoUZxGYRUJX40QbRzCvgJnH82C9WiJMUJOZMsgEJcwq4Syxa8QRsphBQ yf77bWBXSAhcYpd4cvMlG8QcAYlvkw+xQPTKSmw6wAxxtaTEwRU3WC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5OqQZGU/7fhvEZ /3PzFKS7Lz6498pC+Fho7JMEyWlLu37n737usmyxcOr1if2CfkZLTv1x2rc6bmOD1K7VXWZX O8+V/bt7YxvHvgqReea/D9ervgnw4jj2u4HnsMTJG8bHOOQf+RSxVeZ/Xaz2fusU0+tTrZK2 SPQXXO98vHOinKiqVYtHQ/PLVyKRSizFGYmGWsxFxYkAI65Kwt8CAAA= 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.6 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 Slot quirks "disable-wp" is deprecated. Instead, use the host quirk "disable-wp". (Because the slot-node is removed in dt-file.) Signed-off-by: Jaehoon Chung Tested-by: Sachin Kamat Acked-by: Seungwon Jeon Reviewed-by: Doug Anderson Tested-by: Doug Anderson --- drivers/mmc/host/dw_mmc.c | 11 +++++++++-- include/linux/mmc/dw_mmc.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 1ac227c..47b52cc 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -997,7 +997,8 @@ 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) || + (slot->host->quirks & DW_MCI_QUIRK_NO_WRITE_PROTECT)) read_only = 0; else if (!IS_ERR_VALUE(gpio_ro)) read_only = gpio_ro; @@ -2021,8 +2022,11 @@ static int dw_mci_of_get_slot_quirks(struct device *dev, u8 slot) /* get quirks */ for (idx = 0; idx < ARRAY_SIZE(of_slot_quirks); idx++) - if (of_get_property(np, of_slot_quirks[idx].quirk, NULL)) + if (of_get_property(np, of_slot_quirks[idx].quirk, NULL)) { + dev_warn(dev, "Slot quirk %s is deprecated\n", + of_slot_quirks[idx].quirk); quirks |= of_slot_quirks[idx].id; + } return quirks; } @@ -2238,6 +2242,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 */