aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-04-22 13:42:14 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:44 -0400
commit491215d81049bfda749ebda007ecd3ae8bee19e3 (patch)
tree8124f233369373c7a8f91c1d9b9c54a41454d8be /drivers
parent4d34dccd5e8af3db8dbb594d6cd1ea74446dbf20 (diff)
V4L/DVB (7240): tveeprom: remove obsolete i2c driver code
The i2c driver code was once added for the out-of-tree ivtv driver, but the ivtv driver hasn't used that for a long time so this code can now be removed. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/tveeprom.c103
1 files changed, 0 insertions, 103 deletions
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c
index dc0da44a5af6..3cf8a8e801e5 100644
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@ -745,109 +745,6 @@ int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len)
745} 745}
746EXPORT_SYMBOL(tveeprom_read); 746EXPORT_SYMBOL(tveeprom_read);
747 747
748/* ----------------------------------------------------------------------- */
749/* needed for ivtv.sf.net at the moment. Should go away in the long */
750/* run, just call the exported tveeprom_* directly, there is no point in */
751/* using the indirect way via i2c_driver->command() */
752
753static unsigned short normal_i2c[] = {
754 0xa0 >> 1,
755 I2C_CLIENT_END,
756};
757
758I2C_CLIENT_INSMOD;
759
760static struct i2c_driver i2c_driver_tveeprom;
761
762static int
763tveeprom_command(struct i2c_client *client,
764 unsigned int cmd,
765 void *arg)
766{
767 struct tveeprom eeprom;
768 u32 *eeprom_props = arg;
769 u8 *buf;
770
771 switch (cmd) {
772 case 0:
773 buf = kzalloc(256, GFP_KERNEL);
774 tveeprom_read(client, buf, 256);
775 tveeprom_hauppauge_analog(client, &eeprom, buf);
776 kfree(buf);
777 eeprom_props[0] = eeprom.tuner_type;
778 eeprom_props[1] = eeprom.tuner_formats;
779 eeprom_props[2] = eeprom.model;
780 eeprom_props[3] = eeprom.revision;
781 eeprom_props[4] = eeprom.has_radio;
782 break;
783 default:
784 return -EINVAL;
785 }
786 return 0;
787}
788
789static int
790tveeprom_detect_client(struct i2c_adapter *adapter,
791 int address,
792 int kind)
793{
794 struct i2c_client *client;
795
796 client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
797 if (NULL == client)
798 return -ENOMEM;
799 client->addr = address;
800 client->adapter = adapter;
801 client->driver = &i2c_driver_tveeprom;
802 snprintf(client->name, sizeof(client->name), "tveeprom");
803 i2c_attach_client(client);
804
805 return 0;
806}
807
808static int
809tveeprom_attach_adapter(struct i2c_adapter *adapter)
810{
811 if (adapter->class & I2C_CLASS_TV_ANALOG)
812 return i2c_probe(adapter, &addr_data, tveeprom_detect_client);
813 return 0;
814}
815
816static int
817tveeprom_detach_client(struct i2c_client *client)
818{
819 int err;
820
821 err = i2c_detach_client(client);
822 if (err < 0)
823 return err;
824 kfree(client);
825 return 0;
826}
827
828static struct i2c_driver i2c_driver_tveeprom = {
829 .driver = {
830 .name = "tveeprom",
831 },
832 .id = I2C_DRIVERID_TVEEPROM,
833 .attach_adapter = tveeprom_attach_adapter,
834 .detach_client = tveeprom_detach_client,
835 .command = tveeprom_command,
836};
837
838static int __init tveeprom_init(void)
839{
840 return i2c_add_driver(&i2c_driver_tveeprom);
841}
842
843static void __exit tveeprom_exit(void)
844{
845 i2c_del_driver(&i2c_driver_tveeprom);
846}
847
848module_init(tveeprom_init);
849module_exit(tveeprom_exit);
850
851/* 748/*
852 * Local variables: 749 * Local variables:
853 * c-basic-offset: 8 750 * c-basic-offset: 8