diff options
Diffstat (limited to 'drivers/pinctrl/pinctrl-nomadik.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-nomadik.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index ef66f98e9202..1bb16ffb4e41 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c | |||
@@ -259,6 +259,9 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct, | |||
259 | const struct prcm_gpiocr_altcx_pin_desc *pin_desc; | 259 | const struct prcm_gpiocr_altcx_pin_desc *pin_desc; |
260 | const u16 *gpiocr_regs; | 260 | const u16 *gpiocr_regs; |
261 | 261 | ||
262 | if (!npct->prcm_base) | ||
263 | return; | ||
264 | |||
262 | if (alt_num > PRCM_IDX_GPIOCR_ALTC_MAX) { | 265 | if (alt_num > PRCM_IDX_GPIOCR_ALTC_MAX) { |
263 | dev_err(npct->dev, "PRCM GPIOCR: alternate-C%i is invalid\n", | 266 | dev_err(npct->dev, "PRCM GPIOCR: alternate-C%i is invalid\n", |
264 | alt_num); | 267 | alt_num); |
@@ -682,6 +685,9 @@ static int nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpio) | |||
682 | const struct prcm_gpiocr_altcx_pin_desc *pin_desc; | 685 | const struct prcm_gpiocr_altcx_pin_desc *pin_desc; |
683 | const u16 *gpiocr_regs; | 686 | const u16 *gpiocr_regs; |
684 | 687 | ||
688 | if (!npct->prcm_base) | ||
689 | return NMK_GPIO_ALT_C; | ||
690 | |||
685 | for (i = 0; i < npct->soc->npins_altcx; i++) { | 691 | for (i = 0; i < npct->soc->npins_altcx; i++) { |
686 | if (npct->soc->altcx_pins[i].pin == gpio) | 692 | if (npct->soc->altcx_pins[i].pin == gpio) |
687 | break; | 693 | break; |
@@ -1306,7 +1312,7 @@ const struct irq_domain_ops nmk_gpio_irq_simple_ops = { | |||
1306 | .xlate = irq_domain_xlate_twocell, | 1312 | .xlate = irq_domain_xlate_twocell, |
1307 | }; | 1313 | }; |
1308 | 1314 | ||
1309 | static int __devinit nmk_gpio_probe(struct platform_device *dev) | 1315 | static int nmk_gpio_probe(struct platform_device *dev) |
1310 | { | 1316 | { |
1311 | struct nmk_gpio_platform_data *pdata = dev->dev.platform_data; | 1317 | struct nmk_gpio_platform_data *pdata = dev->dev.platform_data; |
1312 | struct device_node *np = dev->dev.of_node; | 1318 | struct device_node *np = dev->dev.of_node; |
@@ -1846,7 +1852,7 @@ static const struct of_device_id nmk_pinctrl_match[] = { | |||
1846 | {}, | 1852 | {}, |
1847 | }; | 1853 | }; |
1848 | 1854 | ||
1849 | static int __devinit nmk_pinctrl_probe(struct platform_device *pdev) | 1855 | static int nmk_pinctrl_probe(struct platform_device *pdev) |
1850 | { | 1856 | { |
1851 | const struct platform_device_id *platid = platform_get_device_id(pdev); | 1857 | const struct platform_device_id *platid = platform_get_device_id(pdev); |
1852 | struct device_node *np = pdev->dev.of_node; | 1858 | struct device_node *np = pdev->dev.of_node; |
@@ -1887,9 +1893,12 @@ static int __devinit nmk_pinctrl_probe(struct platform_device *pdev) | |||
1887 | "failed to ioremap PRCM registers\n"); | 1893 | "failed to ioremap PRCM registers\n"); |
1888 | return -ENOMEM; | 1894 | return -ENOMEM; |
1889 | } | 1895 | } |
1890 | } else { | 1896 | } else if (version == PINCTRL_NMK_STN8815) { |
1891 | dev_info(&pdev->dev, | 1897 | dev_info(&pdev->dev, |
1892 | "No PRCM base, assume no ALT-Cx control is available\n"); | 1898 | "No PRCM base, assume no ALT-Cx control is available\n"); |
1899 | } else { | ||
1900 | dev_err(&pdev->dev, "missing PRCM base address\n"); | ||
1901 | return -EINVAL; | ||
1893 | } | 1902 | } |
1894 | 1903 | ||
1895 | /* | 1904 | /* |