linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register
@ 2015-01-09  0:28 Nobuhiro Iwamatsu
  2015-01-16 10:10 ` yoshihiro shimoda
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Nobuhiro Iwamatsu @ 2015-01-09  0:28 UTC (permalink / raw)
  To: linux-sh

INTSTS1 and INTENB1 register of renesas_usbhs can access only Host mode.
This adds process of accessing INTSTS1 and INTENB1 only when renesas_usbhs
is Host mode.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
---
 drivers/usb/renesas_usbhs/mod.c | 61 +++++++++++++++++++++++------------------
 1 file changed, 34 insertions(+), 27 deletions(-)

diff --git a/drivers/usb/renesas_usbhs/mod.c b/drivers/usb/renesas_usbhs/mod.c
index 9a705b1..e5ce6e6 100644
--- a/drivers/usb/renesas_usbhs/mod.c
+++ b/drivers/usb/renesas_usbhs/mod.c
@@ -218,10 +218,12 @@ static int usbhs_status_get_each_irq(struct usbhs_priv *priv,
 	/********************  spin lock ********************/
 	usbhs_lock(priv, flags);
 	state->intsts0 = usbhs_read(priv, INTSTS0);
-	state->intsts1 = usbhs_read(priv, INTSTS1);
-
 	intenb0 = usbhs_read(priv, INTENB0);
-	intenb1 = usbhs_read(priv, INTENB1);
+
+	if (usbhs_mod_is_host(priv)) {
+		state->intsts1 = usbhs_read(priv, INTSTS1);
+		intenb1 = usbhs_read(priv, INTENB1);
+	}
 
 	/* mask */
 	if (mod) {
@@ -275,7 +277,8 @@ static irqreturn_t usbhs_interrupt(int irq, void *data)
 	 *	   - Function :: VALID bit should 0
 	 */
 	usbhs_write(priv, INTSTS0, ~irq_state.intsts0 & INTSTS0_MAGIC);
-	usbhs_write(priv, INTSTS1, ~irq_state.intsts1 & INTSTS1_MAGIC);
+	if (usbhs_mod_is_host(priv))
+		usbhs_write(priv, INTSTS1, ~irq_state.intsts1 & INTSTS1_MAGIC);
 
 	usbhs_write(priv, BRDYSTS, ~irq_state.brdysts);
 	usbhs_write(priv, NRDYSTS, ~irq_state.nrdysts);
@@ -303,19 +306,20 @@ static irqreturn_t usbhs_interrupt(int irq, void *data)
 	if (irq_state.intsts0 & BRDY)
 		usbhs_mod_call(priv, irq_ready, priv, &irq_state);
 
-	/* INTSTS1 */
-	if (irq_state.intsts1 & ATTCH)
-		usbhs_mod_call(priv, irq_attch, priv, &irq_state);
-
-	if (irq_state.intsts1 & DTCH)
-		usbhs_mod_call(priv, irq_dtch, priv, &irq_state);
+	if (usbhs_mod_is_host(priv)) {
+		/* INTSTS1 */
+		if (irq_state.intsts1 & ATTCH)
+			usbhs_mod_call(priv, irq_attch, priv, &irq_state);
 
-	if (irq_state.intsts1 & SIGN)
-		usbhs_mod_call(priv, irq_sign, priv, &irq_state);
+		if (irq_state.intsts1 & DTCH)
+			usbhs_mod_call(priv, irq_dtch, priv, &irq_state);
 
-	if (irq_state.intsts1 & SACK)
-		usbhs_mod_call(priv, irq_sack, priv, &irq_state);
+		if (irq_state.intsts1 & SIGN)
+			usbhs_mod_call(priv, irq_sign, priv, &irq_state);
 
+		if (irq_state.intsts1 & SACK)
+			usbhs_mod_call(priv, irq_sack, priv, &irq_state);
+	}
 	return IRQ_HANDLED;
 }
 
@@ -334,7 +338,8 @@ void usbhs_irq_callback_update(struct usbhs_priv *priv, struct usbhs_mod *mod)
 	 *  - update INTSTS0
 	 */
 	usbhs_write(priv, INTENB0, 0);
-	usbhs_write(priv, INTENB1, 0);
+	if (usbhs_mod_is_host(priv))
+		usbhs_write(priv, INTENB1, 0);
 
 	usbhs_write(priv, BEMPENB, 0);
 	usbhs_write(priv, BRDYENB, 0);
@@ -368,25 +373,27 @@ void usbhs_irq_callback_update(struct usbhs_priv *priv, struct usbhs_mod *mod)
 			intenb0 |= BRDYE;
 		}
 
-		/*
-		 * INTSTS1
-		 */
-		if (mod->irq_attch)
-			intenb1 |= ATTCHE;
+		if (usbhs_mod_is_host(priv)) {
+			/*
+			 * INTSTS1
+			 */
+			if (mod->irq_attch)
+				intenb1 |= ATTCHE;
 
-		if (mod->irq_dtch)
-			intenb1 |= DTCHE;
+			if (mod->irq_dtch)
+				intenb1 |= DTCHE;
 
-		if (mod->irq_sign)
-			intenb1 |= SIGNE;
+			if (mod->irq_sign)
+				intenb1 |= SIGNE;
 
-		if (mod->irq_sack)
-			intenb1 |= SACKE;
+			if (mod->irq_sack)
+				intenb1 |= SACKE;
+		}
 	}
 
 	if (intenb0)
 		usbhs_write(priv, INTENB0, intenb0);
 
-	if (intenb1)
+	if (usbhs_mod_is_host(priv) && intenb1)
 		usbhs_write(priv, INTENB1, intenb1);
 }
-- 
2.1.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [PATCH] usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register
  2015-01-09  0:28 [PATCH] usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register Nobuhiro Iwamatsu
@ 2015-01-16 10:10 ` yoshihiro shimoda
  2015-03-06  6:54 ` Nobuhiro Iwamatsu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: yoshihiro shimoda @ 2015-01-16 10:10 UTC (permalink / raw)
  To: linux-sh

Hi Iwamatsu-san,

> INTSTS1 and INTENB1 register of renesas_usbhs can access only Host mode.
> This adds process of accessing INTSTS1 and INTENB1 only when renesas_usbhs
> is Host mode.
> 
> Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>

Thank you for the patch.

Acked-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Best regards,
Yoshihiro Shimoda


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register
  2015-01-09  0:28 [PATCH] usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register Nobuhiro Iwamatsu
  2015-01-16 10:10 ` yoshihiro shimoda
