diff options
author | Devin Heitmueller <devin.heitmueller@gmail.com> | 2008-11-25 04:04:02 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-29 14:53:41 -0500 |
commit | 6d676d8af852e483044837240ad9ca669a01aaf2 (patch) | |
tree | 5459e283b8800d54fe790c9329ade8d0fd18528f /drivers/media/video/em28xx | |
parent | 55927684e7c616b0b0976cc52926997f2da5930d (diff) |
V4L/DVB (9745): em28xx: Cleanup GPIO/GPO setup code
Cleanup the calls to set the GPIOs and GPOs for various devices,
replacing the register number with the #define from em28xx-reg.h and
converting over to using em28xx_write_reg()
Signed-off-by: Devin Heitmueller <devin.heitmueller@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index f3f84692856f..83f352a41041 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -1487,7 +1487,7 @@ void em28xx_pre_card_setup(struct em28xx *dev) | |||
1487 | EM28XX_I2C_FREQ_100_KHZ); | 1487 | EM28XX_I2C_FREQ_100_KHZ); |
1488 | /* FIXME guess */ | 1488 | /* FIXME guess */ |
1489 | /* Turn on analog audio output */ | 1489 | /* Turn on analog audio output */ |
1490 | em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1); | 1490 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); |
1491 | break; | 1491 | break; |
1492 | 1492 | ||
1493 | case EM2861_BOARD_KWORLD_PVRTV_300U: | 1493 | case EM2861_BOARD_KWORLD_PVRTV_300U: |
@@ -1499,9 +1499,9 @@ void em28xx_pre_card_setup(struct em28xx *dev) | |||
1499 | EM28XX_I2C_CLK_WAIT_ENABLE | | 1499 | EM28XX_I2C_CLK_WAIT_ENABLE | |
1500 | EM28XX_I2C_FREQ_100_KHZ); | 1500 | EM28XX_I2C_FREQ_100_KHZ); |
1501 | msleep(10); | 1501 | msleep(10); |
1502 | em28xx_write_regs(dev, 0x08, "\x6d", 1); | 1502 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x6d); |
1503 | msleep(10); | 1503 | msleep(10); |
1504 | em28xx_write_regs(dev, 0x08, "\x7d", 1); | 1504 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0x7d); |
1505 | msleep(10); | 1505 | msleep(10); |
1506 | break; | 1506 | break; |
1507 | 1507 | ||
@@ -1527,17 +1527,17 @@ void em28xx_pre_card_setup(struct em28xx *dev) | |||
1527 | EM28XX_I2C_FREQ_100_KHZ); | 1527 | EM28XX_I2C_FREQ_100_KHZ); |
1528 | /* TODO: someone can do some cleanup here... | 1528 | /* TODO: someone can do some cleanup here... |
1529 | not everything's needed */ | 1529 | not everything's needed */ |
1530 | em28xx_write_regs(dev, 0x04, "\x00", 1); | 1530 | em28xx_write_reg(dev, EM2880_R04_GPO, 0x00); |
1531 | msleep(10); | 1531 | msleep(10); |
1532 | em28xx_write_regs(dev, 0x04, "\x01", 1); | 1532 | em28xx_write_reg(dev, EM2880_R04_GPO, 0x01); |
1533 | msleep(10); | 1533 | msleep(10); |
1534 | em28xx_write_regs(dev, 0x08, "\xfd", 1); | 1534 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); |
1535 | mdelay(70); | 1535 | mdelay(70); |
1536 | em28xx_write_regs(dev, 0x08, "\xfc", 1); | 1536 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc); |
1537 | mdelay(70); | 1537 | mdelay(70); |
1538 | em28xx_write_regs(dev, 0x08, "\xdc", 1); | 1538 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xdc); |
1539 | mdelay(70); | 1539 | mdelay(70); |
1540 | em28xx_write_regs(dev, 0x08, "\xfc", 1); | 1540 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfc); |
1541 | mdelay(70); | 1541 | mdelay(70); |
1542 | break; | 1542 | break; |
1543 | 1543 | ||
@@ -1550,11 +1550,11 @@ void em28xx_pre_card_setup(struct em28xx *dev) | |||
1550 | EM28XX_I2C_FREQ_100_KHZ); | 1550 | EM28XX_I2C_FREQ_100_KHZ); |
1551 | /* this device needs some gpio writes to get the DVB-T | 1551 | /* this device needs some gpio writes to get the DVB-T |
1552 | demod work */ | 1552 | demod work */ |
1553 | em28xx_write_regs(dev, 0x08, "\xfe", 1); | 1553 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe); |
1554 | mdelay(70); | 1554 | mdelay(70); |
1555 | em28xx_write_regs(dev, 0x08, "\xde", 1); | 1555 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde); |
1556 | mdelay(70); | 1556 | mdelay(70); |
1557 | dev->em28xx_write_regs(dev, 0x08, "\xfe", 1); | 1557 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe); |
1558 | mdelay(70); | 1558 | mdelay(70); |
1559 | break; | 1559 | break; |
1560 | 1560 | ||
@@ -1565,11 +1565,11 @@ void em28xx_pre_card_setup(struct em28xx *dev) | |||
1565 | 1565 | ||
1566 | /* this device needs some gpio writes to get the | 1566 | /* this device needs some gpio writes to get the |
1567 | DVB-T demod work */ | 1567 | DVB-T demod work */ |
1568 | em28xx_write_regs(dev, 0x08, "\xfe", 1); | 1568 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe); |
1569 | mdelay(70); | 1569 | mdelay(70); |
1570 | em28xx_write_regs(dev, 0x08, "\xde", 1); | 1570 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xde); |
1571 | mdelay(70); | 1571 | mdelay(70); |
1572 | em28xx_write_regs(dev, 0x08, "\xfe", 1); | 1572 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfe); |
1573 | mdelay(70); | 1573 | mdelay(70); |
1574 | /* switch em2880 rc protocol */ | 1574 | /* switch em2880 rc protocol */ |
1575 | /* djh - I have serious doubts this is right... */ | 1575 | /* djh - I have serious doubts this is right... */ |
@@ -1587,7 +1587,7 @@ void em28xx_pre_card_setup(struct em28xx *dev) | |||
1587 | EM28XX_I2C_CLK_WAIT_ENABLE | | 1587 | EM28XX_I2C_CLK_WAIT_ENABLE | |
1588 | EM28XX_I2C_FREQ_100_KHZ); | 1588 | EM28XX_I2C_FREQ_100_KHZ); |
1589 | /* Turn on analog audio output */ | 1589 | /* Turn on analog audio output */ |
1590 | em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1); | 1590 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); |
1591 | break; | 1591 | break; |
1592 | 1592 | ||
1593 | case EM2860_BOARD_GADMEI_UTV330: | 1593 | case EM2860_BOARD_GADMEI_UTV330: |
@@ -1608,7 +1608,7 @@ void em28xx_pre_card_setup(struct em28xx *dev) | |||
1608 | EM28XX_I2C_CLK_WAIT_ENABLE | | 1608 | EM28XX_I2C_CLK_WAIT_ENABLE | |
1609 | EM28XX_I2C_FREQ_100_KHZ); | 1609 | EM28XX_I2C_FREQ_100_KHZ); |
1610 | /* enables audio for that device */ | 1610 | /* enables audio for that device */ |
1611 | em28xx_write_regs_req(dev, 0x00, 0x08, "\xfd", 1); | 1611 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xfd); |
1612 | break; | 1612 | break; |
1613 | 1613 | ||
1614 | case EM2874_BOARD_PINNACLE_PCTV_80E: | 1614 | case EM2874_BOARD_PINNACLE_PCTV_80E: |
@@ -1861,7 +1861,7 @@ void em28xx_card_setup(struct em28xx *dev) | |||
1861 | } | 1861 | } |
1862 | case EM2820_BOARD_KWORLD_PVRTV2800RF: | 1862 | case EM2820_BOARD_KWORLD_PVRTV2800RF: |
1863 | /* GPIO enables sound on KWORLD PVR TV 2800RF */ | 1863 | /* GPIO enables sound on KWORLD PVR TV 2800RF */ |
1864 | em28xx_write_regs_req(dev, 0x00, 0x08, "\xf9", 1); | 1864 | em28xx_write_reg(dev, EM28XX_R08_GPIO, 0xf9); |
1865 | break; | 1865 | break; |
1866 | case EM2820_BOARD_UNKNOWN: | 1866 | case EM2820_BOARD_UNKNOWN: |
1867 | case EM2800_BOARD_UNKNOWN: | 1867 | case EM2800_BOARD_UNKNOWN: |