From patchwork Mon Apr 8 21:28:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 2411761 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 5AFF340060 for ; Mon, 8 Apr 2013 21:28:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965144Ab3DHV2m (ORCPT ); Mon, 8 Apr 2013 17:28:42 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:54145 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965124Ab3DHV2l (ORCPT ); Mon, 8 Apr 2013 17:28:41 -0400 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3Zl4WC6WKDz4KK8b; Mon, 8 Apr 2013 23:28:39 +0200 (CEST) X-Auth-Info: SKfJghZAEqTa1dK5WFB6B5dszM2ginxk5zQv4cfiBPQ= Received: from localhost (p4FC46857.dip.t-dialin.net [79.196.104.87]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id 3Zl4WC5DkYzbbmQ; Mon, 8 Apr 2013 23:28:39 +0200 (CEST) From: Anatolij Gustschin To: linux-mmc@vger.kernel.org, Chris Ball Cc: devicetree-discuss@lists.ozlabs.org, Sascha Hauer , Markus Pargmann , Anatolij Gustschin Subject: [PATCH v3 3/5] mmc: mxcmmc: use slot-gpio API for write-protect detection Date: Mon, 8 Apr 2013 23:28:07 +0200 Message-Id: <1365456489-13152-4-git-send-email-agust@denx.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1365456489-13152-1-git-send-email-agust@denx.de> References: <1365456489-13152-1-git-send-email-agust@denx.de> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org slot-gpio API suppors read-only detection when "wp-gpios" property is present in the device tree mmc node. Use this API for write-protect detection. Signed-off-by: Anatolij Gustschin Acked-by: Sascha Hauer --- v3: - add Acked-by line v2: - no changes drivers/mmc/host/mxcmmc.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index 9845b2d..eb45bf0 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -917,10 +918,11 @@ static int mxcmci_get_ro(struct mmc_host *mmc) if (host->pdata && host->pdata->get_ro) return !!host->pdata->get_ro(mmc_dev(mmc)); /* - * Board doesn't support read only detection; let the mmc core - * decide what to do. + * If board doesn't support read only detection (no mmc_gpio + * context or gpio is invalid), then let the mmc core decide + * what to do. */ - return -ENOSYS; + return mmc_gpio_get_ro(mmc); } static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable)