Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219706
b: refs/heads/master
c: e1eeeae
h: refs/heads/master
v: v3
  • Loading branch information
Arjan van de Ven authored and Greg Kroah-Hartman committed Aug 31, 2010
1 parent 9ee95dc commit 9f3639d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 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: dbd3a8709560365ff9b1e5eca263f608877a8a89
refs/heads/master: e1eeeae2bf5ce32d6b0303e6f360c339410cd527
29 changes: 12 additions & 17 deletions trunk/drivers/staging/mrst-touchscreen/intel-mid-touch.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,24 +157,22 @@ static int mrstouch_pmic_id(uint *vendor, uint *rev)
*/
static int mrstouch_chan_parse(struct mrstouch_dev *tsdev)
{
int err, i, j, found;
u32 r32;
int err, i, found;
u8 r8;

found = -1;

for (i = 0; i < MRSTOUCH_MAX_CHANNELS; i++) {
if (found >= 0)
break;

err = intel_scu_ipc_ioread32(PMICADDR0, &r32);
err = intel_scu_ipc_ioread8(PMICADDR0 + i, &r8);
if (err)
return err;

for (j = 0; j < 32; j+= 8) {
if (((r32 >> j) & 0xFF) == END_OF_CHANNEL) {
found = i;
break;
}
if (r8 == END_OF_CHANNEL) {
found = i;
break;
}
}
if (found < 0)
Expand Down Expand Up @@ -284,20 +282,17 @@ static int mrstouch_ts_chan_read(u16 offset, u16 chan, u16 *vp, u16 *vm)
*/
static int mrstouch_ts_chan_set(uint offset)
{
int count;
u16 chan;
u16 reg[5];
u8 data[5];

int ret, count;

chan = PMICADDR0 + offset;
for (count = 0; count <= 3; count++) {
reg[count] = chan++;
data[count] = MRST_TS_CHAN10 + count;
ret = intel_scu_ipc_iowrite8(chan++, MRST_TS_CHAN10 + count);
if (ret)
return ret;
}
reg[count] = chan;
data[count] = END_OF_CHANNEL;

return intel_scu_ipc_writev(reg, data, 5);
return intel_scu_ipc_iowrite8(chan++, END_OF_CHANNEL);
}

/* Initialize ADC */
Expand Down

0 comments on commit 9f3639d

Please sign in to comment.