forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/ke…
…rnel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab: - dvb core: there is a regression found when used with xine. For whatever unknown reason, xine (and xine-lib clients) wants that the frontend to tell what frequency he is using even before the PLL lock (or at least, it expects a non-zero frequency). On DVB, the frequency is only actually known after a frequency zig-zag seek, done by the DVB core. Anyway, the fix was trivial. That solves Fedora BZ#808871. - ivtv: fix a regression when selecting the language channel - uvc: fix a race-related crash - it913x: fixes firmware loading - two trivial patches (a dependency issue at a radio driver at sound Kconfig, and a warning fix on dvb). * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: [media] uvcvideo: Fix race-related crash in uvc_video_clock_update() [media] Drivers/media/radio: Fix build error [media] dvb_frontend: fix compiler warning [media] it913x: fix firmware loading errors [media] ivtv: Fix AUDIO_(BILINGUAL_)CHANNEL_SELECT regression [media] dvb_frontend: regression fix: userspace ABI broken for xine
- Loading branch information
Showing
5 changed files
with
87 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -238,12 +238,27 @@ static int it913x_read_reg(struct usb_device *udev, u32 reg) | |
|
||
static u32 it913x_query(struct usb_device *udev, u8 pro) | ||
{ | ||
int ret; | ||
int ret, i; | ||
u8 data[4]; | ||
ret = it913x_io(udev, READ_LONG, pro, CMD_DEMOD_READ, | ||
0x1222, 0, &data[0], 3); | ||
u8 ver; | ||
|
||
for (i = 0; i < 5; i++) { | ||
ret = it913x_io(udev, READ_LONG, pro, CMD_DEMOD_READ, | ||
0x1222, 0, &data[0], 3); | ||
ver = data[0]; | ||
if (ver > 0 && ver < 3) | ||
break; | ||
msleep(100); | ||
} | ||
|
||
it913x_config.chip_ver = data[0]; | ||
if (ver < 1 || ver > 2) { | ||
info("Failed to identify chip version applying 1"); | ||
it913x_config.chip_ver = 0x1; | ||
it913x_config.chip_type = 0x9135; | ||
return 0; | ||
} | ||
|
||
it913x_config.chip_ver = ver; | ||
it913x_config.chip_type = (u16)(data[2] << 8) + data[1]; | ||
|
||
info("Chip Version=%02x Chip Type=%04x", it913x_config.chip_ver, | ||
|
@@ -660,30 +675,41 @@ static int it913x_download_firmware(struct usb_device *udev, | |
if ((packet_size > min_pkt) || (i == fw->size)) { | ||
fw_data = (u8 *)(fw->data + pos); | ||
pos += packet_size; | ||
if (packet_size > 0) | ||
ret |= it913x_io(udev, WRITE_DATA, | ||
if (packet_size > 0) { | ||
ret = it913x_io(udev, WRITE_DATA, | ||
DEV_0, CMD_SCATTER_WRITE, 0, | ||
0, fw_data, packet_size); | ||
if (ret < 0) | ||
break; | ||
} | ||
udelay(1000); | ||
} | ||
} | ||
i++; | ||
} | ||
|
||
ret |= it913x_io(udev, WRITE_CMD, DEV_0, CMD_BOOT, 0, 0, NULL, 0); | ||
|
||
msleep(100); | ||
|
||
if (ret < 0) | ||
info("FRM Firmware Download Failed (%04x)" , ret); | ||
info("FRM Firmware Download Failed (%d)" , ret); | ||
else | ||
info("FRM Firmware Download Completed - Resetting Device"); | ||
|
||
ret |= it913x_return_status(udev); | ||
msleep(30); | ||
|
||
ret = it913x_io(udev, WRITE_CMD, DEV_0, CMD_BOOT, 0, 0, NULL, 0); | ||
if (ret < 0) | ||
info("FRM Device not responding to reboot"); | ||
|
||
ret = it913x_return_status(udev); | ||
if (ret == 0) { | ||
info("FRM Failed to reboot device"); | ||
return -ENODEV; | ||
} | ||
|
||
msleep(30); | ||
|
||
ret |= it913x_wr_reg(udev, DEV_0, I2C_CLK, I2C_CLK_400); | ||
ret = it913x_wr_reg(udev, DEV_0, I2C_CLK, I2C_CLK_400); | ||
|
||
msleep(30); | ||
|
||
/* Tuner function */ | ||
if (it913x_config.dual_mode) | ||
|
@@ -901,5 +927,5 @@ module_usb_driver(it913x_driver); | |
|
||
MODULE_AUTHOR("Malcolm Priestley <[email protected]>"); | ||
MODULE_DESCRIPTION("it913x USB 2 Driver"); | ||
MODULE_VERSION("1.27"); | ||
MODULE_VERSION("1.28"); | ||
MODULE_LICENSE("GPL"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters