提交 af399890 编写于 作者: L Linus Torvalds

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6:
  V4L/DVB (12564a): MAINTAINERS: Update gspca sn9c20x name style
  V4L/DVB (12502): gspca - sn9c20x: Fix gscpa sn9c20x build errors.
  V4L/DVB (12495): em28xx: Don't call em28xx_ir_init when disable_ir is true
  V4L/DVB (12457): zr364: wrong indexes
  V4L/DVB (12451): Update KConfig File to enable SDIO and USB interfaces
  V4L/DVB (12450): Siano: Fixed SDIO compilation bugs
  V4L/DVB (12449): adds webcam for Micron device MT9M111 0x143A to em28xx
  V4L/DVB (12446): sms1xxx: restore GPIO functionality for all Hauppauge devices
...@@ -2239,8 +2239,7 @@ S: Maintained ...@@ -2239,8 +2239,7 @@ S: Maintained
F: drivers/media/video/gspca/pac207.c F: drivers/media/video/gspca/pac207.c
GSPCA SN9C20X SUBDRIVER GSPCA SN9C20X SUBDRIVER
P: Brian Johnson M: Brian Johnson <brijohn@gmail.com>
M: brijohn@gmail.com
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
S: Maintained S: Maintained
......
...@@ -2,25 +2,33 @@ ...@@ -2,25 +2,33 @@
# Siano Mobile Silicon Digital TV device configuration # Siano Mobile Silicon Digital TV device configuration
# #
config DVB_SIANO_SMS1XXX config SMS_SIANO_MDTV
tristate "Siano SMS1XXX USB dongle support" tristate "Siano SMS1xxx based MDTV receiver"
depends on DVB_CORE && USB && INPUT depends on DVB_CORE && INPUT
---help--- ---help---
Choose Y here if you have a USB dongle with a SMS1XXX chipset. Choose Y or M here if you have MDTV receiver with a Siano chipset.
To compile this driver as a module, choose M here: the To compile this driver as a module, choose M here
module will be called sms1xxx. (The module will be called smsmdtv).
config DVB_SIANO_SMS1XXX_SMS_IDS Further documentation on this driver can be found on the WWW
bool "Enable support for Siano Mobile Silicon default USB IDs" at http://www.siano-ms.com/
depends on DVB_SIANO_SMS1XXX
default y if SMS_SIANO_MDTV
---help--- menu "Siano module components"
Choose Y here if you have a USB dongle with a SMS1XXX chipset
that uses Siano Mobile Silicon's default usb vid:pid.
Choose N here if you would prefer to use Siano's external driver. # Hardware interfaces support
Further documentation on this driver can be found on the WWW at config SMS_USB_DRV
<http://www.siano-ms.com/>. tristate "USB interface support"
depends on DVB_CORE && USB
---help---
Choose if you would like to have Siano's support for USB interface
config SMS_SDIO_DRV
tristate "SDIO interface support"
depends on DVB_CORE && MMC
---help---
Choose if you would like to have Siano's support for SDIO interface
endmenu
endif # SMS_SIANO_MDTV
sms1xxx-objs := smscoreapi.o sms-cards.o smsendian.o smsir.o
obj-$(CONFIG_DVB_SIANO_SMS1XXX) += sms1xxx.o smsmdtv-objs := smscoreapi.o sms-cards.o smsendian.o smsir.o
obj-$(CONFIG_DVB_SIANO_SMS1XXX) += smsusb.o
obj-$(CONFIG_DVB_SIANO_SMS1XXX) += smsdvb.o obj-$(CONFIG_SMS_SIANO_MDTV) += smsmdtv.o smsdvb.o
obj-$(CONFIG_SMS_USB_DRV) += smsusb.o
obj-$(CONFIG_SMS_SDIO_DRV) += smssdio.o
EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
......
...@@ -325,6 +325,16 @@ static int smsdvb_sendrequest_and_wait(struct smsdvb_client_t *client, ...@@ -325,6 +325,16 @@ static int smsdvb_sendrequest_and_wait(struct smsdvb_client_t *client,
0 : -ETIME; 0 : -ETIME;
} }
static inline int led_feedback(struct smsdvb_client_t *client)
{
if (client->fe_status & FE_HAS_LOCK)
return sms_board_led_feedback(client->coredev,
(client->sms_stat_dvb.ReceptionData.BER
== 0) ? SMS_LED_HI : SMS_LED_LO);
else
return sms_board_led_feedback(client->coredev, SMS_LED_OFF);
}
static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat) static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat)
{ {
struct smsdvb_client_t *client; struct smsdvb_client_t *client;
...@@ -332,6 +342,8 @@ static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat) ...@@ -332,6 +342,8 @@ static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat)
*stat = client->fe_status; *stat = client->fe_status;
led_feedback(client);
return 0; return 0;
} }
...@@ -342,6 +354,8 @@ static int smsdvb_read_ber(struct dvb_frontend *fe, u32 *ber) ...@@ -342,6 +354,8 @@ static int smsdvb_read_ber(struct dvb_frontend *fe, u32 *ber)
*ber = client->sms_stat_dvb.ReceptionData.BER; *ber = client->sms_stat_dvb.ReceptionData.BER;
led_feedback(client);
return 0; return 0;
} }
...@@ -359,6 +373,8 @@ static int smsdvb_read_signal_strength(struct dvb_frontend *fe, u16 *strength) ...@@ -359,6 +373,8 @@ static int smsdvb_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
(client->sms_stat_dvb.ReceptionData.InBandPwr (client->sms_stat_dvb.ReceptionData.InBandPwr
+ 95) * 3 / 2; + 95) * 3 / 2;
led_feedback(client);
return 0; return 0;
} }
...@@ -369,6 +385,8 @@ static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr) ...@@ -369,6 +385,8 @@ static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr)
*snr = client->sms_stat_dvb.ReceptionData.SNR; *snr = client->sms_stat_dvb.ReceptionData.SNR;
led_feedback(client);
return 0; return 0;
} }
...@@ -379,6 +397,8 @@ static int smsdvb_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks) ...@@ -379,6 +397,8 @@ static int smsdvb_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
*ucblocks = client->sms_stat_dvb.ReceptionData.ErrorTSPackets; *ucblocks = client->sms_stat_dvb.ReceptionData.ErrorTSPackets;
led_feedback(client);
return 0; return 0;
} }
...@@ -404,6 +424,8 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe, ...@@ -404,6 +424,8 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe,
u32 Data[3]; u32 Data[3];
} Msg; } Msg;
int ret;
client->fe_status = FE_HAS_SIGNAL; client->fe_status = FE_HAS_SIGNAL;
client->event_fe_state = -1; client->event_fe_state = -1;
client->event_unc_state = -1; client->event_unc_state = -1;
...@@ -426,6 +448,23 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe, ...@@ -426,6 +448,23 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe,
case BANDWIDTH_AUTO: return -EOPNOTSUPP; case BANDWIDTH_AUTO: return -EOPNOTSUPP;
default: return -EINVAL; default: return -EINVAL;
} }
/* Disable LNA, if any. An error is returned if no LNA is present */
ret = sms_board_lna_control(client->coredev, 0);
if (ret == 0) {
fe_status_t status;
/* tune with LNA off at first */
ret = smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg),
&client->tune_done);
smsdvb_read_status(fe, &status);
if (status & FE_HAS_LOCK)
return ret;
/* previous tune didnt lock - enable LNA and tune again */
sms_board_lna_control(client->coredev, 1);
}
return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg),
&client->tune_done); &client->tune_done);
...@@ -451,6 +490,8 @@ static int smsdvb_init(struct dvb_frontend *fe) ...@@ -451,6 +490,8 @@ static int smsdvb_init(struct dvb_frontend *fe)
struct smsdvb_client_t *client = struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend); container_of(fe, struct smsdvb_client_t, frontend);
sms_board_power(client->coredev, 1);
sms_board_dvb3_event(client, DVB3_EVENT_INIT); sms_board_dvb3_event(client, DVB3_EVENT_INIT);
return 0; return 0;
} }
...@@ -460,6 +501,9 @@ static int smsdvb_sleep(struct dvb_frontend *fe) ...@@ -460,6 +501,9 @@ static int smsdvb_sleep(struct dvb_frontend *fe)
struct smsdvb_client_t *client = struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend); container_of(fe, struct smsdvb_client_t, frontend);
sms_board_led_feedback(client->coredev, SMS_LED_OFF);
sms_board_power(client->coredev, 0);
sms_board_dvb3_event(client, DVB3_EVENT_SLEEP); sms_board_dvb3_event(client, DVB3_EVENT_SLEEP);
return 0; return 0;
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
#define SMSSDIO_DATA 0x00 #define SMSSDIO_DATA 0x00
#define SMSSDIO_INT 0x04 #define SMSSDIO_INT 0x04
#define SMSSDIO_BLOCK_SIZE 128
static const struct sdio_device_id smssdio_ids[] = { static const struct sdio_device_id smssdio_ids[] = {
{SDIO_DEVICE(SDIO_VENDOR_ID_SIANO, SDIO_DEVICE_ID_SIANO_STELLAR), {SDIO_DEVICE(SDIO_VENDOR_ID_SIANO, SDIO_DEVICE_ID_SIANO_STELLAR),
...@@ -85,7 +86,8 @@ static int smssdio_sendrequest(void *context, void *buffer, size_t size) ...@@ -85,7 +86,8 @@ static int smssdio_sendrequest(void *context, void *buffer, size_t size)
sdio_claim_host(smsdev->func); sdio_claim_host(smsdev->func);
while (size >= smsdev->func->cur_blksize) { while (size >= smsdev->func->cur_blksize) {
ret = sdio_write_blocks(smsdev->func, SMSSDIO_DATA, buffer, 1); ret = sdio_memcpy_toio(smsdev->func, SMSSDIO_DATA,
buffer, smsdev->func->cur_blksize);
if (ret) if (ret)
goto out; goto out;
...@@ -94,8 +96,8 @@ static int smssdio_sendrequest(void *context, void *buffer, size_t size) ...@@ -94,8 +96,8 @@ static int smssdio_sendrequest(void *context, void *buffer, size_t size)
} }
if (size) { if (size) {
ret = sdio_write_bytes(smsdev->func, SMSSDIO_DATA, ret = sdio_memcpy_toio(smsdev->func, SMSSDIO_DATA,
buffer, size); buffer, size);
} }
out: out:
...@@ -125,23 +127,23 @@ static void smssdio_interrupt(struct sdio_func *func) ...@@ -125,23 +127,23 @@ static void smssdio_interrupt(struct sdio_func *func)
*/ */
isr = sdio_readb(func, SMSSDIO_INT, &ret); isr = sdio_readb(func, SMSSDIO_INT, &ret);
if (ret) { if (ret) {
dev_err(&smsdev->func->dev, sms_err("Unable to read interrupt register!\n");
"Unable to read interrupt register!\n");
return; return;
} }
if (smsdev->split_cb == NULL) { if (smsdev->split_cb == NULL) {
cb = smscore_getbuffer(smsdev->coredev); cb = smscore_getbuffer(smsdev->coredev);
if (!cb) { if (!cb) {
dev_err(&smsdev->func->dev, sms_err("Unable to allocate data buffer!\n");
"Unable to allocate data buffer!\n");
return; return;
} }
ret = sdio_read_blocks(smsdev->func, cb->p, SMSSDIO_DATA, 1); ret = sdio_memcpy_fromio(smsdev->func,
cb->p,
SMSSDIO_DATA,
SMSSDIO_BLOCK_SIZE);
if (ret) { if (ret) {
dev_err(&smsdev->func->dev, sms_err("Error %d reading initial block!\n", ret);
"Error %d reading initial block!\n", ret);
return; return;
} }
...@@ -152,7 +154,10 @@ static void smssdio_interrupt(struct sdio_func *func) ...@@ -152,7 +154,10 @@ static void smssdio_interrupt(struct sdio_func *func)
return; return;
} }
size = hdr->msgLength - smsdev->func->cur_blksize; if (hdr->msgLength > smsdev->func->cur_blksize)
size = hdr->msgLength - smsdev->func->cur_blksize;
else
size = 0;
} else { } else {
cb = smsdev->split_cb; cb = smsdev->split_cb;
hdr = cb->p; hdr = cb->p;
...@@ -162,23 +167,24 @@ static void smssdio_interrupt(struct sdio_func *func) ...@@ -162,23 +167,24 @@ static void smssdio_interrupt(struct sdio_func *func)
smsdev->split_cb = NULL; smsdev->split_cb = NULL;
} }
if (hdr->msgLength > smsdev->func->cur_blksize) { if (size) {
void *buffer; void *buffer;
size = ALIGN(size, 128); buffer = cb->p + (hdr->msgLength - size);
buffer = cb->p + hdr->msgLength; size = ALIGN(size, SMSSDIO_BLOCK_SIZE);
BUG_ON(smsdev->func->cur_blksize != 128); BUG_ON(smsdev->func->cur_blksize != SMSSDIO_BLOCK_SIZE);
/* /*
* First attempt to transfer all of it in one go... * First attempt to transfer all of it in one go...
*/ */
ret = sdio_read_blocks(smsdev->func, buffer, ret = sdio_memcpy_fromio(smsdev->func,
SMSSDIO_DATA, size / 128); buffer,
SMSSDIO_DATA,
size);
if (ret && ret != -EINVAL) { if (ret && ret != -EINVAL) {
smscore_putbuffer(smsdev->coredev, cb); smscore_putbuffer(smsdev->coredev, cb);
dev_err(&smsdev->func->dev, sms_err("Error %d reading data from card!\n", ret);
"Error %d reading data from card!\n", ret);
return; return;
} }
...@@ -191,12 +197,12 @@ static void smssdio_interrupt(struct sdio_func *func) ...@@ -191,12 +197,12 @@ static void smssdio_interrupt(struct sdio_func *func)
*/ */
if (ret == -EINVAL) { if (ret == -EINVAL) {
while (size) { while (size) {
ret = sdio_read_blocks(smsdev->func, ret = sdio_memcpy_fromio(smsdev->func,
buffer, SMSSDIO_DATA, 1); buffer, SMSSDIO_DATA,
smsdev->func->cur_blksize);
if (ret) { if (ret) {
smscore_putbuffer(smsdev->coredev, cb); smscore_putbuffer(smsdev->coredev, cb);
dev_err(&smsdev->func->dev, sms_err("Error %d reading "
"Error %d reading "
"data from card!\n", ret); "data from card!\n", ret);
return; return;
} }
...@@ -269,7 +275,7 @@ static int smssdio_probe(struct sdio_func *func, ...@@ -269,7 +275,7 @@ static int smssdio_probe(struct sdio_func *func,
if (ret) if (ret)
goto release; goto release;
ret = sdio_set_block_size(func, 128); ret = sdio_set_block_size(func, SMSSDIO_BLOCK_SIZE);
if (ret) if (ret)
goto disable; goto disable;
......
...@@ -1730,6 +1730,25 @@ static inline void em28xx_set_model(struct em28xx *dev) ...@@ -1730,6 +1730,25 @@ static inline void em28xx_set_model(struct em28xx *dev)
EM28XX_I2C_FREQ_100_KHZ; EM28XX_I2C_FREQ_100_KHZ;
} }
/* FIXME: Should be replaced by a proper mt9m111 driver */
static int em28xx_initialize_mt9m111(struct em28xx *dev)
{
int i;
unsigned char regs[][3] = {
{ 0x0d, 0x00, 0x01, }, /* reset and use defaults */
{ 0x0d, 0x00, 0x00, },
{ 0x0a, 0x00, 0x21, },
{ 0x21, 0x04, 0x00, }, /* full readout speed, no row/col skipping */
};
for (i = 0; i < ARRAY_SIZE(regs); i++)
i2c_master_send(&dev->i2c_client, &regs[i][0], 3);
return 0;
}
/* FIXME: Should be replaced by a proper mt9m001 driver */ /* FIXME: Should be replaced by a proper mt9m001 driver */
static int em28xx_initialize_mt9m001(struct em28xx *dev) static int em28xx_initialize_mt9m001(struct em28xx *dev)
{ {
...@@ -1758,7 +1777,7 @@ static int em28xx_initialize_mt9m001(struct em28xx *dev) ...@@ -1758,7 +1777,7 @@ static int em28xx_initialize_mt9m001(struct em28xx *dev)
/* HINT method: webcam I2C chips /* HINT method: webcam I2C chips
* *
* This method work for webcams with Micron sensors * This method works for webcams with Micron sensors
*/ */
static int em28xx_hint_sensor(struct em28xx *dev) static int em28xx_hint_sensor(struct em28xx *dev)
{ {
...@@ -1804,6 +1823,23 @@ static int em28xx_hint_sensor(struct em28xx *dev) ...@@ -1804,6 +1823,23 @@ static int em28xx_hint_sensor(struct em28xx *dev)
dev->vinctl = 0x00; dev->vinctl = 0x00;
break; break;
case 0x143a: /* MT9M111 as found in the ECS G200 */
dev->model = EM2750_BOARD_UNKNOWN;
em28xx_set_model(dev);
sensor_name = "mt9m111";
dev->board.xclk = EM28XX_XCLK_FREQUENCY_48MHZ;
dev->em28xx_sensor = EM28XX_MT9M111;
em28xx_initialize_mt9m111(dev);
dev->sensor_xres = 640;
dev->sensor_yres = 512;
dev->vinmode = 0x0a;
dev->vinctl = 0x00;
break;
case 0x8431: case 0x8431:
dev->model = EM2750_BOARD_UNKNOWN; dev->model = EM2750_BOARD_UNKNOWN;
em28xx_set_model(dev); em28xx_set_model(dev);
...@@ -1820,7 +1856,7 @@ static int em28xx_hint_sensor(struct em28xx *dev) ...@@ -1820,7 +1856,7 @@ static int em28xx_hint_sensor(struct em28xx *dev)
break; break;
default: default:
printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version)); printk("Unknown Micron Sensor 0x%04x\n", version);
return -EINVAL; return -EINVAL;
} }
...@@ -2346,7 +2382,9 @@ void em28xx_card_setup(struct em28xx *dev) ...@@ -2346,7 +2382,9 @@ void em28xx_card_setup(struct em28xx *dev)
} }
em28xx_tuner_setup(dev); em28xx_tuner_setup(dev);
em28xx_ir_init(dev);
if(!disable_ir)
em28xx_ir_init(dev);
} }
......
...@@ -367,6 +367,7 @@ enum em28xx_sensor { ...@@ -367,6 +367,7 @@ enum em28xx_sensor {
EM28XX_NOSENSOR = 0, EM28XX_NOSENSOR = 0,
EM28XX_MT9V011, EM28XX_MT9V011,
EM28XX_MT9M001, EM28XX_MT9M001,
EM28XX_MT9M111,
}; };
enum em28xx_adecoder { enum em28xx_adecoder {
......
...@@ -114,7 +114,7 @@ config USB_GSPCA_SN9C20X ...@@ -114,7 +114,7 @@ config USB_GSPCA_SN9C20X
config USB_GSPCA_SN9C20X_EVDEV config USB_GSPCA_SN9C20X_EVDEV
bool "Enable evdev support" bool "Enable evdev support"
depends on USB_GSPCA_SN9C20X depends on USB_GSPCA_SN9C20X && INPUT
---help--- ---help---
Say Y here in order to enable evdev support for sn9c20x webcam button. Say Y here in order to enable evdev support for sn9c20x webcam button.
......
...@@ -695,7 +695,7 @@ static int zr364xx_release(struct file *file) ...@@ -695,7 +695,7 @@ static int zr364xx_release(struct file *file)
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
err = err =
send_control_msg(udev, 1, init[cam->method][i].value, send_control_msg(udev, 1, init[cam->method][i].value,
0, init[i][cam->method].bytes, 0, init[cam->method][i].bytes,
init[cam->method][i].size); init[cam->method][i].size);
if (err < 0) { if (err < 0) {
dev_err(&udev->dev, "error during release sequence\n"); dev_err(&udev->dev, "error during release sequence\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册