diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2012-08-07 11:43:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-12 06:58:54 -0400 |
commit | 518c267f4ca4c45cc51bd582b4aef9f0b9f01eba (patch) | |
tree | 5d60d16011c1f53bbd126375531288ea4da66302 | |
parent | b17d39453b40730cbfdb2cab9565f8ba8627b7f8 (diff) |
[media] saa7164: use native print_hex_dump() instead of custom one
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/saa7164/saa7164-api.c | 15 | ||||
-rw-r--r-- | drivers/media/video/saa7164/saa7164-core.c | 46 | ||||
-rw-r--r-- | drivers/media/video/saa7164/saa7164.h | 1 |
3 files changed, 14 insertions, 48 deletions
diff --git a/drivers/media/video/saa7164/saa7164-api.c b/drivers/media/video/saa7164/saa7164-api.c index c8799fdaae67..eff7135cf0e8 100644 --- a/drivers/media/video/saa7164/saa7164-api.c +++ b/drivers/media/video/saa7164/saa7164-api.c | |||
@@ -670,7 +670,8 @@ int saa7164_api_set_dif(struct saa7164_port *port, u8 reg, u8 val) | |||
670 | if (ret != SAA_OK) | 670 | if (ret != SAA_OK) |
671 | printk(KERN_ERR "%s() error, ret(2) = 0x%x\n", __func__, ret); | 671 | printk(KERN_ERR "%s() error, ret(2) = 0x%x\n", __func__, ret); |
672 | #if 0 | 672 | #if 0 |
673 | saa7164_dumphex16(dev, buf, 16); | 673 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1, buf, 16, |
674 | false); | ||
674 | #endif | 675 | #endif |
675 | return ret == SAA_OK ? 0 : -EIO; | 676 | return ret == SAA_OK ? 0 : -EIO; |
676 | } | 677 | } |
@@ -1352,7 +1353,8 @@ int saa7164_api_enum_subdevs(struct saa7164_dev *dev) | |||
1352 | } | 1353 | } |
1353 | 1354 | ||
1354 | if (saa_debug & DBGLVL_API) | 1355 | if (saa_debug & DBGLVL_API) |
1355 | saa7164_dumphex16(dev, buf, (buflen/16)*16); | 1356 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1, buf, |
1357 | buflen & ~15, false); | ||
1356 | 1358 | ||
1357 | saa7164_api_dump_subdevs(dev, buf, buflen); | 1359 | saa7164_api_dump_subdevs(dev, buf, buflen); |
1358 | 1360 | ||
@@ -1403,7 +1405,8 @@ int saa7164_api_i2c_read(struct saa7164_i2c *bus, u8 addr, u32 reglen, u8 *reg, | |||
1403 | dprintk(DBGLVL_API, "%s() len = %d bytes\n", __func__, len); | 1405 | dprintk(DBGLVL_API, "%s() len = %d bytes\n", __func__, len); |
1404 | 1406 | ||
1405 | if (saa_debug & DBGLVL_I2C) | 1407 | if (saa_debug & DBGLVL_I2C) |
1406 | saa7164_dumphex16(dev, buf, 2 * 16); | 1408 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1, buf, |
1409 | 32, false); | ||
1407 | 1410 | ||
1408 | ret = saa7164_cmd_send(bus->dev, unitid, GET_CUR, | 1411 | ret = saa7164_cmd_send(bus->dev, unitid, GET_CUR, |
1409 | EXU_REGISTER_ACCESS_CONTROL, len, &buf); | 1412 | EXU_REGISTER_ACCESS_CONTROL, len, &buf); |
@@ -1411,7 +1414,8 @@ int saa7164_api_i2c_read(struct saa7164_i2c *bus, u8 addr, u32 reglen, u8 *reg, | |||
1411 | printk(KERN_ERR "%s() error, ret(2) = 0x%x\n", __func__, ret); | 1414 | printk(KERN_ERR "%s() error, ret(2) = 0x%x\n", __func__, ret); |
1412 | else { | 1415 | else { |
1413 | if (saa_debug & DBGLVL_I2C) | 1416 | if (saa_debug & DBGLVL_I2C) |
1414 | saa7164_dumphex16(dev, buf, sizeof(buf)); | 1417 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1, |
1418 | buf, sizeof(buf), false); | ||
1415 | memcpy(data, (buf + 2 * sizeof(u32) + reglen), datalen); | 1419 | memcpy(data, (buf + 2 * sizeof(u32) + reglen), datalen); |
1416 | } | 1420 | } |
1417 | 1421 | ||
@@ -1471,7 +1475,8 @@ int saa7164_api_i2c_write(struct saa7164_i2c *bus, u8 addr, u32 datalen, | |||
1471 | memcpy((buf + 2 * sizeof(u32)), data, datalen); | 1475 | memcpy((buf + 2 * sizeof(u32)), data, datalen); |
1472 | 1476 | ||
1473 | if (saa_debug & DBGLVL_I2C) | 1477 | if (saa_debug & DBGLVL_I2C) |
1474 | saa7164_dumphex16(dev, buf, sizeof(buf)); | 1478 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1, |
1479 | buf, sizeof(buf), false); | ||
1475 | 1480 | ||
1476 | ret = saa7164_cmd_send(bus->dev, unitid, SET_CUR, | 1481 | ret = saa7164_cmd_send(bus->dev, unitid, SET_CUR, |
1477 | EXU_REGISTER_ACCESS_CONTROL, len, &buf); | 1482 | EXU_REGISTER_ACCESS_CONTROL, len, &buf); |
diff --git a/drivers/media/video/saa7164/saa7164-core.c b/drivers/media/video/saa7164/saa7164-core.c index 3b7d7b4e3034..2c9ad878bef3 100644 --- a/drivers/media/video/saa7164/saa7164-core.c +++ b/drivers/media/video/saa7164/saa7164-core.c | |||
@@ -92,28 +92,6 @@ LIST_HEAD(saa7164_devlist); | |||
92 | 92 | ||
93 | #define INT_SIZE 16 | 93 | #define INT_SIZE 16 |
94 | 94 | ||
95 | void saa7164_dumphex16FF(struct saa7164_dev *dev, u8 *buf, int len) | ||
96 | { | ||
97 | int i; | ||
98 | u8 tmp[16]; | ||
99 | memset(&tmp[0], 0xff, sizeof(tmp)); | ||
100 | |||
101 | printk(KERN_INFO "--------------------> " | ||
102 | "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f\n"); | ||
103 | |||
104 | for (i = 0; i < len; i += 16) { | ||
105 | if (memcmp(&tmp, buf + i, sizeof(tmp)) != 0) { | ||
106 | printk(KERN_INFO " [0x%08x] " | ||
107 | "%02x %02x %02x %02x %02x %02x %02x %02x " | ||
108 | "%02x %02x %02x %02x %02x %02x %02x %02x\n", i, | ||
109 | *(buf+i+0), *(buf+i+1), *(buf+i+2), *(buf+i+3), | ||
110 | *(buf+i+4), *(buf+i+5), *(buf+i+6), *(buf+i+7), | ||
111 | *(buf+i+8), *(buf+i+9), *(buf+i+10), *(buf+i+11), | ||
112 | *(buf+i+12), *(buf+i+13), *(buf+i+14), *(buf+i+15)); | ||
113 | } | ||
114 | } | ||
115 | } | ||
116 | |||
117 | static void saa7164_pack_verifier(struct saa7164_buffer *buf) | 95 | static void saa7164_pack_verifier(struct saa7164_buffer *buf) |
118 | { | 96 | { |
119 | u8 *p = (u8 *)buf->cpu; | 97 | u8 *p = (u8 *)buf->cpu; |
@@ -125,7 +103,8 @@ static void saa7164_pack_verifier(struct saa7164_buffer *buf) | |||
125 | (*(p + i + 2) != 0x01) || (*(p + i + 3) != 0xBA)) { | 103 | (*(p + i + 2) != 0x01) || (*(p + i + 3) != 0xBA)) { |
126 | printk(KERN_ERR "No pack at 0x%x\n", i); | 104 | printk(KERN_ERR "No pack at 0x%x\n", i); |
127 | #if 0 | 105 | #if 0 |
128 | saa7164_dumphex16FF(buf->port->dev, (p + i), 32); | 106 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1, |
107 | p + 1, 32, false); | ||
129 | #endif | 108 | #endif |
130 | } | 109 | } |
131 | } | 110 | } |
@@ -316,7 +295,8 @@ static void saa7164_work_enchandler_helper(struct saa7164_port *port, int bufnr) | |||
316 | printk(KERN_ERR "%s() buf %p guard buffer breach\n", | 295 | printk(KERN_ERR "%s() buf %p guard buffer breach\n", |
317 | __func__, buf); | 296 | __func__, buf); |
318 | #if 0 | 297 | #if 0 |
319 | saa7164_dumphex16FF(dev, (p + buf->actual_size) - 32 , 64); | 298 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1, |
299 | p + buf->actual_size - 32, 64, false); | ||
320 | #endif | 300 | #endif |
321 | } | 301 | } |
322 | } | 302 | } |
@@ -777,24 +757,6 @@ u32 saa7164_getcurrentfirmwareversion(struct saa7164_dev *dev) | |||
777 | } | 757 | } |
778 | 758 | ||
779 | /* TODO: Debugging func, remove */ | 759 | /* TODO: Debugging func, remove */ |
780 | void saa7164_dumphex16(struct saa7164_dev *dev, u8 *buf, int len) | ||
781 | { | ||
782 | int i; | ||
783 | |||
784 | printk(KERN_INFO "--------------------> " | ||
785 | "00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f\n"); | ||
786 | |||
787 | for (i = 0; i < len; i += 16) | ||
788 | printk(KERN_INFO " [0x%08x] " | ||
789 | "%02x %02x %02x %02x %02x %02x %02x %02x " | ||
790 | "%02x %02x %02x %02x %02x %02x %02x %02x\n", i, | ||
791 | *(buf+i+0), *(buf+i+1), *(buf+i+2), *(buf+i+3), | ||
792 | *(buf+i+4), *(buf+i+5), *(buf+i+6), *(buf+i+7), | ||
793 | *(buf+i+8), *(buf+i+9), *(buf+i+10), *(buf+i+11), | ||
794 | *(buf+i+12), *(buf+i+13), *(buf+i+14), *(buf+i+15)); | ||
795 | } | ||
796 | |||
797 | /* TODO: Debugging func, remove */ | ||
798 | void saa7164_dumpregs(struct saa7164_dev *dev, u32 addr) | 760 | void saa7164_dumpregs(struct saa7164_dev *dev, u32 addr) |
799 | { | 761 | { |
800 | int i; | 762 | int i; |
diff --git a/drivers/media/video/saa7164/saa7164.h b/drivers/media/video/saa7164/saa7164.h index 35219b9b0fbc..437284e747c9 100644 --- a/drivers/media/video/saa7164/saa7164.h +++ b/drivers/media/video/saa7164/saa7164.h | |||
@@ -484,7 +484,6 @@ extern unsigned int vbi_buffers; | |||
484 | /* ----------------------------------------------------------- */ | 484 | /* ----------------------------------------------------------- */ |
485 | /* saa7164-core.c */ | 485 | /* saa7164-core.c */ |
486 | void saa7164_dumpregs(struct saa7164_dev *dev, u32 addr); | 486 | void saa7164_dumpregs(struct saa7164_dev *dev, u32 addr); |
487 | void saa7164_dumphex16(struct saa7164_dev *dev, u8 *buf, int len); | ||
488 | void saa7164_getfirmwarestatus(struct saa7164_dev *dev); | 487 | void saa7164_getfirmwarestatus(struct saa7164_dev *dev); |
489 | u32 saa7164_getcurrentfirmwareversion(struct saa7164_dev *dev); | 488 | u32 saa7164_getcurrentfirmwareversion(struct saa7164_dev *dev); |
490 | void saa7164_histogram_update(struct saa7164_histogram *hg, u32 val); | 489 | void saa7164_histogram_update(struct saa7164_histogram *hg, u32 val); |