739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. --- a/arch/mips/ath79/gpio.c
  2. +++ b/arch/mips/ath79/gpio.c
  3. @@ -33,6 +33,7 @@ static void __iomem *ath79_gpio_get_func
  4. reg = AR71XX_GPIO_REG_FUNC;
  5. else if (soc_is_ar934x() ||
  6. soc_is_qca953x() ||
  7. + soc_is_qca955x() ||
  8. soc_is_qca956x() ||
  9. soc_is_tp9343())
  10. reg = AR934X_GPIO_REG_FUNC;
  11. @@ -64,15 +65,21 @@ void ath79_gpio_function_disable(u32 mas
  12. void __init ath79_gpio_output_select(unsigned gpio, u8 val)
  13. {
  14. void __iomem *base = ath79_gpio_base;
  15. - unsigned int reg;
  16. + unsigned int reg, reg_base;
  17. u32 t, s;
  18. - BUG_ON(!soc_is_ar934x() && !soc_is_qca953x() && !soc_is_qca956x());
  19. -
  20. - if (gpio >= AR934X_GPIO_COUNT)
  21. - return;
  22. + if (soc_is_ar934x())
  23. + reg_base = AR934X_GPIO_REG_OUT_FUNC0;
  24. + else if (soc_is_qca953x())
  25. + reg_base = QCA953X_GPIO_REG_OUT_FUNC0;
  26. + else if (soc_is_qca955x())
  27. + reg_base = QCA955X_GPIO_REG_OUT_FUNC0;
  28. + else if (soc_is_qca956x())
  29. + reg_base = QCA956X_GPIO_REG_OUT_FUNC0;
  30. + else
  31. + BUG();
  32. - reg = AR934X_GPIO_REG_OUT_FUNC0 + 4 * (gpio / 4);
  33. + reg = reg_base + 4 * (gpio / 4);
  34. s = 8 * (gpio % 4);
  35. t = __raw_readl(base + reg);