diff mbox

[6/9,media] ir-rx51: fix clock API related build issues

Message ID 1362521809-22989-7-git-send-email-arnd@arndb.de (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann March 5, 2013, 10:16 p.m. UTC
OMAP1 no longer provides its own clock interfaces since patch
a135eaae52 "ARM: OMAP: remove plat/clock.h". This is great, but
we now have to convert the ir-rx51 driver to use the generic
interface from linux/clk.h.

The driver also uses the omap_dm_timer_get_fclk() function,
which is not exported for OMAP1, so we have to move the
definition out of the OMAP2 specific section.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Timo Kokkonen <timo.t.kokkonen@iki.fi>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-media@vger.kernel.org
---
 arch/arm/plat-omap/dmtimer.c | 16 ++++++++--------
 drivers/media/rc/ir-rx51.c   |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

Comments

Mauro Carvalho Chehab March 6, 2013, 12:23 a.m. UTC | #1
Em Tue,  5 Mar 2013 23:16:46 +0100
Arnd Bergmann <arnd@arndb.de> escreveu:

> OMAP1 no longer provides its own clock interfaces since patch
> a135eaae52 "ARM: OMAP: remove plat/clock.h". This is great, but
> we now have to convert the ir-rx51 driver to use the generic
> interface from linux/clk.h.
> 
> The driver also uses the omap_dm_timer_get_fclk() function,
> which is not exported for OMAP1, so we have to move the
> definition out of the OMAP2 specific section.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Mauro Carvalho Chehab <mchehab@redhat.com>

From my side:
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>

> Cc: Timo Kokkonen <timo.t.kokkonen@iki.fi>
> Cc: Tony Lindgren <tony@atomide.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-media@vger.kernel.org
> ---
>  arch/arm/plat-omap/dmtimer.c | 16 ++++++++--------
>  drivers/media/rc/ir-rx51.c   |  4 ++--
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
> index a0daa2f..ea133e5 100644
> --- a/arch/arm/plat-omap/dmtimer.c
> +++ b/arch/arm/plat-omap/dmtimer.c
> @@ -333,6 +333,14 @@ int omap_dm_timer_get_irq(struct omap_dm_timer *timer)
>  }
>  EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq);
>  
> +struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
> +{
> +	if (timer)
> +		return timer->fclk;
> +	return NULL;
> +}
> +EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk);
> +
>  #if defined(CONFIG_ARCH_OMAP1)
>  #include <mach/hardware.h>
>  /**
> @@ -371,14 +379,6 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask);
>  
>  #else
>  
> -struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
> -{
> -	if (timer)
> -		return timer->fclk;
> -	return NULL;
> -}
> -EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk);
> -
>  __u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
>  {
>  	BUG();
> diff --git a/drivers/media/rc/ir-rx51.c b/drivers/media/rc/ir-rx51.c
> index 8ead492..d1364a1 100644
> --- a/drivers/media/rc/ir-rx51.c
> +++ b/drivers/media/rc/ir-rx51.c
> @@ -25,9 +25,9 @@
>  #include <linux/platform_device.h>
>  #include <linux/sched.h>
>  #include <linux/wait.h>
> +#include <linux/clk.h>
>  
>  #include <plat/dmtimer.h>
> -#include <plat/clock.h>
>  
>  #include <media/lirc.h>
>  #include <media/lirc_dev.h>
> @@ -209,7 +209,7 @@ static int lirc_rx51_init_port(struct lirc_rx51 *lirc_rx51)
>  	}
>  
>  	clk_fclk = omap_dm_timer_get_fclk(lirc_rx51->pwm_timer);
> -	lirc_rx51->fclk_khz = clk_fclk->rate / 1000;
> +	lirc_rx51->fclk_khz = clk_get_rate(clk_fclk) / 1000;
>  
>  	return 0;
>
Tony Lindgren March 6, 2013, 1:09 a.m. UTC | #2
* Mauro Carvalho Chehab <mchehab@redhat.com> [130305 16:28]:
> Em Tue,  5 Mar 2013 23:16:46 +0100
> Arnd Bergmann <arnd@arndb.de> escreveu:
> 
> > OMAP1 no longer provides its own clock interfaces since patch
> > a135eaae52 "ARM: OMAP: remove plat/clock.h". This is great, but
> > we now have to convert the ir-rx51 driver to use the generic
> > interface from linux/clk.h.
> > 
> > The driver also uses the omap_dm_timer_get_fclk() function,
> > which is not exported for OMAP1, so we have to move the
> > definition out of the OMAP2 specific section.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
> 
> From my side:
> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>

There's just one issue, this driver most likely only needed on
rx51 board.. So I suggest we just mark the driver depends on
ARCH_OMAP2PLUS and let's drop this patch.

This driver is already disabled for ARCH_MULTIPLATFORM
as we need to move dmtimer.c to drivers and have some minimal
include/linux/timer-omap.h for it.
 
> > --- a/arch/arm/plat-omap/dmtimer.c
> > +++ b/arch/arm/plat-omap/dmtimer.c
> > @@ -333,6 +333,14 @@ int omap_dm_timer_get_irq(struct omap_dm_timer *timer)
> >  }
> >  EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq);
> >  
> > +struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
> > +{
> > +	if (timer)
> > +		return timer->fclk;
> > +	return NULL;
> > +}
> > +EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk);
> > +
> >  #if defined(CONFIG_ARCH_OMAP1)
> >  #include <mach/hardware.h>
> >  /**
> > @@ -371,14 +379,6 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask);
> >  
> >  #else
> >  
> > -struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
> > -{
> > -	if (timer)
> > -		return timer->fclk;
> > -	return NULL;
> > -}
> > -EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk);
> > -
> >  __u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
> >  {
> >  	BUG();

Then omap_dm_timer_get_fclk() won't work on omap1 as there's no
separate functional clock. We probably should not even export
this function eventually when things are fixed up.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Timo Kokkonen March 6, 2013, 6:22 a.m. UTC | #3
On 03.05 2013 17:09:53, Tony Lindgren wrote:
> * Mauro Carvalho Chehab <mchehab@redhat.com> [130305 16:28]:
> > Em Tue,  5 Mar 2013 23:16:46 +0100
> > Arnd Bergmann <arnd@arndb.de> escreveu:
> > 
> > > OMAP1 no longer provides its own clock interfaces since patch
> > > a135eaae52 "ARM: OMAP: remove plat/clock.h". This is great, but
> > > we now have to convert the ir-rx51 driver to use the generic
> > > interface from linux/clk.h.
> > > 
> > > The driver also uses the omap_dm_timer_get_fclk() function,
> > > which is not exported for OMAP1, so we have to move the
> > > definition out of the OMAP2 specific section.
> > > 
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
> > 
> > From my side:
> > Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> 
> There's just one issue, this driver most likely only needed on
> rx51 board.. So I suggest we just mark the driver depends on
> ARCH_OMAP2PLUS and let's drop this patch.
> 
> This driver is already disabled for ARCH_MULTIPLATFORM
> as we need to move dmtimer.c to drivers and have some minimal
> include/linux/timer-omap.h for it.
>  

I've also had this cunning plan that if or when the PWM subsystem
starts supporting the PWM output in OMAP3, I could convert this driver
to generate the IR carrier wave through the PWM subsystem and then use
HR timers to generate the pulses. I think that's much better approach
than trying to depend on interfaces that are not easily
available. Should be possible, but I haven't proven yet that it will
work :)

Unfortunately I haven't got into executing on that plan yet. In
addition to the challenge of scheduling some of my free time for doing
this, my RX51 device is not enumerating the USB with the latest kernel
and I haven't figured out that yet. And because of that, I haven't
been able to get my user space running over nfsroot setup I've been
using..

-Timo

> > > --- a/arch/arm/plat-omap/dmtimer.c
> > > +++ b/arch/arm/plat-omap/dmtimer.c
> > > @@ -333,6 +333,14 @@ int omap_dm_timer_get_irq(struct omap_dm_timer *timer)
> > >  }
> > >  EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq);
> > >  
> > > +struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
> > > +{
> > > +	if (timer)
> > > +		return timer->fclk;
> > > +	return NULL;
> > > +}
> > > +EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk);
> > > +
> > >  #if defined(CONFIG_ARCH_OMAP1)
> > >  #include <mach/hardware.h>
> > >  /**
> > > @@ -371,14 +379,6 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask);
> > >  
> > >  #else
> > >  
> > > -struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
> > > -{
> > > -	if (timer)
> > > -		return timer->fclk;
> > > -	return NULL;
> > > -}
> > > -EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk);
> > > -
> > >  __u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
> > >  {
> > >  	BUG();
> 
> Then omap_dm_timer_get_fclk() won't work on omap1 as there's no
> separate functional clock. We probably should not even export
> this function eventually when things are fixed up.
> 
> Regards,
> 
> Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren March 6, 2013, 5:16 p.m. UTC | #4
* Timo Kokkonen <timo.t.kokkonen@iki.fi> [130305 22:26]:
> On 03.05 2013 17:09:53, Tony Lindgren wrote:
> > * Mauro Carvalho Chehab <mchehab@redhat.com> [130305 16:28]:
> > > Em Tue,  5 Mar 2013 23:16:46 +0100
> > > Arnd Bergmann <arnd@arndb.de> escreveu:
> > > 
> > > > OMAP1 no longer provides its own clock interfaces since patch
> > > > a135eaae52 "ARM: OMAP: remove plat/clock.h". This is great, but
> > > > we now have to convert the ir-rx51 driver to use the generic
> > > > interface from linux/clk.h.
> > > > 
> > > > The driver also uses the omap_dm_timer_get_fclk() function,
> > > > which is not exported for OMAP1, so we have to move the
> > > > definition out of the OMAP2 specific section.
> > > > 
> > > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > > Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
> > > 
> > > From my side:
> > > Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> > 
> > There's just one issue, this driver most likely only needed on
> > rx51 board.. So I suggest we just mark the driver depends on
> > ARCH_OMAP2PLUS and let's drop this patch.
> > 
> > This driver is already disabled for ARCH_MULTIPLATFORM
> > as we need to move dmtimer.c to drivers and have some minimal
> > include/linux/timer-omap.h for it.
> >  
> 
> I've also had this cunning plan that if or when the PWM subsystem
> starts supporting the PWM output in OMAP3, I could convert this driver
> to generate the IR carrier wave through the PWM subsystem and then use
> HR timers to generate the pulses. I think that's much better approach
> than trying to depend on interfaces that are not easily
> available. Should be possible, but I haven't proven yet that it will
> work :)

Sounds good to me.
 
> Unfortunately I haven't got into executing on that plan yet. In
> addition to the challenge of scheduling some of my free time for doing
> this, my RX51 device is not enumerating the USB with the latest kernel
> and I haven't figured out that yet. And because of that, I haven't
> been able to get my user space running over nfsroot setup I've been
> using..

Git bisect might help there. Maybe post the output and cc the usb
people?

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index a0daa2f..ea133e5 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -333,6 +333,14 @@  int omap_dm_timer_get_irq(struct omap_dm_timer *timer)
 }
 EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq);
 
+struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
+{
+	if (timer)
+		return timer->fclk;
+	return NULL;
+}
+EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk);
+
 #if defined(CONFIG_ARCH_OMAP1)
 #include <mach/hardware.h>
 /**
@@ -371,14 +379,6 @@  EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask);
 
 #else
 
-struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer)
-{
-	if (timer)
-		return timer->fclk;
-	return NULL;
-}
-EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk);
-
 __u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask)
 {
 	BUG();
diff --git a/drivers/media/rc/ir-rx51.c b/drivers/media/rc/ir-rx51.c
index 8ead492..d1364a1 100644
--- a/drivers/media/rc/ir-rx51.c
+++ b/drivers/media/rc/ir-rx51.c
@@ -25,9 +25,9 @@ 
 #include <linux/platform_device.h>
 #include <linux/sched.h>
 #include <linux/wait.h>
+#include <linux/clk.h>
 
 #include <plat/dmtimer.h>
-#include <plat/clock.h>
 
 #include <media/lirc.h>
 #include <media/lirc_dev.h>
@@ -209,7 +209,7 @@  static int lirc_rx51_init_port(struct lirc_rx51 *lirc_rx51)
 	}
 
 	clk_fclk = omap_dm_timer_get_fclk(lirc_rx51->pwm_timer);
-	lirc_rx51->fclk_khz = clk_fclk->rate / 1000;
+	lirc_rx51->fclk_khz = clk_get_rate(clk_fclk) / 1000;
 
 	return 0;