Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306539
b: refs/heads/master
c: 9554d57
h: refs/heads/master
i:
  306537: 0ef3a0c
  306535: ba8617c
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed May 20, 2012
1 parent abeae1f commit 2508b8a
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 408 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 973848978be863607282391868efd77ace64278d
refs/heads/master: 9554d57ebbc78db6d66057bfc12552247a7567da
18 changes: 0 additions & 18 deletions trunk/drivers/staging/media/go7007/README
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,6 @@ Todo:
and added to the build.
- testing?
- handle churn in v4l layer.
- Some features for wis-tw2804 subdev control (comb filter,motion detector sensitive & mask,more over...)
- go7007-v4l2.c need rewrite with new v4l2 style without nonstandart IO controls (set detector & bitrate)

05/05/2012 3.4.0-rc+:
Changes:
- When go7007 reset device, i2c was not worked (need rewrite GPIO5)
- As wis2804 has i2c_addr=0x00/*really*/, so Need set I2C_CLIENT_TEN flag for validity
- Some main nonzero initialization, rewrites with kzalloc instead kmalloc
- STATUS_SHUTDOWN was placed in incorrect place, so if firmware wasn`t loaded, we
failed v4l2_device_unregister with kernel panic (OOPS)
- Some new v4l2 style features as call_all(...s_stream...) for using subdev calls
- wis-tw2804.ko module code was incompatible with 3.4.x branch in initialization v4l2_subdev parts.
now i2c_get_clientdata(...) contains v4l2_subdev struct instead non standart wis_tw2804 struct

Adds:
- Additional chipset wis2804 controls with: gain,auto gain,inputs[0,1],color kill,chroma gain,gain balances,
for all 4 channels (from tw2804.pdf)
- Power control for each 4 ADC up when s_stream(...,1), down otherwise in wis-tw2804 module

Please send patchs to Greg Kroah-Hartman <greg@kroah.com> and Cc: Ross
Cohen <rcohen@snurgle.org> as well.
Expand Down
27 changes: 9 additions & 18 deletions trunk/drivers/staging/media/go7007/go7007-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,6 @@ static int go7007_init_encoder(struct go7007 *go)
go7007_write_addr(go, 0x3c82, 0x0001);
go7007_write_addr(go, 0x3c80, 0x00fe);
}
if (go->board_id == GO7007_BOARDID_ADLINK_MPG24) {
/* set GPIO5 to be an output, currently low */
go7007_write_addr(go, 0x3c82, 0x0000);
go7007_write_addr(go, 0x3c80, 0x00df);
}
return 0;
}

Expand All @@ -197,23 +192,17 @@ int go7007_reset_encoder(struct go7007 *go)
/*
* Attempt to instantiate an I2C client by ID, probably loading a module.
*/
static int init_i2c_module(struct i2c_adapter *adapter, const struct go_i2c *const i2c)
static int init_i2c_module(struct i2c_adapter *adapter, const char *type,
int addr)
{
struct go7007 *go = i2c_get_adapdata(adapter);
struct v4l2_device *v4l2_dev = &go->v4l2_dev;
struct i2c_board_info info;

memset(&info, 0, sizeof(info));
strlcpy(info.type, i2c->type, sizeof(info.type));
info.addr = i2c->addr;

if (i2c->id == I2C_DRIVERID_WIS_TW2804)
info.flags |= I2C_CLIENT_TEN;
if (v4l2_i2c_new_subdev_board(v4l2_dev, adapter, &info, NULL))
if (v4l2_i2c_new_subdev(v4l2_dev, adapter, type, addr, NULL))
return 0;

printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", i2c->type);
return -EINVAL;
printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", type);
return -1;
}

/*
Expand Down Expand Up @@ -249,7 +238,9 @@ int go7007_register_encoder(struct go7007 *go)
}
if (go->i2c_adapter_online) {
for (i = 0; i < go->board_info->num_i2c_devs; ++i)
init_i2c_module(&go->i2c_adapter, &go->board_info->i2c_devs[i]);
init_i2c_module(&go->i2c_adapter,
go->board_info->i2c_devs[i].type,
go->board_info->i2c_devs[i].addr);
if (go->board_id == GO7007_BOARDID_ADLINK_MPG24)
i2c_clients_command(&go->i2c_adapter,
DECODER_SET_CHANNEL, &go->channel_number);
Expand Down Expand Up @@ -580,7 +571,7 @@ struct go7007 *go7007_alloc(struct go7007_board_info *board, struct device *dev)
struct go7007 *go;
int i;

go = kzalloc(sizeof(struct go7007), GFP_KERNEL);
go = kmalloc(sizeof(struct go7007), GFP_KERNEL);
if (go == NULL)
return NULL;
go->dev = dev;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/media/go7007/go7007-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct go7007_board_info {
int audio_bclk_div;
int audio_main_div;
int num_i2c_devs;
struct go_i2c {
struct {
const char *type;
int id;
int addr;
Expand Down
5 changes: 4 additions & 1 deletion trunk/drivers/staging/media/go7007/go7007-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,9 @@ static int go7007_usb_probe(struct usb_interface *intf,
} else {
u16 channel;

/* set GPIO5 to be an output, currently low */
go7007_write_addr(go, 0x3c82, 0x0000);
go7007_write_addr(go, 0x3c80, 0x00df);
/* read channel number from GPIO[1:0] */
go7007_read_addr(go, 0x3c81, &channel);
channel &= 0x3;
Expand Down Expand Up @@ -1242,6 +1245,7 @@ static void go7007_usb_disconnect(struct usb_interface *intf)
struct urb *vurb, *aurb;
int i;

go->status = STATUS_SHUTDOWN;
usb_kill_urb(usb->intr_urb);

/* Free USB-related structs */
Expand All @@ -1265,7 +1269,6 @@ static void go7007_usb_disconnect(struct usb_interface *intf)
kfree(go->hpi_context);

go7007_remove(go);
go->status = STATUS_SHUTDOWN;
}

static struct usb_driver go7007_usb_driver = {
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/staging/media/go7007/go7007-v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static int go7007_open(struct file *file)

if (go->status != STATUS_ONLINE)
return -EBUSY;
gofh = kzalloc(sizeof(struct go7007_file), GFP_KERNEL);
gofh = kmalloc(sizeof(struct go7007_file), GFP_KERNEL);
if (gofh == NULL)
return -ENOMEM;
++go->ref_count;
Expand Down Expand Up @@ -953,7 +953,6 @@ static int vidioc_streamon(struct file *file, void *priv,
}
mutex_unlock(&go->hw_lock);
mutex_unlock(&gofh->lock);
call_all(&go->v4l2_dev, video, s_stream, 1);

return retval;
}
Expand All @@ -969,7 +968,6 @@ static int vidioc_streamoff(struct file *file, void *priv,
mutex_lock(&gofh->lock);
go7007_streamoff(go);
mutex_unlock(&gofh->lock);
call_all(&go->v4l2_dev, video, s_stream, 0);

return 0;
}
Expand Down Expand Up @@ -1834,6 +1832,5 @@ void go7007_v4l2_remove(struct go7007 *go)
mutex_unlock(&go->hw_lock);
if (go->video_dev)
video_unregister_device(go->video_dev);
if (go->status != STATUS_SHUTDOWN)
v4l2_device_unregister(&go->v4l2_dev);
v4l2_device_unregister(&go->v4l2_dev);
}
Loading

0 comments on commit 2508b8a

Please sign in to comment.