Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125548
b: refs/heads/master
c: dd72f31
h: refs/heads/master
v: v3
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Jan 2, 2009
1 parent cfd7ae9 commit 8bdf5bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 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: e4cda3e0728156c6be1d03e72ef20ea811da4ad5
refs/heads/master: dd72f31b4fa87c68e16484a3ed3e4d1843ad7f06
17 changes: 13 additions & 4 deletions trunk/drivers/media/dvb/siano/sms-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ struct sms_board *sms_get_board(int id)
return &sms_boards[id];
}

static int sms_set_gpio(struct smscore_device_t *coredev, u32 pin, int enable)
static int sms_set_gpio(struct smscore_device_t *coredev, int pin, int enable)
{
int ret;
int lvl, ret;
u32 gpio;
struct smscore_gpio_config gpioconfig = {
.direction = SMS_GPIO_DIRECTION_OUTPUT,
.pullupdown = SMS_GPIO_PULLUPDOWN_NONE,
Expand All @@ -145,12 +146,20 @@ static int sms_set_gpio(struct smscore_device_t *coredev, u32 pin, int enable)
if (pin == 0)
return -EINVAL;

ret = smscore_configure_gpio(coredev, pin, &gpioconfig);
if (pin < 0) {
/* inverted gpio */
gpio = pin * -1;
lvl = enable ? 0 : 1;
} else {
gpio = pin;
lvl = enable ? 1 : 0;
}

ret = smscore_configure_gpio(coredev, gpio, &gpioconfig);
if (ret < 0)
return ret;

return smscore_set_gpio(coredev, pin, enable);
return smscore_set_gpio(coredev, gpio, lvl);
}

int sms_board_setup(struct smscore_device_t *coredev)
Expand Down

0 comments on commit 8bdf5bf

Please sign in to comment.