Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 352307
b: refs/heads/master
c: a6ca2e1
h: refs/heads/master
i:
  352305: 9faf3a3
  352303: 7bf1d51
v: v3
  • Loading branch information
Hauke Mehrtens authored and John W. Linville committed Jan 30, 2013
1 parent a60e661 commit 68c15df
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5b2e2eccab80e2f56d06df582e473fb0d8630f35
refs/heads/master: a6ca2e10f795111a90a4efabb07717258669e03d
22 changes: 22 additions & 0 deletions trunk/drivers/ssb/driver_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ static void ssb_gpio_chipco_free(struct gpio_chip *chip, unsigned gpio)
ssb_chipco_gpio_pullup(&bus->chipco, 1 << gpio, 0);
}

static int ssb_gpio_chipco_to_irq(struct gpio_chip *chip, unsigned gpio)
{
struct ssb_bus *bus = ssb_gpio_get_bus(chip);

if (bus->bustype == SSB_BUSTYPE_SSB)
return ssb_mips_irq(bus->chipco.dev) + 2;
else
return -EINVAL;
}

static int ssb_gpio_chipco_init(struct ssb_bus *bus)
{
struct gpio_chip *chip = &bus->gpio;
Expand All @@ -86,6 +96,7 @@ static int ssb_gpio_chipco_init(struct ssb_bus *bus)
chip->set = ssb_gpio_chipco_set_value;
chip->direction_input = ssb_gpio_chipco_direction_input;
chip->direction_output = ssb_gpio_chipco_direction_output;
chip->to_irq = ssb_gpio_chipco_to_irq;
chip->ngpio = 16;
/* There is just one SoC in one device and its GPIO addresses should be
* deterministic to address them more easily. The other buses could get
Expand Down Expand Up @@ -134,6 +145,16 @@ static int ssb_gpio_extif_direction_output(struct gpio_chip *chip,
return 0;
}

static int ssb_gpio_extif_to_irq(struct gpio_chip *chip, unsigned gpio)
{
struct ssb_bus *bus = ssb_gpio_get_bus(chip);

if (bus->bustype == SSB_BUSTYPE_SSB)
return ssb_mips_irq(bus->extif.dev) + 2;
else
return -EINVAL;
}

static int ssb_gpio_extif_init(struct ssb_bus *bus)
{
struct gpio_chip *chip = &bus->gpio;
Expand All @@ -144,6 +165,7 @@ static int ssb_gpio_extif_init(struct ssb_bus *bus)
chip->set = ssb_gpio_extif_set_value;
chip->direction_input = ssb_gpio_extif_direction_input;
chip->direction_output = ssb_gpio_extif_direction_output;
chip->to_irq = ssb_gpio_extif_to_irq;
chip->ngpio = 5;
/* There is just one SoC in one device and its GPIO addresses should be
* deterministic to address them more easily. The other buses could get
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/linux/ssb/ssb_driver_mips.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ void ssb_mipscore_init(struct ssb_mipscore *mcore)
{
}

static inline unsigned int ssb_mips_irq(struct ssb_device *dev)
{
return 0;
}

#endif /* CONFIG_SSB_DRIVER_MIPS */

#endif /* LINUX_SSB_MIPSCORE_H_ */

0 comments on commit 68c15df

Please sign in to comment.