Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65967
b: refs/heads/master
c: e77e2c2
h: refs/heads/master
i:
  65965: 791fe79
  65963: daf1f02
  65959: dc44181
  65951: 1d0e594
v: v3
  • Loading branch information
Trent Piepho authored and Mauro Carvalho Chehab committed Oct 10, 2007
1 parent 096f966 commit 590be58
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 39 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: 6d28e98906aa9405895f92348543d08da1837ea5
refs/heads/master: e77e2c2f2989eefff7e1c0fff9cb72afaedf6796
4 changes: 1 addition & 3 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -3458,7 +3458,6 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
int setFl,u64 *val_ptr)
{
#ifdef CONFIG_VIDEO_ADV_DEBUG
struct list_head *item;
struct pvr2_i2c_client *cp;
struct v4l2_register req;
int stat = 0;
Expand All @@ -3471,8 +3470,7 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
req.reg = reg_id;
if (setFl) req.val = *val_ptr;
mutex_lock(&hdw->i2c_list_lock); do {
list_for_each(item,&hdw->i2c_clients) {
cp = list_entry(item,struct pvr2_i2c_client,list);
list_for_each_entry(cp, &hdw->i2c_clients, list) {
if (!v4l2_chip_match_i2c_client(
cp->client,
req.match_type, req.match_chip)) {
Expand Down
51 changes: 16 additions & 35 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,15 +570,13 @@ int pvr2_i2c_client_cmd(struct pvr2_i2c_client *cp,unsigned int cmd,void *arg)

int pvr2_i2c_core_cmd(struct pvr2_hdw *hdw,unsigned int cmd,void *arg)
{
struct list_head *item,*nc;
struct pvr2_i2c_client *cp;
struct pvr2_i2c_client *cp, *ncp;
int stat = -EINVAL;

if (!hdw) return stat;

mutex_lock(&hdw->i2c_list_lock);
list_for_each_safe(item,nc,&hdw->i2c_clients) {
cp = list_entry(item,struct pvr2_i2c_client,list);
list_for_each_entry_safe(cp, ncp, &hdw->i2c_clients, list) {
if (!cp->recv_enable) continue;
mutex_unlock(&hdw->i2c_list_lock);
stat = pvr2_i2c_client_cmd(cp,cmd,arg);
Expand All @@ -602,13 +600,11 @@ static int handler_check(struct pvr2_i2c_client *cp)

void pvr2_i2c_core_status_poll(struct pvr2_hdw *hdw)
{
struct list_head *item;
struct pvr2_i2c_client *cp;
mutex_lock(&hdw->i2c_list_lock); do {
struct v4l2_tuner *vtp = &hdw->tuner_signal_info;
memset(vtp,0,sizeof(*vtp));
list_for_each(item,&hdw->i2c_clients) {
cp = list_entry(item,struct pvr2_i2c_client,list);
list_for_each_entry(cp, &hdw->i2c_clients, list) {
if (!cp->detected_flag) continue;
if (!cp->status_poll) continue;
cp->status_poll(cp);
Expand All @@ -630,8 +626,7 @@ void pvr2_i2c_core_sync(struct pvr2_hdw *hdw)
{
unsigned long msk;
unsigned int idx;
struct list_head *item,*nc;
struct pvr2_i2c_client *cp;
struct pvr2_i2c_client *cp, *ncp;

if (!hdw->i2c_linked) return;
if (!(hdw->i2c_pend_types & PVR2_I2C_PEND_ALL)) {
Expand All @@ -649,9 +644,7 @@ void pvr2_i2c_core_sync(struct pvr2_hdw *hdw)
buf = kmalloc(BUFSIZE,GFP_KERNEL);
pvr2_trace(PVR2_TRACE_I2C_CORE,"i2c: PEND_DETECT");
hdw->i2c_pend_types &= ~PVR2_I2C_PEND_DETECT;
list_for_each(item,&hdw->i2c_clients) {
cp = list_entry(item,struct pvr2_i2c_client,
list);
list_for_each_entry(cp, &hdw->i2c_clients, list) {
if (!cp->detected_flag) {
cp->ctl_mask = 0;
pvr2_i2c_probe(hdw,cp);
Expand Down Expand Up @@ -687,9 +680,7 @@ void pvr2_i2c_core_sync(struct pvr2_hdw *hdw)
"i2c: PEND_STALE (0x%lx)",
hdw->i2c_stale_mask);
hdw->i2c_pend_types &= ~PVR2_I2C_PEND_STALE;
list_for_each(item,&hdw->i2c_clients) {
cp = list_entry(item,struct pvr2_i2c_client,
list);
list_for_each_entry(cp, &hdw->i2c_clients, list) {
m2 = hdw->i2c_stale_mask;
m2 &= cp->ctl_mask;
m2 &= ~cp->pend_mask;
Expand All @@ -710,9 +701,8 @@ void pvr2_i2c_core_sync(struct pvr2_hdw *hdw)
and update each one. */
pvr2_trace(PVR2_TRACE_I2C_CORE,"i2c: PEND_CLIENT");
hdw->i2c_pend_types &= ~PVR2_I2C_PEND_CLIENT;
list_for_each_safe(item,nc,&hdw->i2c_clients) {
cp = list_entry(item,struct pvr2_i2c_client,
list);
list_for_each_entry_safe(cp, ncp, &hdw->i2c_clients,
list) {
if (!cp->handler) continue;
if (!cp->handler->func_table->update) continue;
pvr2_trace(PVR2_TRACE_I2C_CORE,
Expand Down Expand Up @@ -744,10 +734,8 @@ void pvr2_i2c_core_sync(struct pvr2_hdw *hdw)
for (idx = 0, msk = 1; pm; idx++, msk <<= 1) {
if (!(pm & msk)) continue;
pm &= ~msk;
list_for_each(item,&hdw->i2c_clients) {
cp = list_entry(item,
struct pvr2_i2c_client,
list);
list_for_each_entry(cp, &hdw->i2c_clients,
list) {
if (cp->pend_mask & msk) {
cp->pend_mask &= ~msk;
cp->recv_enable = !0;
Expand All @@ -771,7 +759,6 @@ int pvr2_i2c_core_check_stale(struct pvr2_hdw *hdw)
unsigned long msk,sm,pm;
unsigned int idx;
const struct pvr2_i2c_op *opf;
struct list_head *item;
struct pvr2_i2c_client *cp;
unsigned int pt = 0;

Expand All @@ -790,11 +777,9 @@ int pvr2_i2c_core_check_stale(struct pvr2_hdw *hdw)
}
if (sm) pt |= PVR2_I2C_PEND_STALE;

list_for_each(item,&hdw->i2c_clients) {
cp = list_entry(item,struct pvr2_i2c_client,list);
if (!handler_check(cp)) continue;
pt |= PVR2_I2C_PEND_CLIENT;
}
list_for_each_entry(cp, &hdw->i2c_clients, list)
if (handler_check(cp))
pt |= PVR2_I2C_PEND_CLIENT;

if (pt) {
mutex_lock(&hdw->i2c_list_lock); do {
Expand Down Expand Up @@ -882,12 +867,10 @@ unsigned int pvr2_i2c_report(struct pvr2_hdw *hdw,
char *buf,unsigned int maxlen)
{
unsigned int ccnt,bcnt;
struct list_head *item;
struct pvr2_i2c_client *cp;
ccnt = 0;
mutex_lock(&hdw->i2c_list_lock); do {
list_for_each(item,&hdw->i2c_clients) {
cp = list_entry(item,struct pvr2_i2c_client,list);
list_for_each_entry(cp, &hdw->i2c_clients, list) {
bcnt = pvr2_i2c_client_describe(
cp,
(PVR2_I2C_DETAIL_HANDLER|
Expand Down Expand Up @@ -925,13 +908,11 @@ static int pvr2_i2c_attach_inform(struct i2c_client *client)
static int pvr2_i2c_detach_inform(struct i2c_client *client)
{
struct pvr2_hdw *hdw = (struct pvr2_hdw *)(client->adapter->algo_data);
struct pvr2_i2c_client *cp;
struct list_head *item,*nc;
struct pvr2_i2c_client *cp, *ncp;
unsigned long amask = 0;
int foundfl = 0;
mutex_lock(&hdw->i2c_list_lock); do {
list_for_each_safe(item,nc,&hdw->i2c_clients) {
cp = list_entry(item,struct pvr2_i2c_client,list);
list_for_each_entry_safe(cp, ncp, &hdw->i2c_clients, list) {
if (cp->client == client) {
trace_i2c("pvr2_i2c_detach"
" [client=%s @ 0x%x ctxt=%p]",
Expand Down

0 comments on commit 590be58

Please sign in to comment.