Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350758
b: refs/heads/master
c: 0202a32
h: refs/heads/master
v: v3
  • Loading branch information
Maxime Ripard authored and Mark Brown committed Jan 26, 2013
1 parent e4766d5 commit a5528d5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 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: 3343b7a6d2cd0a980d0c4a0ce02ef48b6bfcc12a
refs/heads/master: 0202a32d5f4a129ced47db76001f958cd33adeb7
23 changes: 20 additions & 3 deletions trunk/drivers/spi/spi-gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,26 @@ static int spi_gpio_probe_dt(struct platform_device *pdev)
if (!pdata)
return -ENOMEM;

pdata->sck = of_get_named_gpio(np, "gpio-sck", 0);
pdata->miso = of_get_named_gpio(np, "gpio-miso", 0);
pdata->mosi = of_get_named_gpio(np, "gpio-mosi", 0);
ret = of_get_named_gpio(np, "gpio-sck", 0);
if (ret < 0) {
dev_err(&pdev->dev, "gpio-sck property not found\n");
goto error_free;
}
pdata->sck = ret;

ret = of_get_named_gpio(np, "gpio-miso", 0);
if (ret < 0) {
dev_info(&pdev->dev, "gpio-miso property not found, switching to no-rx mode\n");
pdata->miso = SPI_GPIO_NO_MISO;
} else
pdata->miso = ret;

ret = of_get_named_gpio(np, "gpio-mosi", 0);
if (ret < 0) {
dev_info(&pdev->dev, "gpio-mosi property not found, switching to no-tx mode\n");
pdata->mosi = SPI_GPIO_NO_MOSI;
} else
pdata->mosi = ret;

ret = of_property_read_u32(np, "num-chipselects", &tmp);
if (ret < 0) {
Expand Down

0 comments on commit a5528d5

Please sign in to comment.