002-0018-arm-dts-mt7622-add-i2c-support.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. From 9ae337317d5634569bda83dfc5e0658fce34b1e2 Mon Sep 17 00:00:00 2001
  2. From: Weijie Gao <[email protected]>
  3. Date: Mon, 25 Jul 2022 16:30:30 +0800
  4. Subject: [PATCH 18/31] arm: dts: mt7622: add i2c support
  5. Add both hardware and software i2c support for mt7622.
  6. Reviewed-by: Simon Glass <[email protected]>
  7. Signed-off-by: Weijie Gao <[email protected]>
  8. ---
  9. arch/arm/dts/mt7622-rfb.dts | 18 ++++++++++++++++++
  10. arch/arm/dts/mt7622.dtsi | 24 ++++++++++++++++++++++++
  11. 2 files changed, 42 insertions(+)
  12. --- a/arch/arm/dts/mt7622-rfb.dts
  13. +++ b/arch/arm/dts/mt7622-rfb.dts
  14. @@ -159,6 +159,14 @@
  15. };
  16. };
  17. +
  18. + i2c1_pins_default: i2c1-default {
  19. + mux {
  20. + function = "i2c";
  21. + groups = "i2c1_0";
  22. + };
  23. + };
  24. +
  25. };
  26. &snfi {
  27. @@ -249,3 +257,13 @@
  28. &u3phy {
  29. status = "okay";
  30. };
  31. +
  32. +&soft_i2c {
  33. + status = "disabled";
  34. +};
  35. +
  36. +&i2c1 {
  37. + pinctrl-names = "default";
  38. + pinctrl-0 = <&i2c1_pins_default>;
  39. + status = "okay";
  40. +};
  41. --- a/arch/arm/dts/mt7622.dtsi
  42. +++ b/arch/arm/dts/mt7622.dtsi
  43. @@ -440,4 +440,28 @@
  44. status = "disabled";
  45. };
  46. + soft_i2c: soft_i2c@0 {
  47. + #address-cells = <1>;
  48. + #size-cells = <0>;
  49. + compatible = "i2c-gpio";
  50. + gpios = <&gpio 56 GPIO_ACTIVE_HIGH>, /* SDA */
  51. + <&gpio 55 GPIO_ACTIVE_HIGH>; /* CLK */
  52. + i2c-gpio,delay-us = <5>;
  53. + status = "disabled";
  54. + };
  55. +
  56. + i2c1: i2c@11008000 {
  57. + compatible = "mediatek,mt7622-i2c";
  58. + reg = <0x11008000 0x90>,
  59. + <0x11000180 0x80>;
  60. + interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_LOW>;
  61. + clock-div = <16>;
  62. + clocks = <&pericfg CLK_PERI_I2C1_PD>,
  63. + <&pericfg CLK_PERI_AP_DMA_PD>;
  64. + clock-names = "main", "dma";
  65. + #address-cells = <1>;
  66. + #size-cells = <0>;
  67. + status = "disabled";
  68. + };
  69. +
  70. };