Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210465
b: refs/heads/master
c: 5affb60
h: refs/heads/master
i:
  210463: e9c0840
v: v3
  • Loading branch information
Gregory Bean authored and Linus Torvalds committed Sep 10, 2010
1 parent 43134df commit cb7685a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 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: 0dcc48c15f63ee86c2fcd33968b08d651f0360a5
refs/heads/master: 5affb607720d734ca572b8a77c5c7d62d3042b6f
26 changes: 21 additions & 5 deletions trunk/drivers/gpio/sx150x.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,17 +459,33 @@ static int sx150x_init_io(struct sx150x_chip *chip, u8 base, u16 cfg)
return err;
}

static int sx150x_init_hw(struct sx150x_chip *chip,
struct sx150x_platform_data *pdata)
static int sx150x_reset(struct sx150x_chip *chip)
{
int err = 0;
int err;

err = i2c_smbus_write_word_data(chip->client,
err = i2c_smbus_write_byte_data(chip->client,
chip->dev_cfg->reg_reset,
0x3412);
0x12);
if (err < 0)
return err;

err = i2c_smbus_write_byte_data(chip->client,
chip->dev_cfg->reg_reset,
0x34);
return err;
}

static int sx150x_init_hw(struct sx150x_chip *chip,
struct sx150x_platform_data *pdata)
{
int err = 0;

if (pdata->reset_during_probe) {
err = sx150x_reset(chip);
if (err < 0)
return err;
}

err = sx150x_i2c_write(chip->client,
chip->dev_cfg->reg_misc,
0x01);
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/i2c/sx150x.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
* IRQ lines will appear. Similarly to gpio_base, the expander
* will create a block of irqs beginning at this number.
* This value is ignored if irq_summary is < 0.
* @reset_during_probe: If set to true, the driver will trigger a full
* reset of the chip at the beginning of the probe
* in order to place it in a known state.
*/
struct sx150x_platform_data {
unsigned gpio_base;
Expand All @@ -73,6 +76,7 @@ struct sx150x_platform_data {
u16 io_polarity;
int irq_summary;
unsigned irq_base;
bool reset_during_probe;
};

#endif /* __LINUX_I2C_SX150X_H */

0 comments on commit cb7685a

Please sign in to comment.