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: 4646921 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 3CD779F36A for ; Wed, 30 Jul 2014 11:05:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 334DD20122 for ; Wed, 30 Jul 2014 11:05:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1116420145 for ; Wed, 30 Jul 2014 11:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752313AbaG3LFZ (ORCPT ); Wed, 30 Jul 2014 07:05:25 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:16217 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752611AbaG3LFT (ORCPT ); Wed, 30 Jul 2014 07:05:19 -0400 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>; 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 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, Doug Anderson , cpgs@samsung.com, Jaehoon Chung 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/EwC8hMCYGX7BLnv7WyQMw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jJLiSbnA5NIXkm8obGJmZGlkbmhhZGxuZI474FW60AhgfTEktTs1NSC 1CKYPiYOTqkGRrlM9oOmzzsr53Xkx/s9DrxadbNt7ttPp36GRnz4GBW0+mVmSMwKDs9b3svm ze/0uzW9b6LO1qtpxUu2sF5nuWL0JtFofrtEFEPDXgsnds1vbPey11ivnXoj/7D67eu7VzHf FU581msp9/PtpWnBnUxfbRVrVHY1SOq859+TXaJ4uOa/DdtdbyWW4oxEQy3mouJEALkyDzjq AgAA 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 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 */