Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2017-01-30 Thread Mauro Carvalho Chehab
Em Mon, 16 Jan 2017 21:13:58 +0100
Pavel Machek  escreveu:

> Hi!
> 
> > On 16.01.2017 12:10, Sean Young wrote:  
> > >
> > >Have you had a chance to test the ir-rx51 changes?
> > >
> > >Thanks
> > >Sean
> > >  
> > 
> > Still no, and afaik there are issues booting n900 with current kernel. Will
> > try to find time over the weekend.  
> 
> v4.10-rc3 (?) works for me on n900. Do you want a working .config?

I'm merging this patch at the media tree. Please report if you
find any issues for us to fix in time for 4.11.

Thanks,
Mauro

Thanks,
Mauro


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2017-01-30 Thread Mauro Carvalho Chehab
Em Mon, 16 Jan 2017 21:13:58 +0100
Pavel Machek  escreveu:

> Hi!
> 
> > On 16.01.2017 12:10, Sean Young wrote:  
> > >
> > >Have you had a chance to test the ir-rx51 changes?
> > >
> > >Thanks
> > >Sean
> > >  
> > 
> > Still no, and afaik there are issues booting n900 with current kernel. Will
> > try to find time over the weekend.  
> 
> v4.10-rc3 (?) works for me on n900. Do you want a working .config?

I'm merging this patch at the media tree. Please report if you
find any issues for us to fix in time for 4.11.

Thanks,
Mauro

Thanks,
Mauro


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2017-01-16 Thread Pavel Machek
Hi!

> On 16.01.2017 12:10, Sean Young wrote:
> >
> >Have you had a chance to test the ir-rx51 changes?
> >
> >Thanks
> >Sean
> >
> 
> Still no, and afaik there are issues booting n900 with current kernel. Will
> try to find time over the weekend.

v4.10-rc3 (?) works for me on n900. Do you want a working .config?

Best regards,
Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2017-01-16 Thread Pavel Machek
Hi!

> On 16.01.2017 12:10, Sean Young wrote:
> >
> >Have you had a chance to test the ir-rx51 changes?
> >
> >Thanks
> >Sean
> >
> 
> Still no, and afaik there are issues booting n900 with current kernel. Will
> try to find time over the weekend.

v4.10-rc3 (?) works for me on n900. Do you want a working .config?

Best regards,
Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2017-01-16 Thread Ivaylo Dimitrov

Hi

On 16.01.2017 12:10, Sean Young wrote:


Have you had a chance to test the ir-rx51 changes?

Thanks
Sean



Still no, and afaik there are issues booting n900 with current kernel. 
Will try to find time over the weekend.


Ivo


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2017-01-16 Thread Ivaylo Dimitrov

Hi

On 16.01.2017 12:10, Sean Young wrote:


Have you had a chance to test the ir-rx51 changes?

Thanks
Sean



Still no, and afaik there are issues booting n900 with current kernel. 
Will try to find time over the weekend.


Ivo


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2017-01-16 Thread Sean Young
Hi Ivo,

On Fri, Dec 30, 2016 at 03:50:42PM +0200, Ivaylo Dimitrov wrote:
> On 30.12.2016 15:30, Sean Young wrote:
> >
> >On Fri, Dec 30, 2016 at 01:07:52PM +, Sean Young wrote:
> >>Hi Ivo,,
> >>
> >>On Fri, Dec 30, 2016 at 01:30:01PM +0200, Ivaylo Dimitrov wrote:
> >>>On 20.12.2016 19:50, Sean Young wrote:
> This driver was written using lirc since rc-core did not support
> transmitter-only hardware at that time. Now that it does, port
> this driver.
> 
> Compile tested only.
> 
> >>>
> >>>I guess after that change, there will be no more /dev/lircN device, right?
> >>>Neither will LIRC_XXX IOCTL codes be supported?
> >>
> >>Quite the opposite, /dev/lircN and all the LIRC_XXX ioctls will still be
> >>supported through ir-lirc-codec.c.
> >>
> >>By using rc-core, the driver will be more succinct, and some latent bugs
> >>will be fixed. For example, at the moment it is possible to write hours
> >>of IR data and keep the n900 from suspending.
> >>
> >>I'm working on lirc scancode sending and receiving using the IR encoders,
> >>and when that is in place, any rc-core driver will get it for free.
> >>
> >>>That looks to me as a completely new driver, not a port to new API.
> >>>
> >>>Right now there are applications using the current behaviour (pierogi for
> >>>example), which will be broken by the change.
> >>
> >>Nothing should break.
> >
> >Speaking of which, if you would please test this, that would be great. My
> >N900 died many years ago.
> >
> 
> Will do, but next year :) .

