All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Cernekee <cernekee@gmail.com>
To: ralf@linux-mips.org
Cc: <ffainelli@freebox.fr>, <mbizon@freebox.fr>,
	<jonas.gorski@gmail.com>, <linux-mips@linux-mips.org>
Subject: [PATCH 1/7] MIPS: BCM63XX: Expose the USBH/USBD clocks on BCM6328/BCM6368
Date: Fri, 22 Jun 2012 22:14:51 -0700	[thread overview]
Message-ID: <0d275370a7def10f11d86b127ba502e5@localhost> (raw)
In-Reply-To: <0f67eabbb0d5c59add27e42a08b94944@localhost>

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 arch/mips/bcm63xx/clk.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
index 1db48ad..dff79ab 100644
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -160,7 +160,9 @@ static struct clk clk_pcm = {
  */
 static void usbh_set(struct clk *clk, int enable)
 {
-	if (BCMCPU_IS_6348())
+	if (BCMCPU_IS_6328())
+		bcm_hwclock_set(CKCTL_6328_USBH_EN, enable);
+	else if (BCMCPU_IS_6348())
 		bcm_hwclock_set(CKCTL_6348_USBH_EN, enable);
 	else if (BCMCPU_IS_6368())
 		bcm_hwclock_set(CKCTL_6368_USBH_EN, enable);
@@ -171,6 +173,21 @@ static struct clk clk_usbh = {
 };
 
 /*
+ * USB device clock
+ */
+static void usbd_set(struct clk *clk, int enable)
+{
+	if (BCMCPU_IS_6328())
+		bcm_hwclock_set(CKCTL_6328_USBD_EN, enable);
+	else if (BCMCPU_IS_6368())
+		bcm_hwclock_set(CKCTL_6368_USBD_EN, enable);
+}
+
+static struct clk clk_usbd = {
+	.set	= usbd_set,
+};
+
+/*
  * SPI clock
  */
 static void spi_set(struct clk *clk, int enable)
@@ -284,6 +301,8 @@ struct clk *clk_get(struct device *dev, const char *id)
 		return &clk_ephy;
 	if (!strcmp(id, "usbh"))
 		return &clk_usbh;
+	if (!strcmp(id, "usbd"))
+		return &clk_usbd;
 	if (!strcmp(id, "spi"))
 		return &clk_spi;
 	if (!strcmp(id, "xtm"))
-- 
1.7.11.1

WARNING: multiple messages have this Message-ID (diff)
From: Kevin Cernekee <cernekee@gmail.com>
To: ralf@linux-mips.org
Cc: ffainelli@freebox.fr, mbizon@freebox.fr, jonas.gorski@gmail.com,
	linux-mips@linux-mips.org
Subject: [PATCH 1/7] MIPS: BCM63XX: Expose the USBH/USBD clocks on BCM6328/BCM6368
Date: Fri, 22 Jun 2012 22:14:51 -0700	[thread overview]
Message-ID: <0d275370a7def10f11d86b127ba502e5@localhost> (raw)
Message-ID: <20120623051451.DMd8bY7YmuRj07WfgG4ryfHq3Y_t88_N_7HKObEUaMc@z> (raw)
In-Reply-To: <0f67eabbb0d5c59add27e42a08b94944@localhost>

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 arch/mips/bcm63xx/clk.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
index 1db48ad..dff79ab 100644
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -160,7 +160,9 @@ static struct clk clk_pcm = {
  */
 static void usbh_set(struct clk *clk, int enable)
 {
-	if (BCMCPU_IS_6348())
+	if (BCMCPU_IS_6328())
+		bcm_hwclock_set(CKCTL_6328_USBH_EN, enable);
+	else if (BCMCPU_IS_6348())
 		bcm_hwclock_set(CKCTL_6348_USBH_EN, enable);
 	else if (BCMCPU_IS_6368())
 		bcm_hwclock_set(CKCTL_6368_USBH_EN, enable);
@@ -171,6 +173,21 @@ static struct clk clk_usbh = {
 };
 
 /*
+ * USB device clock
+ */
+static void usbd_set(struct clk *clk, int enable)
+{
+	if (BCMCPU_IS_6328())
+		bcm_hwclock_set(CKCTL_6328_USBD_EN, enable);
+	else if (BCMCPU_IS_6368())
+		bcm_hwclock_set(CKCTL_6368_USBD_EN, enable);
+}
+
+static struct clk clk_usbd = {
+	.set	= usbd_set,
+};
+
+/*
  * SPI clock
  */
 static void spi_set(struct clk *clk, int enable)
@@ -284,6 +301,8 @@ struct clk *clk_get(struct device *dev, const char *id)
 		return &clk_ephy;
 	if (!strcmp(id, "usbh"))
 		return &clk_usbh;
+	if (!strcmp(id, "usbd"))
+		return &clk_usbd;
 	if (!strcmp(id, "spi"))
 		return &clk_spi;
 	if (!strcmp(id, "xtm"))
-- 
1.7.11.1

  reply	other threads:[~2012-06-23  5:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-23  5:14 [PATCH 0/7] Prerequisites for BCM63XX UDC driver Kevin Cernekee
2012-06-23  5:14 ` Kevin Cernekee
2012-06-23  5:14 ` Kevin Cernekee [this message]
2012-06-23  5:14   ` [PATCH 1/7] MIPS: BCM63XX: Expose the USBH/USBD clocks on BCM6328/BCM6368 Kevin Cernekee
2012-06-23  5:14 ` [PATCH 2/7] MIPS: BCM63XX: Move DMA descriptor definition into common header file Kevin Cernekee
2012-06-23  5:14   ` Kevin Cernekee
2012-06-26 15:13   ` Jonas Gorski
2012-06-23  5:14 ` [PATCH 3/7] MIPS: BCM63XX: Add new IUDMA definitions needed for USBD Kevin Cernekee
2012-06-23  5:14   ` Kevin Cernekee
2012-06-23  5:14 ` [PATCH 4/7] MIPS: BCM63XX: Add register definitions for USBD dependencies Kevin Cernekee
2012-06-23  5:14   ` Kevin Cernekee
2012-06-23  5:14 ` [PATCH 5/7] MIPS: BCM63XX: Fix USB IRQ definitions for 6328 Kevin Cernekee
2012-06-23  5:14   ` Kevin Cernekee
2012-06-23  5:14 ` [PATCH 6/7] MIPS: BCM63XX: Add register and IRQ definitions for USB 2.0 device Kevin Cernekee
2012-06-23  5:14   ` Kevin Cernekee
2012-06-23  5:14 ` [PATCH 7/7] MIPS: BCM63XX: Create platform_device for USBD Kevin Cernekee
2012-06-23  5:14   ` Kevin Cernekee
2012-07-09  2:58 ` [PATCH 0/7] Prerequisites for BCM63XX UDC driver Kevin Cernekee
2012-07-12  8:57   ` Jonas Gorski
2012-07-12  9:43     ` Florian Fainelli
2012-08-30 18:11 ` John Crispin

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=0d275370a7def10f11d86b127ba502e5@localhost \
    --to=cernekee@gmail.com \
    --cc=ffainelli@freebox.fr \
    --cc=jonas.gorski@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=mbizon@freebox.fr \
    --cc=ralf@linux-mips.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.