@ 2015-03-06  6:54 ` Nobuhiro Iwamatsu
  2015-05-14  6:18 ` Yoshihiro Shimoda
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Nobuhiro Iwamatsu @ 2015-03-06  6:54 UTC (permalink / raw)
  To: linux-sh

ping?

(2015/01/16 19:10), yoshihiro shimoda wrote:
> Hi Iwamatsu-san,
>
>> INTSTS1 and INTENB1 register of renesas_usbhs can access only Host mode.
>> This adds process of accessing INTSTS1 and INTENB1 only when renesas_usbhs
>> is Host mode.
>>
>> Signed-off-by: Nobuhiro Iwamatsu<nobuhiro.iwamatsu.yj@renesas.com>
>
> Thank you for the patch.
>
> Acked-by: Yoshihiro Shimoda<yoshihiro.shimoda.uh@renesas.com>
>
> Best regards,
> Yoshihiro Shimoda
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register
  2015-01-09  0:28 [PATCH] usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register Nobuhiro Iwamatsu
  2015-01-16 10:10 ` yoshihiro shimoda
  2015-03-06  6:54 ` Nobuhiro Iwamatsu
@ 2015-05-14  6:18 ` Yoshihiro Shimoda
  2015-05-14  6:47 ` Felipe Balbi
  2015-05-14  7:05 ` Yoshihiro Shimoda
  4 siblings, 0 replies; 6+ messages in thread
From: Yoshihiro Shimoda @ 2015-05-14  6:18 UTC (permalink / raw)
  To: linux-sh

Hi Felipe,

> Sent: Friday, March 06, 2015 3:55 PM
> 
> ping?
> 
> (2015/01/16 19:10), yoshihiro shimoda wrote:
> > Hi Iwamatsu-san,
> >
> >> INTSTS1 and INTENB1 register of renesas_usbhs can access only Host mode.
> >> This adds process of accessing INTSTS1 and INTENB1 only when renesas_usbhs
> >> is Host mode.
> >>
> >> Signed-off-by: Nobuhiro Iwamatsu<nobuhiro.iwamatsu.yj@renesas.com>
> >
> > Thank you for the patch.
> >
> > Acked-by: Yoshihiro Shimoda<yoshihiro.shimoda.uh@renesas.com>
> >
> > Best regards,
> > Yoshihiro Shimoda
> >

Would you apply this patch to your testing/next branch?
This patch is very old, but I could apply it to the latest testing/next branch.
(commit id = 1c14905ef951fb968c8da90e4e64be02c309a2ae)

Best regards,
Yoshihiro Shimoda


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register
  2015-01-09  0:28 [PATCH] usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register Nobuhiro Iwamatsu
                   ` (2 preceding siblings ...)
  2015-05-14  6:18 ` Yoshihiro Shimoda
@ 2015-05-14  6:47 ` Felipe Balbi
  2015-05-14  7:05 ` Yoshihiro Shimoda
  4 siblings, 0 replies; 6+ messages in thread
From: Felipe Balbi @ 2015-05-14  6:47 UTC (permalink / raw)
  To: linux-sh

[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]

Hi,

On Thu, May 14, 2015 at 06:18:06AM +0000, Yoshihiro Shimoda wrote:
> Hi Felipe,
> 
> > Sent: Friday, March 06, 2015 3:55 PM
> > 
> > ping?
> > 
> > (2015/01/16 19:10), yoshihiro shimoda wrote:
> > > Hi Iwamatsu-san,
> > >
> > >> INTSTS1 and INTENB1 register of renesas_usbhs can access only Host mode.
> > >> This adds process of accessing INTSTS1 and INTENB1 only when renesas_usbhs
> > >> is Host mode.
> > >>
> > >> Signed-off-by: Nobuhiro Iwamatsu<nobuhiro.iwamatsu.yj@renesas.com>
> > >
> > > Thank you for the patch.
> > >
> > > Acked-by: Yoshihiro Shimoda<yoshihiro.shimoda.uh@renesas.com>
> > >
> > > Best regards,
> > > Yoshihiro Shimoda
> > >
> 
> Would you apply this patch to your testing/next branch?
> This patch is very old, but I could apply it to the latest testing/next branch.
> (commit id = 1c14905ef951fb968c8da90e4e64be02c309a2ae)

thanks for adding me to Cc list, I wasn't in Cc and ended up missing
this completely. Luckily I still have it in my inbox and will apply it
in the morning (it's 1:50 AM :-p)

regards

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register
  2015-01-09  0:28 [PATCH] usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register Nobuhiro Iwamatsu
                   ` (3 preceding siblings ...)
  2015-05-14  6:47 ` Felipe Balbi
@ 2015-05-14  7:05 ` Yoshihiro Shimoda
  4 siblings, 0 replies; 6+ messages in thread
From: Yoshihiro Shimoda @ 2015-05-14  7:05 UTC (permalink / raw)
  To: linux-sh

Hi,

> Sent: Thursday, May 14, 2015 3:47 PM
> Hi,
< snip >
> On Thu, May 14, 2015 at 06:18:06AM +0000, Yoshihiro Shimoda wrote:
> > Hi Felipe,
> >
> > > Sent: Friday, March 06, 2015 3:55 PM
> > >
> > > ping?
> > >
> > > (2015/01/16 19:10), yoshihiro shimoda wrote:
> > > > Hi Iwamatsu-san,
> > > >
> > > >> INTSTS1 and INTENB1 register of renesas_usbhs can access only Host mode.
> > > >> This adds process of accessing INTSTS1 and INTENB1 only when renesas_usbhs
> > > >> is Host mode.
> > > >>
> > > >> Signed-off-by: Nobuhiro Iwamatsu<nobuhiro.iwamatsu.yj@renesas.com>
> > > >
> > > > Thank you for the patch.
> > > >
> > > > Acked-by: Yoshihiro Shimoda<yoshihiro.shimoda.uh@renesas.com>
> > > >
> > > > Best regards,
> > > > Yoshihiro Shimoda
> > > >
> >
> > Would you apply this patch to your testing/next branch?
> > This patch is very old, but I could apply it to the latest testing/next branch.
> > (commit id = 1c14905ef951fb968c8da90e4e64be02c309a2ae)
> 
> thanks for adding me to Cc list, I wasn't in Cc and ended up missing
> this completely. Luckily I still have it in my inbox and will apply it
> in the morning (it's 1:50 AM :-p)

Thank you very much for your prompt reply at midnight!
I got it.

Best regards,
Yoshihiro Shimoda

> regards
> 
> --
> balbi

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-05-14  7:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-09  0:28 [PATCH] usb: renesas_usbhs: Add access control for INTSTS1 and INTENB1 register Nobuhiro Iwamatsu
2015-01-16 10:10 ` yoshihiro shimoda
2015-03-06  6:54 ` Nobuhiro Iwamatsu
2015-05-14  6:18 ` Yoshihiro Shimoda
2015-05-14  6:47 ` Felipe Balbi
2015-05-14  7:05 ` Yoshihiro Shimoda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).