diff options
-rw-r--r-- | drivers/pinctrl/pinctrl-nomadik.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index ef66f98e9202..015b093287a4 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; |
@@ -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 | /* |