diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-05-29 05:59:42 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-06-17 07:45:00 -0400 |
commit | b1c85cc049a681aee805311faa56fd21b44fb904 (patch) | |
tree | 9023aa62d5d710290f8635bbadbe7fcd2ff2713d /drivers/media/usb/gspca/sn9c20x.c | |
parent | 23898919c45ff5fc5d882ec6206b38a5fb6ecd88 (diff) |
[media] gspca: remove g_chip_ident
Remove g_chip_ident and replace it with g_chip_info.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/gspca/sn9c20x.c')
-rw-r--r-- | drivers/media/usb/gspca/sn9c20x.c | 67 |
1 files changed, 15 insertions, 52 deletions
diff --git a/drivers/media/usb/gspca/sn9c20x.c b/drivers/media/usb/gspca/sn9c20x.c index ead9a1f58513..23b71f9f5942 100644 --- a/drivers/media/usb/gspca/sn9c20x.c +++ b/drivers/media/usb/gspca/sn9c20x.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include "gspca.h" | 27 | #include "gspca.h" |
28 | #include "jpeg.h" | 28 | #include "jpeg.h" |
29 | 29 | ||
30 | #include <media/v4l2-chip-ident.h> | ||
31 | #include <linux/dmi.h> | 30 | #include <linux/dmi.h> |
32 | 31 | ||
33 | MODULE_AUTHOR("Brian Johnson <brijohn@gmail.com>, " | 32 | MODULE_AUTHOR("Brian Johnson <brijohn@gmail.com>, " |
@@ -582,22 +581,6 @@ static const s16 hsv_blue_y[] = { | |||
582 | 4, 2, 0, -1, -3, -5, -7, -9, -11 | 581 | 4, 2, 0, -1, -3, -5, -7, -9, -11 |
583 | }; | 582 | }; |
584 | 583 | ||
585 | static const u16 i2c_ident[] = { | ||
586 | V4L2_IDENT_OV9650, | ||
587 | V4L2_IDENT_OV9655, | ||
588 | V4L2_IDENT_SOI968, | ||
589 | V4L2_IDENT_OV7660, | ||
590 | V4L2_IDENT_OV7670, | ||
591 | V4L2_IDENT_MT9V011, | ||
592 | V4L2_IDENT_MT9V111, | ||
593 | V4L2_IDENT_MT9V112, | ||
594 | V4L2_IDENT_MT9M001C12ST, | ||
595 | V4L2_IDENT_MT9M111, | ||
596 | V4L2_IDENT_MT9M112, | ||
597 | V4L2_IDENT_HV7131R, | ||
598 | [SENSOR_MT9VPRB] = V4L2_IDENT_UNKNOWN, | ||
599 | }; | ||
600 | |||
601 | static const u16 bridge_init[][2] = { | 584 | static const u16 bridge_init[][2] = { |
602 | {0x1000, 0x78}, {0x1001, 0x40}, {0x1002, 0x1c}, | 585 | {0x1000, 0x78}, {0x1001, 0x40}, {0x1002, 0x1c}, |
603 | {0x1020, 0x80}, {0x1061, 0x01}, {0x1067, 0x40}, | 586 | {0x1020, 0x80}, {0x1061, 0x01}, {0x1067, 0x40}, |
@@ -1574,18 +1557,14 @@ static int sd_dbg_g_register(struct gspca_dev *gspca_dev, | |||
1574 | { | 1557 | { |
1575 | struct sd *sd = (struct sd *) gspca_dev; | 1558 | struct sd *sd = (struct sd *) gspca_dev; |
1576 | 1559 | ||
1577 | switch (reg->match.type) { | 1560 | switch (reg->match.addr) { |
1578 | case V4L2_CHIP_MATCH_HOST: | 1561 | case 0: |
1579 | if (reg->match.addr != 0) | ||
1580 | return -EINVAL; | ||
1581 | if (reg->reg < 0x1000 || reg->reg > 0x11ff) | 1562 | if (reg->reg < 0x1000 || reg->reg > 0x11ff) |
1582 | return -EINVAL; | 1563 | return -EINVAL; |
1583 | reg_r(gspca_dev, reg->reg, 1); | 1564 | reg_r(gspca_dev, reg->reg, 1); |
1584 | reg->val = gspca_dev->usb_buf[0]; | 1565 | reg->val = gspca_dev->usb_buf[0]; |
1585 | return gspca_dev->usb_err; | 1566 | return gspca_dev->usb_err; |
1586 | case V4L2_CHIP_MATCH_I2C_ADDR: | 1567 | case 1: |
1587 | if (reg->match.addr != sd->i2c_addr) | ||
1588 | return -EINVAL; | ||
1589 | if (sd->sensor >= SENSOR_MT9V011 && | 1568 | if (sd->sensor >= SENSOR_MT9V011 && |
1590 | sd->sensor <= SENSOR_MT9M112) { | 1569 | sd->sensor <= SENSOR_MT9M112) { |
1591 | i2c_r2(gspca_dev, reg->reg, (u16 *) ®->val); | 1570 | i2c_r2(gspca_dev, reg->reg, (u16 *) ®->val); |
@@ -1602,17 +1581,13 @@ static int sd_dbg_s_register(struct gspca_dev *gspca_dev, | |||
1602 | { | 1581 | { |
1603 | struct sd *sd = (struct sd *) gspca_dev; | 1582 | struct sd *sd = (struct sd *) gspca_dev; |
1604 | 1583 | ||
1605 | switch (reg->match.type) { | 1584 | switch (reg->match.addr) { |
1606 | case V4L2_CHIP_MATCH_HOST: | 1585 | case 0: |
1607 | if (reg->match.addr != 0) | ||
1608 | return -EINVAL; | ||
1609 | if (reg->reg < 0x1000 || reg->reg > 0x11ff) | 1586 | if (reg->reg < 0x1000 || reg->reg > 0x11ff) |
1610 | return -EINVAL; | 1587 | return -EINVAL; |
1611 | reg_w1(gspca_dev, reg->reg, reg->val); | 1588 | reg_w1(gspca_dev, reg->reg, reg->val); |
1612 | return gspca_dev->usb_err; | 1589 | return gspca_dev->usb_err; |
1613 | case V4L2_CHIP_MATCH_I2C_ADDR: | 1590 | case 1: |
1614 | if (reg->match.addr != sd->i2c_addr) | ||
1615 | return -EINVAL; | ||
1616 | if (sd->sensor >= SENSOR_MT9V011 && | 1591 | if (sd->sensor >= SENSOR_MT9V011 && |
1617 | sd->sensor <= SENSOR_MT9M112) { | 1592 | sd->sensor <= SENSOR_MT9M112) { |
1618 | i2c_w2(gspca_dev, reg->reg, reg->val); | 1593 | i2c_w2(gspca_dev, reg->reg, reg->val); |
@@ -1623,29 +1598,17 @@ static int sd_dbg_s_register(struct gspca_dev *gspca_dev, | |||
1623 | } | 1598 | } |
1624 | return -EINVAL; | 1599 | return -EINVAL; |
1625 | } | 1600 | } |
1626 | #endif | ||
1627 | 1601 | ||
1628 | static int sd_chip_ident(struct gspca_dev *gspca_dev, | 1602 | static int sd_chip_info(struct gspca_dev *gspca_dev, |
1629 | struct v4l2_dbg_chip_ident *chip) | 1603 | struct v4l2_dbg_chip_info *chip) |
1630 | { | 1604 | { |
1631 | struct sd *sd = (struct sd *) gspca_dev; | 1605 | if (chip->match.addr > 1) |
1632 | 1606 | return -EINVAL; | |
1633 | switch (chip->match.type) { | 1607 | if (chip->match.addr == 1) |
1634 | case V4L2_CHIP_MATCH_HOST: | 1608 | strlcpy(chip->name, "sensor", sizeof(chip->name)); |
1635 | if (chip->match.addr != 0) | 1609 | return 0; |
1636 | return -EINVAL; | ||
1637 | chip->revision = 0; | ||
1638 | chip->ident = V4L2_IDENT_SN9C20X; | ||
1639 | return 0; | ||
1640 | case V4L2_CHIP_MATCH_I2C_ADDR: | ||
1641 | if (chip->match.addr != sd->i2c_addr) | ||
1642 | return -EINVAL; | ||
1643 | chip->revision = 0; | ||
1644 | chip->ident = i2c_ident[sd->sensor]; | ||
1645 | return 0; | ||
1646 | } | ||
1647 | return -EINVAL; | ||
1648 | } | 1610 | } |
1611 | #endif | ||
1649 | 1612 | ||
1650 | static int sd_config(struct gspca_dev *gspca_dev, | 1613 | static int sd_config(struct gspca_dev *gspca_dev, |
1651 | const struct usb_device_id *id) | 1614 | const struct usb_device_id *id) |
@@ -2356,8 +2319,8 @@ static const struct sd_desc sd_desc = { | |||
2356 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 2319 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
2357 | .set_register = sd_dbg_s_register, | 2320 | .set_register = sd_dbg_s_register, |
2358 | .get_register = sd_dbg_g_register, | 2321 | .get_register = sd_dbg_g_register, |
2322 | .get_chip_info = sd_chip_info, | ||
2359 | #endif | 2323 | #endif |
2360 | .get_chip_ident = sd_chip_ident, | ||
2361 | }; | 2324 | }; |
2362 | 2325 | ||
2363 | #define SN9C20X(sensor, i2c_addr, flags) \ | 2326 | #define SN9C20X(sensor, i2c_addr, flags) \ |