From patchwork Wed May 19 18:36:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 101016 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4JIYHDD009191 for ; Wed, 19 May 2010 18:35:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752075Ab0ESSfq (ORCPT ); Wed, 19 May 2010 14:35:46 -0400 Received: from mail.gmx.net ([213.165.64.20]:36222 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752044Ab0ESSfp (ORCPT ); Wed, 19 May 2010 14:35:45 -0400 Received: (qmail invoked by alias); 19 May 2010 18:35:42 -0000 Received: from p57BD1EDF.dip0.t-ipconnect.de (EHLO axis700.grange) [87.189.30.223] by mail.gmx.net (mp061) with SMTP; 19 May 2010 20:35:42 +0200 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX18QRkVu9UMQ3gn/LeIcz9BsD1VCjhuIAnTOU1nJy0 kXkscjtBION2De Received: from lyakh (helo=localhost) by axis700.grange with local-esmtp (Exim 4.63) (envelope-from ) id 1OEo7f-0002KV-0e; Wed, 19 May 2010 20:36:03 +0200 Date: Wed, 19 May 2010 20:36:02 +0200 (CEST) From: Guennadi Liakhovetski To: "linux-sh@vger.kernel.org" cc: Ian Molton , Samuel Ortiz , linux-mmc@vger.kernel.org, Andrew Morton Subject: [PATCH 1/3] tmio: add a platform flag to disable card write-protection detection In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Y-GMX-Trusted: 0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 19 May 2010 18:35:46 +0000 (UTC) diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 7e79ba4..11c19b0 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c @@ -640,8 +640,11 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) static int tmio_mmc_get_ro(struct mmc_host *mmc) { struct tmio_mmc_host *host = mmc_priv(mmc); + struct mfd_cell *cell = host->pdev->dev.platform_data; + struct tmio_mmc_data *pdata = cell->driver_data; - return (sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT) ? 0 : 1; + return ((pdata->flags & TMIO_MMC_WRPROTECT_DISABLE) || + (sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT)) ? 0 : 1; } static const struct mmc_host_ops tmio_mmc_ops = { diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 360fc95..feeed0b 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h @@ -50,6 +50,9 @@ tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \ } while (0) +/* tmio MMC platform flags */ +#define TMIO_MMC_WRPROTECT_DISABLE (1 << 0) + int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); @@ -66,6 +69,7 @@ struct tmio_mmc_dma { struct tmio_mmc_data { unsigned int hclk; unsigned long capabilities; + unsigned long flags; struct tmio_mmc_dma *dma; void (*set_pwr)(struct platform_device *host, int state); void (*set_clk_div)(struct platform_device *host, int state);