All of lore.kernel.org
 help / color / mirror / Atom feed
From: philippe.langlais@stericsson.com (Philippe Langlais)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] amba: add name based matching
Date: Tue, 15 Mar 2011 15:41:53 +0100	[thread overview]
Message-ID: <1300200116-12185-2-git-send-email-philippe.langlais@stericsson.com> (raw)
In-Reply-To: <1300200116-12185-1-git-send-email-philippe.langlais@stericsson.com>

From: Rabin Vincent <rabin.vincent@stericsson.com>

Some peripherals on the DBx500 family of SoCs have changes in their
functionality and registers between different variants in the family but
retain the same AMBA peripheral ID, making it impossible to distinguish
between them in AMBA drivers with the current AMBA id_table.

To support this, add a name parameter to the amba_device and the amba_id
and allow name based matching as a second level filter after the
periphid match.

Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
---
 drivers/amba/bus.c       |    6 ++++++
 include/linux/amba/bus.h |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index 6d2bb25..7f1590f 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -29,6 +29,12 @@ amba_lookup(const struct amba_id *table, struct amba_device *dev)
 
 	while (table->mask) {
 		ret = (dev->periphid & table->mask) == table->id;
+		if (ret && (table->name || dev->name)) {
+			if (table->name && dev->name)
+				ret = strcmp(dev->name, table->name) == 0;
+			else
+				ret = 0;
+		}
 		if (ret)
 			break;
 		table++;
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index fcbbe71..f5f82b2 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -32,12 +32,14 @@ struct amba_device {
 	struct regulator	*vcore;
 	u64			dma_mask;
 	unsigned int		periphid;
+	const char		*name;
 	unsigned int		irq[AMBA_NR_IRQS];
 };
 
 struct amba_id {
 	unsigned int		id;
 	unsigned int		mask;
+	const char		*name;
 	void			*data;
 };
 
-- 
1.7.3.1

  reply	other threads:[~2011-03-15 14:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-15 14:41 [PATCH 0/4] Fix ST-Ericsson Ux500 specific PL022 & PL180 amba devices Philippe Langlais
2011-03-15 14:41 ` Philippe Langlais [this message]
2011-03-15 14:49   ` [PATCH 1/4] amba: add name based matching Russell King - ARM Linux
2011-03-15 14:55     ` Linus Walleij
2011-03-17  8:47     ` Linus Walleij
2011-03-17  8:48       ` Russell King - ARM Linux
2011-03-17  8:58         ` Linus Walleij
2011-03-15 14:41 ` [PATCH 2/4] amba-pl022: Add loopback support for the SPI on 5500 Philippe Langlais
2011-03-15 14:41 ` [PATCH 3/4] mmci/pl180: Support for db8500v2. ST-Ericsson modified ARM PrimeCell PL180 block has not got an updated corresponding amba-id, althought the IP block has changed in db8500v2. The change was done to the datactrl register Philippe Langlais
2011-03-15 14:41 ` [PATCH 4/4] ux500: pass name for db5500-spi & db8500v2-sdi devices Philippe Langlais

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=1300200116-12185-2-git-send-email-philippe.langlais@stericsson.com \
    --to=philippe.langlais@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.