diff options
author | Len Brown <len.brown@intel.com> | 2011-01-12 18:06:06 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-12 18:06:06 -0500 |
commit | 56dbed129df3fdd4caf9018b6e7599ee258a5420 (patch) | |
tree | b902491aef3a99efe0d9d49edd0f6e414dba654f /drivers/media/dvb/siano | |
parent | 2a2d31c8dc6f1ebcf5eab1d93a0cb0fb4ed57c7c (diff) | |
parent | f878133bf022717b880d0e0995b8f91436fd605c (diff) |
Merge branch 'linus' into idle-test
Diffstat (limited to 'drivers/media/dvb/siano')
-rw-r--r-- | drivers/media/dvb/siano/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/dvb/siano/smscoreapi.c | 2 | ||||
-rw-r--r-- | drivers/media/dvb/siano/smsir.c | 52 | ||||
-rw-r--r-- | drivers/media/dvb/siano/smsir.h | 5 | ||||
-rw-r--r-- | drivers/media/dvb/siano/smsusb.c | 9 |
5 files changed, 34 insertions, 36 deletions
diff --git a/drivers/media/dvb/siano/Kconfig b/drivers/media/dvb/siano/Kconfig index e520bceee0a..bc6456eb2c4 100644 --- a/drivers/media/dvb/siano/Kconfig +++ b/drivers/media/dvb/siano/Kconfig @@ -4,7 +4,7 @@ config SMS_SIANO_MDTV tristate "Siano SMS1xxx based MDTV receiver" - depends on DVB_CORE && IR_CORE && HAS_DMA + depends on DVB_CORE && RC_CORE && HAS_DMA ---help--- Choose Y or M here if you have MDTV receiver with a Siano chipset. diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c index 135e45bd00c..78765ed2806 100644 --- a/drivers/media/dvb/siano/smscoreapi.c +++ b/drivers/media/dvb/siano/smscoreapi.c @@ -438,7 +438,7 @@ static int smscore_init_ir(struct smscore_device_t *coredev) int rc; void *buffer; - coredev->ir.input_dev = NULL; + coredev->ir.dev = NULL; ir_io = sms_get_board(smscore_get_board_id(coredev))->board_cfg.ir; if (ir_io) {/* only if IR port exist we use IR sub-module */ sms_info("IR loading"); diff --git a/drivers/media/dvb/siano/smsir.c b/drivers/media/dvb/siano/smsir.c index a27c44a8af5..37bc5c4b8ad 100644 --- a/drivers/media/dvb/siano/smsir.c +++ b/drivers/media/dvb/siano/smsir.c @@ -45,25 +45,24 @@ void sms_ir_event(struct smscore_device_t *coredev, const char *buf, int len) ev.duration = abs(samples[i]) * 1000; /* Convert to ns */ ev.pulse = (samples[i] > 0) ? false : true; - ir_raw_event_store(coredev->ir.input_dev, &ev); + ir_raw_event_store(coredev->ir.dev, &ev); } - ir_raw_event_handle(coredev->ir.input_dev); + ir_raw_event_handle(coredev->ir.dev); } int sms_ir_init(struct smscore_device_t *coredev) { - struct input_dev *input_dev; + int err; int board_id = smscore_get_board_id(coredev); + struct rc_dev *dev; - sms_log("Allocating input device"); - input_dev = input_allocate_device(); - if (!input_dev) { + sms_log("Allocating rc device"); + dev = rc_allocate_device(); + if (!dev) { sms_err("Not enough memory"); return -ENOMEM; } - coredev->ir.input_dev = input_dev; - coredev->ir.controller = 0; /* Todo: vega/nova SPI number */ coredev->ir.timeout = IR_DEFAULT_TIMEOUT; sms_log("IR port %d, timeout %d ms", @@ -75,38 +74,41 @@ int sms_ir_init(struct smscore_device_t *coredev) strlcpy(coredev->ir.phys, coredev->devpath, sizeof(coredev->ir.phys)); strlcat(coredev->ir.phys, "/ir0", sizeof(coredev->ir.phys)); - input_dev->name = coredev->ir.name; - input_dev->phys = coredev->ir.phys; - input_dev->dev.parent = coredev->device; + dev->input_name = coredev->ir.name; + dev->input_phys = coredev->ir.phys; + dev->dev.parent = coredev->device; #if 0 /* TODO: properly initialize the parameters bellow */ - input_dev->id.bustype = BUS_USB; - input_dev->id.version = 1; - input_dev->id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor); - input_dev->id.product = le16_to_cpu(dev->udev->descriptor.idProduct); + dev->input_id.bustype = BUS_USB; + dev->input_id.version = 1; + dev->input_id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor); + dev->input_id.product = le16_to_cpu(dev->udev->descriptor.idProduct); #endif - coredev->ir.props.priv = coredev; - coredev->ir.props.driver_type = RC_DRIVER_IR_RAW; - coredev->ir.props.allowed_protos = IR_TYPE_ALL; + dev->priv = coredev; + dev->driver_type = RC_DRIVER_IR_RAW; + dev->allowed_protos = RC_TYPE_ALL; + dev->map_name = sms_get_board(board_id)->rc_codes; + dev->driver_name = MODULE_NAME; - sms_log("Input device (IR) %s is set for key events", input_dev->name); + sms_log("Input device (IR) %s is set for key events", dev->input_name); - if (ir_input_register(input_dev, sms_get_board(board_id)->rc_codes, - &coredev->ir.props, MODULE_NAME)) { + err = rc_register_device(dev); + if (err < 0) { sms_err("Failed to register device"); - input_free_device(input_dev); - return -EACCES; + rc_free_device(dev); + return err; } + coredev->ir.dev = dev; return 0; } void sms_ir_exit(struct smscore_device_t *coredev) { - if (coredev->ir.input_dev) - ir_input_unregister(coredev->ir.input_dev); + if (coredev->ir.dev) + rc_unregister_device(coredev->ir.dev); sms_log(""); } diff --git a/drivers/media/dvb/siano/smsir.h b/drivers/media/dvb/siano/smsir.h index 926e247523b..ae92b3a8587 100644 --- a/drivers/media/dvb/siano/smsir.h +++ b/drivers/media/dvb/siano/smsir.h @@ -28,20 +28,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define __SMS_IR_H__ #include <linux/input.h> -#include <media/ir-core.h> +#include <media/rc-core.h> #define IR_DEFAULT_TIMEOUT 100 struct smscore_device_t; struct ir_t { - struct input_dev *input_dev; + struct rc_dev *dev; char name[40]; char phys[32]; char *rc_codes; u64 protocol; - struct ir_dev_props props; u32 timeout; u32 controller; diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c index 50d4338610e..0b8da57cf4c 100644 --- a/drivers/media/dvb/siano/smsusb.c +++ b/drivers/media/dvb/siano/smsusb.c @@ -288,8 +288,7 @@ static int smsusb1_setmode(void *context, int mode) static void smsusb_term_device(struct usb_interface *intf) { - struct smsusb_device_t *dev = - (struct smsusb_device_t *) usb_get_intfdata(intf); + struct smsusb_device_t *dev = usb_get_intfdata(intf); if (dev) { smsusb_stop_streaming(dev); @@ -445,8 +444,7 @@ static void smsusb_disconnect(struct usb_interface *intf) static int smsusb_suspend(struct usb_interface *intf, pm_message_t msg) { - struct smsusb_device_t *dev = - (struct smsusb_device_t *)usb_get_intfdata(intf); + struct smsusb_device_t *dev = usb_get_intfdata(intf); printk(KERN_INFO "%s: Entering status %d.\n", __func__, msg.event); smsusb_stop_streaming(dev); return 0; @@ -455,8 +453,7 @@ static int smsusb_suspend(struct usb_interface *intf, pm_message_t msg) static int smsusb_resume(struct usb_interface *intf) { int rc, i; - struct smsusb_device_t *dev = - (struct smsusb_device_t *)usb_get_intfdata(intf); + struct smsusb_device_t *dev = usb_get_intfdata(intf); struct usb_device *udev = interface_to_usbdev(intf); printk(KERN_INFO "%s: Entering.\n", __func__); |