Have you had a chance to test the ir-rx51 changes?

Thanks
Sean


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2017-01-16 Thread Sean Young
Hi Ivo,

On Fri, Dec 30, 2016 at 03:50:42PM +0200, Ivaylo Dimitrov wrote:
> On 30.12.2016 15:30, Sean Young wrote:
> >
> >On Fri, Dec 30, 2016 at 01:07:52PM +, Sean Young wrote:
> >>Hi Ivo,,
> >>
> >>On Fri, Dec 30, 2016 at 01:30:01PM +0200, Ivaylo Dimitrov wrote:
> >>>On 20.12.2016 19:50, Sean Young wrote:
> This driver was written using lirc since rc-core did not support
> transmitter-only hardware at that time. Now that it does, port
> this driver.
> 
> Compile tested only.
> 
> >>>
> >>>I guess after that change, there will be no more /dev/lircN device, right?
> >>>Neither will LIRC_XXX IOCTL codes be supported?
> >>
> >>Quite the opposite, /dev/lircN and all the LIRC_XXX ioctls will still be
> >>supported through ir-lirc-codec.c.
> >>
> >>By using rc-core, the driver will be more succinct, and some latent bugs
> >>will be fixed. For example, at the moment it is possible to write hours
> >>of IR data and keep the n900 from suspending.
> >>
> >>I'm working on lirc scancode sending and receiving using the IR encoders,
> >>and when that is in place, any rc-core driver will get it for free.
> >>
> >>>That looks to me as a completely new driver, not a port to new API.
> >>>
> >>>Right now there are applications using the current behaviour (pierogi for
> >>>example), which will be broken by the change.
> >>
> >>Nothing should break.
> >
> >Speaking of which, if you would please test this, that would be great. My
> >N900 died many years ago.
> >
> 
> Will do, but next year :) .

Have you had a chance to test the ir-rx51 changes?

Thanks
Sean


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2016-12-30 Thread Sean Young
Hi Ivo,

On Fri, Dec 30, 2016 at 03:50:42PM +0200, Ivaylo Dimitrov wrote:
> On 30.12.2016 15:30, Sean Young wrote:
> >On Fri, Dec 30, 2016 at 01:07:52PM +, Sean Young wrote:
> >Speaking of which, if you would please test this, that would be great. My
> >N900 died many years ago.
> 
> Will do, but next year :) .

Great, thanks!

Sean


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2016-12-30 Thread Sean Young
Hi Ivo,

On Fri, Dec 30, 2016 at 03:50:42PM +0200, Ivaylo Dimitrov wrote:
> On 30.12.2016 15:30, Sean Young wrote:
> >On Fri, Dec 30, 2016 at 01:07:52PM +, Sean Young wrote:
> >Speaking of which, if you would please test this, that would be great. My
> >N900 died many years ago.
> 
> Will do, but next year :) .

Great, thanks!

Sean


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2016-12-30 Thread Ivaylo Dimitrov



On 30.12.2016 15:30, Sean Young wrote:


On Fri, Dec 30, 2016 at 01:07:52PM +, Sean Young wrote:

Hi Ivo,,

On Fri, Dec 30, 2016 at 01:30:01PM +0200, Ivaylo Dimitrov wrote:

On 20.12.2016 19:50, Sean Young wrote:

This driver was written using lirc since rc-core did not support
transmitter-only hardware at that time. Now that it does, port
this driver.

Compile tested only.



I guess after that change, there will be no more /dev/lircN device, right?
Neither will LIRC_XXX IOCTL codes be supported?


Quite the opposite, /dev/lircN and all the LIRC_XXX ioctls will still be
supported through ir-lirc-codec.c.

By using rc-core, the driver will be more succinct, and some latent bugs
will be fixed. For example, at the moment it is possible to write hours
of IR data and keep the n900 from suspending.

I'm working on lirc scancode sending and receiving using the IR encoders,
and when that is in place, any rc-core driver will get it for free.


That looks to me as a completely new driver, not a port to new API.

Right now there are applications using the current behaviour (pierogi for
example), which will be broken by the change.


Nothing should break.


Speaking of which, if you would please test this, that would be great. My
N900 died many years ago.



Will do, but next year :) .

Thanks,
Ivo


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2016-12-30 Thread Ivaylo Dimitrov



On 30.12.2016 15:30, Sean Young wrote:


On Fri, Dec 30, 2016 at 01:07:52PM +, Sean Young wrote:

Hi Ivo,,

On Fri, Dec 30, 2016 at 01:30:01PM +0200, Ivaylo Dimitrov wrote:

On 20.12.2016 19:50, Sean Young wrote:

This driver was written using lirc since rc-core did not support
transmitter-only hardware at that time. Now that it does, port
this driver.

Compile tested only.



I guess after that change, there will be no more /dev/lircN device, right?
Neither will LIRC_XXX IOCTL codes be supported?


Quite the opposite, /dev/lircN and all the LIRC_XXX ioctls will still be
supported through ir-lirc-codec.c.

By using rc-core, the driver will be more succinct, and some latent bugs
will be fixed. For example, at the moment it is possible to write hours
of IR data and keep the n900 from suspending.

I'm working on lirc scancode sending and receiving using the IR encoders,
and when that is in place, any rc-core driver will get it for free.


That looks to me as a completely new driver, not a port to new API.

Right now there are applications using the current behaviour (pierogi for
example), which will be broken by the change.


Nothing should break.


Speaking of which, if you would please test this, that would be great. My
N900 died many years ago.



Will do, but next year :) .

Thanks,
Ivo


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2016-12-30 Thread Sean Young

On Fri, Dec 30, 2016 at 01:07:52PM +, Sean Young wrote:
> Hi Ivo,,
> 
> On Fri, Dec 30, 2016 at 01:30:01PM +0200, Ivaylo Dimitrov wrote:
> > On 20.12.2016 19:50, Sean Young wrote:
> > >This driver was written using lirc since rc-core did not support
> > >transmitter-only hardware at that time. Now that it does, port
> > >this driver.
> > >
> > >Compile tested only.
> > >
> > 
> > I guess after that change, there will be no more /dev/lircN device, right?
> > Neither will LIRC_XXX IOCTL codes be supported?
> 
> Quite the opposite, /dev/lircN and all the LIRC_XXX ioctls will still be
> supported through ir-lirc-codec.c.
> 
> By using rc-core, the driver will be more succinct, and some latent bugs
> will be fixed. For example, at the moment it is possible to write hours
> of IR data and keep the n900 from suspending.
> 
> I'm working on lirc scancode sending and receiving using the IR encoders,
> and when that is in place, any rc-core driver will get it for free.
> 
> > That looks to me as a completely new driver, not a port to new API.
> > 
> > Right now there are applications using the current behaviour (pierogi for
> > example), which will be broken by the change.
> 
> Nothing should break.

Speaking of which, if you would please test this, that would be great. My
N900 died many years ago.

Many thanks,

Sean


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2016-12-30 Thread Sean Young

On Fri, Dec 30, 2016 at 01:07:52PM +, Sean Young wrote:
> Hi Ivo,,
> 
> On Fri, Dec 30, 2016 at 01:30:01PM +0200, Ivaylo Dimitrov wrote:
> > On 20.12.2016 19:50, Sean Young wrote:
> > >This driver was written using lirc since rc-core did not support
> > >transmitter-only hardware at that time. Now that it does, port
> > >this driver.
> > >
> > >Compile tested only.
> > >
> > 
> > I guess after that change, there will be no more /dev/lircN device, right?
> > Neither will LIRC_XXX IOCTL codes be supported?
> 
> Quite the opposite, /dev/lircN and all the LIRC_XXX ioctls will still be
> supported through ir-lirc-codec.c.
> 
> By using rc-core, the driver will be more succinct, and some latent bugs
> will be fixed. For example, at the moment it is possible to write hours
> of IR data and keep the n900 from suspending.
> 
> I'm working on lirc scancode sending and receiving using the IR encoders,
> and when that is in place, any rc-core driver will get it for free.
> 
> > That looks to me as a completely new driver, not a port to new API.
> > 
> > Right now there are applications using the current behaviour (pierogi for
> > example), which will be broken by the change.
> 
> Nothing should break.

Speaking of which, if you would please test this, that would be great. My
N900 died many years ago.

Many thanks,

Sean


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2016-12-30 Thread Sean Young
Hi Ivo,,

On Fri, Dec 30, 2016 at 01:30:01PM +0200, Ivaylo Dimitrov wrote:
> On 20.12.2016 19:50, Sean Young wrote:
> >This driver was written using lirc since rc-core did not support
> >transmitter-only hardware at that time. Now that it does, port
> >this driver.
> >
> >Compile tested only.
> >
> 
> I guess after that change, there will be no more /dev/lircN device, right?
> Neither will LIRC_XXX IOCTL codes be supported?

Quite the opposite, /dev/lircN and all the LIRC_XXX ioctls will still be
supported through ir-lirc-codec.c.

By using rc-core, the driver will be more succinct, and some latent bugs
will be fixed. For example, at the moment it is possible to write hours
of IR data and keep the n900 from suspending.

I'm working on lirc scancode sending and receiving using the IR encoders,
and when that is in place, any rc-core driver will get it for free.

> That looks to me as a completely new driver, not a port to new API.
> 
> Right now there are applications using the current behaviour (pierogi for
> example), which will be broken by the change.

Nothing should break.

Thanks,

Sean


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2016-12-30 Thread Sean Young
Hi Ivo,,

On Fri, Dec 30, 2016 at 01:30:01PM +0200, Ivaylo Dimitrov wrote:
> On 20.12.2016 19:50, Sean Young wrote:
> >This driver was written using lirc since rc-core did not support
> >transmitter-only hardware at that time. Now that it does, port
> >this driver.
> >
> >Compile tested only.
> >
> 
> I guess after that change, there will be no more /dev/lircN device, right?
> Neither will LIRC_XXX IOCTL codes be supported?

Quite the opposite, /dev/lircN and all the LIRC_XXX ioctls will still be
supported through ir-lirc-codec.c.

By using rc-core, the driver will be more succinct, and some latent bugs
will be fixed. For example, at the moment it is possible to write hours
of IR data and keep the n900 from suspending.

I'm working on lirc scancode sending and receiving using the IR encoders,
and when that is in place, any rc-core driver will get it for free.

> That looks to me as a completely new driver, not a port to new API.
> 
> Right now there are applications using the current behaviour (pierogi for
> example), which will be broken by the change.

Nothing should break.

Thanks,

Sean


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2016-12-30 Thread Ivaylo Dimitrov

Hi,

On 20.12.2016 19:50, Sean Young wrote:

This driver was written using lirc since rc-core did not support
transmitter-only hardware at that time. Now that it does, port
this driver.

Compile tested only.



I guess after that change, there will be no more /dev/lircN device, 
right? Neither will LIRC_XXX IOCTL codes be supported?


That looks to me as a completely new driver, not a port to new API.

Right now there are applications using the current behaviour (pierogi 
for example), which will be broken by the change.


Ivo


Re: [PATCH 1/5] [media] ir-rx51: port to rc-core

2016-12-30 Thread Ivaylo Dimitrov

Hi,

On 20.12.2016 19:50, Sean Young wrote:

This driver was written using lirc since rc-core did not support
transmitter-only hardware at that time. Now that it does, port
this driver.

Compile tested only.



I guess after that change, there will be no more /dev/lircN device, 
right? Neither will LIRC_XXX IOCTL codes be supported?


That looks to me as a completely new driver, not a port to new API.

Right now there are applications using the current behaviour (pierogi 
for example), which will be broken by the change.


Ivo


[PATCH 1/5] [media] ir-rx51: port to rc-core

2016-12-20 Thread Sean Young
This driver was written using lirc since rc-core did not support
transmitter-only hardware at that time. Now that it does, port
this driver.

Compile tested only.

Signed-off-by: Sean Young 
Cc: Timo Kokkonen 
Cc: Ivaylo Dimitrov 
---
 arch/arm/mach-omap2/pdata-quirks.c  |   8 +-
 drivers/media/rc/Kconfig|   2 +-
 drivers/media/rc/ir-rx51.c  | 332 ++--
 include/linux/platform_data/media/ir-rx51.h |   6 +-
 4 files changed, 126 insertions(+), 222 deletions(-)

diff --git a/arch/arm/mach-omap2/pdata-quirks.c 
b/arch/arm/mach-omap2/pdata-quirks.c
index 05e20aa..fdd6e7f 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -485,15 +485,15 @@ static struct pwm_omap_dmtimer_pdata pwm_dmtimer_pdata = {
 };
 #endif
 
-static struct lirc_rx51_platform_data __maybe_unused rx51_lirc_data = {
+static struct ir_rx51_platform_data __maybe_unused rx51_ir_data = {
.set_max_mpu_wakeup_lat = omap_pm_set_max_mpu_wakeup_lat,
 };
 
-static struct platform_device __maybe_unused rx51_lirc_device = {
-   .name   = "lirc_rx51",
+static struct platform_device __maybe_unused rx51_ir_device = {
+   .name   = "ir_rx51",
.id = -1,
.dev= {
-   .platform_data = _lirc_data,
+   .platform_data = _ir_data,
},
 };
 
diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig
index 3351e25..d0ddbd3 100644
--- a/drivers/media/rc/Kconfig
+++ b/drivers/media/rc/Kconfig
@@ -345,7 +345,7 @@ config IR_TTUSBIR
 
 config IR_RX51
tristate "Nokia N900 IR transmitter diode"
-   depends on OMAP_DM_TIMER && PWM_OMAP_DMTIMER && ARCH_OMAP2PLUS && LIRC
+   depends on (OMAP_DM_TIMER && PWM_OMAP_DMTIMER && ARCH_OMAP2PLUS || 
COMPILE_TEST) && RC_CORE
---help---
   Say Y or M here if you want to enable support for the IR
   transmitter diode built in the Nokia N900 (RX51) device.
diff --git a/drivers/media/rc/ir-rx51.c b/drivers/media/rc/ir-rx51.c
index 82fb6f2..e897c15 100644
--- a/drivers/media/rc/ir-rx51.c
+++ b/drivers/media/rc/ir-rx51.c
@@ -15,32 +15,23 @@
  */
 #include 
 #include 
-#include 
-#include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 
-#include 
-#include 
+#include 
 #include 
 
-#define LIRC_RX51_DRIVER_FEATURES (LIRC_CAN_SET_SEND_DUTY_CYCLE |  \
-  LIRC_CAN_SET_SEND_CARRIER |  \
-  LIRC_CAN_SEND_PULSE)
-
-#define DRIVER_NAME "lirc_rx51"
-
 #define WBUF_LEN 256
 
-struct lirc_rx51 {
+struct ir_rx51 {
+   struct rc_dev *rcdev;
struct pwm_device *pwm;
struct hrtimer timer;
struct device*dev;
-   struct lirc_rx51_platform_data *pdata;
+   struct ir_rx51_platform_data *pdata;
wait_queue_head_t wqueue;
 
unsigned intfreq;   /* carrier frequency */
@@ -50,38 +41,37 @@ struct lirc_rx51 {
unsigned long   device_is_open;
 };
 
-static inline void lirc_rx51_on(struct lirc_rx51 *lirc_rx51)
+static inline void ir_rx51_on(struct ir_rx51 *ir_rx51)
 {
-   pwm_enable(lirc_rx51->pwm);
+   pwm_enable(ir_rx51->pwm);
 }
 
-static inline void lirc_rx51_off(struct lirc_rx51 *lirc_rx51)
+static inline void ir_rx51_off(struct ir_rx51 *ir_rx51)
 {
-   pwm_disable(lirc_rx51->pwm);
+   pwm_disable(ir_rx51->pwm);
 }
 
-static int init_timing_params(struct lirc_rx51 *lirc_rx51)
+static int init_timing_params(struct ir_rx51 *ir_rx51)
 {
-   struct pwm_device *pwm = lirc_rx51->pwm;
-   int duty, period = DIV_ROUND_CLOSEST(NSEC_PER_SEC, lirc_rx51->freq);
+   struct pwm_device *pwm = ir_rx51->pwm;
+   int duty, period = DIV_ROUND_CLOSEST(NSEC_PER_SEC, ir_rx51->freq);
 
-   duty = DIV_ROUND_CLOSEST(lirc_rx51->duty_cycle * period, 100);
+   duty = DIV_ROUND_CLOSEST(ir_rx51->duty_cycle * period, 100);
 
pwm_config(pwm, duty, period);
 
return 0;
 }
 
-static enum hrtimer_restart lirc_rx51_timer_cb(struct hrtimer *timer)
+static enum hrtimer_restart ir_rx51_timer_cb(struct hrtimer *timer)
 {
-   struct lirc_rx51 *lirc_rx51 =
-   container_of(timer, struct lirc_rx51, timer);
+   struct ir_rx51 *ir_rx51 = container_of(timer, struct ir_rx51, timer);
ktime_t now;
 
-   if (lirc_rx51->wbuf_index < 0) {
-   dev_err_ratelimited(lirc_rx51->dev,
-   "BUG wbuf_index has value of %i\n",
-   lirc_rx51->wbuf_index);
+   if (ir_rx51->wbuf_index < 0) {
+   dev_err_ratelimited(ir_rx51->dev,
+   "BUG wbuf_index has value of %i\n",
+   ir_rx51->wbuf_index);
goto end;
}
 
@@ -92,20 +82,20 @@ static enum hrtimer_restart 

[PATCH 1/5] [media] ir-rx51: port to rc-core

2016-12-20 Thread Sean Young
This driver was written using lirc since rc-core did not support
transmitter-only hardware at that time. Now that it does, port
this driver.

Compile tested only.

Signed-off-by: Sean Young 
Cc: Timo Kokkonen 
Cc: Ivaylo Dimitrov 
---
 arch/arm/mach-omap2/pdata-quirks.c  |   8 +-
 drivers/media/rc/Kconfig|   2 +-
 drivers/media/rc/ir-rx51.c  | 332 ++--
 include/linux/platform_data/media/ir-rx51.h |   6 +-
 4 files changed, 126 insertions(+), 222 deletions(-)

diff --git a/arch/arm/mach-omap2/pdata-quirks.c 
b/arch/arm/mach-omap2/pdata-quirks.c
index 05e20aa..fdd6e7f 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -485,15 +485,15 @@ static struct pwm_omap_dmtimer_pdata pwm_dmtimer_pdata = {
 };
 #endif
 
-static struct lirc_rx51_platform_data __maybe_unused rx51_lirc_data = {
+static struct ir_rx51_platform_data __maybe_unused rx51_ir_data = {
.set_max_mpu_wakeup_lat = omap_pm_set_max_mpu_wakeup_lat,
 };
 
-static struct platform_device __maybe_unused rx51_lirc_device = {
-   .name   = "lirc_rx51",
+static struct platform_device __maybe_unused rx51_ir_device = {
+   .name   = "ir_rx51",
.id = -1,
.dev= {
-   .platform_data = _lirc_data,
+   .platform_data = _ir_data,
},
 };
 
diff --git a/drivers/media/rc/Kconfig b/drivers/media/rc/Kconfig
index 3351e25..d0ddbd3 100644
--- a/drivers/media/rc/Kconfig
+++ b/drivers/media/rc/Kconfig
@@ -345,7 +345,7 @@ config IR_TTUSBIR
 
 config IR_RX51
tristate "Nokia N900 IR transmitter diode"
-   depends on OMAP_DM_TIMER && PWM_OMAP_DMTIMER && ARCH_OMAP2PLUS && LIRC
+   depends on (OMAP_DM_TIMER && PWM_OMAP_DMTIMER && ARCH_OMAP2PLUS || 
COMPILE_TEST) && RC_CORE
---help---
   Say Y or M here if you want to enable support for the IR
   transmitter diode built in the Nokia N900 (RX51) device.
diff --git a/drivers/media/rc/ir-rx51.c b/drivers/media/rc/ir-rx51.c
index 82fb6f2..e897c15 100644
--- a/drivers/media/rc/ir-rx51.c
+++ b/drivers/media/rc/ir-rx51.c
@@ -15,32 +15,23 @@
  */
 #include 
 #include 
-#include 
-#include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 
-#include 
-#include 
+#include 
 #include 
 
-#define LIRC_RX51_DRIVER_FEATURES (LIRC_CAN_SET_SEND_DUTY_CYCLE |  \
-  LIRC_CAN_SET_SEND_CARRIER |  \
-  LIRC_CAN_SEND_PULSE)
-
-#define DRIVER_NAME "lirc_rx51"
-
 #define WBUF_LEN 256
 
-struct lirc_rx51 {
+struct ir_rx51 {
+   struct rc_dev *rcdev;
struct pwm_device *pwm;
struct hrtimer timer;
struct device*dev;
-   struct lirc_rx51_platform_data *pdata;
+   struct ir_rx51_platform_data *pdata;
wait_queue_head_t wqueue;
 
unsigned intfreq;   /* carrier frequency */
@@ -50,38 +41,37 @@ struct lirc_rx51 {
unsigned long   device_is_open;
 };
 
-static inline void lirc_rx51_on(struct lirc_rx51 *lirc_rx51)
+static inline void ir_rx51_on(struct ir_rx51 *ir_rx51)
 {
-   pwm_enable(lirc_rx51->pwm);
+   pwm_enable(ir_rx51->pwm);
 }
 
-static inline void lirc_rx51_off(struct lirc_rx51 *lirc_rx51)
+static inline void ir_rx51_off(struct ir_rx51 *ir_rx51)
 {
-   pwm_disable(lirc_rx51->pwm);
+   pwm_disable(ir_rx51->pwm);
 }
 
-static int init_timing_params(struct lirc_rx51 *lirc_rx51)
+static int init_timing_params(struct ir_rx51 *ir_rx51)
 {
-   struct pwm_device *pwm = lirc_rx51->pwm;
-   int duty, period = DIV_ROUND_CLOSEST(NSEC_PER_SEC, lirc_rx51->freq);
+   struct pwm_device *pwm = ir_rx51->pwm;
+   int duty, period = DIV_ROUND_CLOSEST(NSEC_PER_SEC, ir_rx51->freq);
 
-   duty = DIV_ROUND_CLOSEST(lirc_rx51->duty_cycle * period, 100);
+   duty = DIV_ROUND_CLOSEST(ir_rx51->duty_cycle * period, 100);
 
pwm_config(pwm, duty, period);
 
return 0;
 }
 
-static enum hrtimer_restart lirc_rx51_timer_cb(struct hrtimer *timer)
+static enum hrtimer_restart ir_rx51_timer_cb(struct hrtimer *timer)
 {
-   struct lirc_rx51 *lirc_rx51 =
-   container_of(timer, struct lirc_rx51, timer);
+   struct ir_rx51 *ir_rx51 = container_of(timer, struct ir_rx51, timer);
ktime_t now;
 
-   if (lirc_rx51->wbuf_index < 0) {
-   dev_err_ratelimited(lirc_rx51->dev,
-   "BUG wbuf_index has value of %i\n",
-   lirc_rx51->wbuf_index);
+   if (ir_rx51->wbuf_index < 0) {
+   dev_err_ratelimited(ir_rx51->dev,
+   "BUG wbuf_index has value of %i\n",
+   ir_rx51->wbuf_index);
goto end;
}
 
@@ -92,20 +82,20 @@ static enum hrtimer_restart lirc_rx51_timer_cb(struct 
hrtimer *timer)
do {
u64 ns;
 
-