mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Purdie <rpurdie@rpsys.net>
To: Andrew Morton <akpm@osdl.org>
Cc: Russell King <linux@arm.linux.org.uk>,
	LKML <linux-kernel@vger.kernel.org>, Nicolas Pitre <nico@cam.org>
Subject: [patch] Add write protection switch handling to the PXA MMC driver
Date: Fri, 05 Aug 2005 00:52:08 +0100	[thread overview]
Message-ID: <1123199529.8987.94.camel@localhost.localdomain> (raw)

Add a write protection switch handling code to the PXA MMC driver so
that platform specific code can provide it if available (extending the
MMC/SD patches in -mm).

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>

Index: linux-2.6.12/include/asm-arm/arch-pxa/mmc.h
===================================================================
--- linux-2.6.12.orig/include/asm-arm/arch-pxa/mmc.h	2005-08-05 00:29:17.000000000 +0100
+++ linux-2.6.12/include/asm-arm/arch-pxa/mmc.h	2005-08-05 00:29:43.000000000 +0100
@@ -10,6 +10,7 @@
 struct pxamci_platform_data {
 	unsigned int ocr_mask;			/* available voltages */
 	int (*init)(struct device *, irqreturn_t (*)(int, void *, struct pt_regs *), void *);
+	int (*get_ro)(struct device *);
 	void (*setpower)(struct device *, unsigned int);
 	void (*exit)(struct device *, void *);
 };
Index: linux-2.6.12/drivers/mmc/pxamci.c
===================================================================
--- linux-2.6.12.orig/drivers/mmc/pxamci.c	2005-08-05 00:29:17.000000000 +0100
+++ linux-2.6.12/drivers/mmc/pxamci.c	2005-08-05 00:29:43.000000000 +0100
@@ -362,6 +362,16 @@
 	pxamci_start_cmd(host, mrq->cmd, cmdat);
 }
 
+static int pxamci_get_ro(struct mmc_host *mmc)
+{
+	struct pxamci_host *host = mmc_priv(mmc);
+
+	if (host->pdata && host->pdata->get_ro)
+		return host->pdata->get_ro(mmc->dev);
+	/* Host doesn't support read only detection so assume writeable */
+	return 0;
+}
+
 static void pxamci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 {
 	struct pxamci_host *host = mmc_priv(mmc);
@@ -401,6 +411,7 @@
 
 static struct mmc_host_ops pxamci_ops = {
 	.request	= pxamci_request,
+	.get_ro		= pxamci_get_ro,
 	.set_ios	= pxamci_set_ios,
 };


                 reply	other threads:[~2005-08-04 23:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1123199529.8987.94.camel@localhost.localdomain \
    --to=rpurdie@rpsys.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=nico@cam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome