Skip to content

Commit

Permalink
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Sep 1, 2009
2 parents 1a37f18 + d95c5b0 commit af39989
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 51 deletions.
3 changes: 1 addition & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2239,8 +2239,7 @@ S: Maintained
F: drivers/media/video/gspca/pac207.c

GSPCA SN9C20X SUBDRIVER
P: Brian Johnson
M: brijohn@gmail.com
M: Brian Johnson <brijohn@gmail.com>
L: linux-media@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
S: Maintained
Expand Down
40 changes: 24 additions & 16 deletions drivers/media/dvb/siano/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,33 @@
# Siano Mobile Silicon Digital TV device configuration
#

config DVB_SIANO_SMS1XXX
tristate "Siano SMS1XXX USB dongle support"
depends on DVB_CORE && USB && INPUT
config SMS_SIANO_MDTV
tristate "Siano SMS1xxx based MDTV receiver"
depends on DVB_CORE && INPUT
---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
module will be called sms1xxx.
To compile this driver as a module, choose M here
(The module will be called smsmdtv).

config DVB_SIANO_SMS1XXX_SMS_IDS
bool "Enable support for Siano Mobile Silicon default USB IDs"
depends on DVB_SIANO_SMS1XXX
default y
---help---
Choose Y here if you have a USB dongle with a SMS1XXX chipset
that uses Siano Mobile Silicon's default usb vid:pid.
Further documentation on this driver can be found on the WWW
at http://www.siano-ms.com/

if SMS_SIANO_MDTV
menu "Siano module components"

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
<http://www.siano-ms.com/>.
config SMS_USB_DRV
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
9 changes: 5 additions & 4 deletions drivers/media/dvb/siano/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
sms1xxx-objs := smscoreapi.o sms-cards.o smsendian.o smsir.o

obj-$(CONFIG_DVB_SIANO_SMS1XXX) += sms1xxx.o
obj-$(CONFIG_DVB_SIANO_SMS1XXX) += smsusb.o
obj-$(CONFIG_DVB_SIANO_SMS1XXX) += smsdvb.o
smsmdtv-objs := smscoreapi.o sms-cards.o smsendian.o smsir.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

Expand Down
44 changes: 44 additions & 0 deletions drivers/media/dvb/siano/smsdvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,25 @@ static int smsdvb_sendrequest_and_wait(struct smsdvb_client_t *client,
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)
{
struct smsdvb_client_t *client;
client = container_of(fe, struct smsdvb_client_t, frontend);

*stat = client->fe_status;

led_feedback(client);

return 0;
}

Expand All @@ -342,6 +354,8 @@ static int smsdvb_read_ber(struct dvb_frontend *fe, u32 *ber)

*ber = client->sms_stat_dvb.ReceptionData.BER;

led_feedback(client);

return 0;
}

Expand All @@ -359,6 +373,8 @@ static int smsdvb_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
(client->sms_stat_dvb.ReceptionData.InBandPwr
+ 95) * 3 / 2;

led_feedback(client);

return 0;
}

Expand All @@ -369,6 +385,8 @@ static int smsdvb_read_snr(struct dvb_frontend *fe, u16 *snr)

*snr = client->sms_stat_dvb.ReceptionData.SNR;

led_feedback(client);

return 0;
}

Expand All @@ -379,6 +397,8 @@ static int smsdvb_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)

*ucblocks = client->sms_stat_dvb.ReceptionData.ErrorTSPackets;

led_feedback(client);

return 0;
}

Expand All @@ -404,6 +424,8 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe,
u32 Data[3];
} Msg;

int ret;

client->fe_status = FE_HAS_SIGNAL;
client->event_fe_state = -1;
client->event_unc_state = -1;
Expand All @@ -426,6 +448,23 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe,
case BANDWIDTH_AUTO: return -EOPNOTSUPP;
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),
&client->tune_done);
Expand All @@ -451,6 +490,8 @@ static int smsdvb_init(struct dvb_frontend *fe)
struct smsdvb_client_t *client =
container_of(fe, struct smsdvb_client_t, frontend);

sms_board_power(client->coredev, 1);

sms_board_dvb3_event(client, DVB3_EVENT_INIT);
return 0;
}
Expand All @@ -460,6 +501,9 @@ static int smsdvb_sleep(struct dvb_frontend *fe)
struct smsdvb_client_t *client =
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);

return 0;
Expand Down
54 changes: 30 additions & 24 deletions drivers/media/dvb/siano/smssdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@

#define SMSSDIO_DATA 0x00
#define SMSSDIO_INT 0x04
#define SMSSDIO_BLOCK_SIZE 128

static const struct sdio_device_id smssdio_ids[] = {
{SDIO_DEVICE(SDIO_VENDOR_ID_SIANO, SDIO_DEVICE_ID_SIANO_STELLAR),
Expand Down Expand Up @@ -85,7 +86,8 @@ static int smssdio_sendrequest(void *context, void *buffer, size_t size)
sdio_claim_host(smsdev->func);

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)
goto out;

Expand All @@ -94,8 +96,8 @@ static int smssdio_sendrequest(void *context, void *buffer, size_t size)
}

if (size) {
ret = sdio_write_bytes(smsdev->func, SMSSDIO_DATA,
buffer, size);
ret = sdio_memcpy_toio(smsdev->func, SMSSDIO_DATA,
buffer, size);
}

out:
Expand Down Expand Up @@ -125,23 +127,23 @@ static void smssdio_interrupt(struct sdio_func *func)
*/
isr = sdio_readb(func, SMSSDIO_INT, &ret);
if (ret) {
dev_err(&smsdev->func->dev,
"Unable to read interrupt register!\n");
sms_err("Unable to read interrupt register!\n");
return;
}

if (smsdev->split_cb == NULL) {
cb = smscore_getbuffer(smsdev->coredev);
if (!cb) {
dev_err(&smsdev->func->dev,
"Unable to allocate data buffer!\n");
sms_err("Unable to allocate data buffer!\n");
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) {
dev_err(&smsdev->func->dev,
"Error %d reading initial block!\n", ret);
sms_err("Error %d reading initial block!\n", ret);
return;
}

Expand All @@ -152,7 +154,10 @@ static void smssdio_interrupt(struct sdio_func *func)
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 {
cb = smsdev->split_cb;
hdr = cb->p;
Expand All @@ -162,23 +167,24 @@ static void smssdio_interrupt(struct sdio_func *func)
smsdev->split_cb = NULL;
}

if (hdr->msgLength > smsdev->func->cur_blksize) {
if (size) {
void *buffer;

size = ALIGN(size, 128);
buffer = cb->p + hdr->msgLength;
buffer = cb->p + (hdr->msgLength - size);
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...
*/
ret = sdio_read_blocks(smsdev->func, buffer,
SMSSDIO_DATA, size / 128);
ret = sdio_memcpy_fromio(smsdev->func,
buffer,
SMSSDIO_DATA,
size);
if (ret && ret != -EINVAL) {
smscore_putbuffer(smsdev->coredev, cb);
dev_err(&smsdev->func->dev,
"Error %d reading data from card!\n", ret);
sms_err("Error %d reading data from card!\n", ret);
return;
}

Expand All @@ -191,12 +197,12 @@ static void smssdio_interrupt(struct sdio_func *func)
*/
if (ret == -EINVAL) {
while (size) {
ret = sdio_read_blocks(smsdev->func,
buffer, SMSSDIO_DATA, 1);
ret = sdio_memcpy_fromio(smsdev->func,
buffer, SMSSDIO_DATA,
smsdev->func->cur_blksize);
if (ret) {
smscore_putbuffer(smsdev->coredev, cb);
dev_err(&smsdev->func->dev,
"Error %d reading "
sms_err("Error %d reading "
"data from card!\n", ret);
return;
}
Expand Down Expand Up @@ -269,7 +275,7 @@ static int smssdio_probe(struct sdio_func *func,
if (ret)
goto release;

ret = sdio_set_block_size(func, 128);
ret = sdio_set_block_size(func, SMSSDIO_BLOCK_SIZE);
if (ret)
goto disable;

Expand Down
44 changes: 41 additions & 3 deletions drivers/media/video/em28xx/em28xx-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -1730,6 +1730,25 @@ static inline void em28xx_set_model(struct em28xx *dev)
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 */
static int em28xx_initialize_mt9m001(struct em28xx *dev)
{
Expand Down Expand Up @@ -1758,7 +1777,7 @@ static int em28xx_initialize_mt9m001(struct em28xx *dev)

/* 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)
{
Expand Down Expand Up @@ -1804,6 +1823,23 @@ static int em28xx_hint_sensor(struct em28xx *dev)
dev->vinctl = 0x00;

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:
dev->model = EM2750_BOARD_UNKNOWN;
em28xx_set_model(dev);
Expand All @@ -1820,7 +1856,7 @@ static int em28xx_hint_sensor(struct em28xx *dev)

break;
default:
printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version));
printk("Unknown Micron Sensor 0x%04x\n", version);
return -EINVAL;
}

Expand Down Expand Up @@ -2346,7 +2382,9 @@ void em28xx_card_setup(struct em28xx *dev)
}

em28xx_tuner_setup(dev);
em28xx_ir_init(dev);

if(!disable_ir)
em28xx_ir_init(dev);
}


Expand Down
Loading

0 comments on commit af39989

Please sign in to comment.