From patchwork Thu Jul 31 05:35:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 4653371 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 BA70C9F2B8 for ; Thu, 31 Jul 2014 05:35:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1CBC20158 for ; Thu, 31 Jul 2014 05:35:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 087A2201BB for ; Thu, 31 Jul 2014 05:35:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751962AbaGaFfN (ORCPT ); Thu, 31 Jul 2014 01:35:13 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:12270 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbaGaFfL (ORCPT ); Thu, 31 Jul 2014 01:35:11 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N9K00HUMA6LQ480@mailout3.samsung.com>; Thu, 31 Jul 2014 14:35:09 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id C1.4C.15745.D85D9D35; Thu, 31 Jul 2014 14:35:09 +0900 (KST) X-AuditID: cbfee691-b7f306d000003d81-0a-53d9d58dbe5a Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 15.8D.05196.C85D9D35; Thu, 31 Jul 2014 14:35:08 +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 <0N9K000QWA6KS901@mmp1.samsung.com>; Thu, 31 Jul 2014 14:35:08 +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 , =?UTF-8?q?Andreas=20F=E4rber?= , cpgs , Jaehoon Chung Subject: [PATCHv9 1/5] mmc: dw_mmc: Slot quirk "disable-wp" is deprecated. Date: Thu, 31 Jul 2014 14:35:03 +0900 Message-id: <1406784907-26349-2-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1406784907-26349-1-git-send-email-jh80.chung@samsung.com> References: <1406784907-26349-1-git-send-email-jh80.chung@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsWyRsSkRLf36s1gg6srOSyaNxVbTLi8ndHi 5SFNi/lHzrFaLNi+ksni+KXFzBb/H71mtbjxq43VonfBVTaLTY+vsVoc+d/PaDHj/D4mi6XX LzJZfLh/kdni+NpwB36P1r0T2DzWzFvD6LFgU6nHnWt72Dw2L6n3uPFqIZNH35ZVjB7br81j 9th8utrj8ya5AK4oLpuU1JzMstQifbsErozVq66zF6wQrHj9YBNTA+Mavi5GTg4JAROJCQef skDYYhIX7q1n62Lk4hASWMoo8f/pB0aYoiOTzzNBJBYxShzomwjltDFJvFp9mAmkik1AR2L7 t+NgtoiApkTn9pVgo5gFTjJL3P/RygaSEBbwkli9rQ3MZhFQldg75yQziM0r4CYxYdNp9i5G DqB1ChJzJtmAhDkF3CXerO0Bu0IIqOR3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DQntfgQoynQUROZpUST84GJJa8k3tDYxMzI0sjc0MLI2FxJnPdgq3WgkEB6 YklqdmpqQWoRTB8TB6dUA6P6XumNOrKeObX/RJnUw5U7lBJ0vGVnFGqdOrywSjt78q/K2pU6 N8+crj2/qWJuljBr4huJMuGdF38ULA7htJ1r2/Jw2uH9ORpS2dnOH3eFy8ZPmT9TPHzqM9Ha FX0LV/B8fpy7mj9Sb0bGvtthatYthukvwjUisrSz31VLr56pN++gl43OciWW4oxEQy3mouJE AK6vFub0AgAA 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 */