Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.67 KB | None | 0 0
  1. /*
  2. * Copyright (C) 2016 Hans de Goede <hdegoede@redhat.com>
  3. *
  4. * This file is dual-licensed: you can use it either under the terms
  5. * of the GPL or the X11 license, at your option. Note that this dual
  6. * licensing only applies to this file, and not this project as a
  7. * whole.
  8. *
  9. * a) This file is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License as
  11. * published by the Free Software Foundation; either version 2 of the
  12. * License, or (at your option) any later version.
  13. *
  14. * This file is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * Or, alternatively,
  20. *
  21. * b) Permission is hereby granted, free of charge, to any person
  22. * obtaining a copy of this software and associated documentation
  23. * files (the "Software"), to deal in the Software without
  24. * restriction, including without limitation the rights to use,
  25. * copy, modify, merge, publish, distribute, sublicense, and/or
  26. * sell copies of the Software, and to permit persons to whom the
  27. * Software is furnished to do so, subject to the following
  28. * conditions:
  29. *
  30. * The above copyright notice and this permission notice shall be
  31. * included in all copies or substantial portions of the Software.
  32. *
  33. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  34. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  35. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  36. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  37. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  38. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  39. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  40. * OTHER DEALINGS IN THE SOFTWARE.
  41. */
  42.  
  43. /dts-v1/;
  44. #include "sun8i-h3.dtsi"
  45. #include "sunxi-common-regulators.dtsi"
  46.  
  47. #include <dt-bindings/gpio/gpio.h>
  48. #include <dt-bindings/input/input.h>
  49. #include <dt-bindings/pinctrl/sun4i-a10.h>
  50.  
  51. / {
  52. model = "Xunlong Orange Pi One";
  53. compatible = "xunlong,orangepi-one", "allwinner,sun8i-h3";
  54.  
  55. aliases {
  56. serial0 = &uart0;
  57. ethernet0 = &emac;
  58. };
  59.  
  60. chosen {
  61. stdout-path = "serial0:115200n8";
  62. };
  63.  
  64. leds {
  65. compatible = "gpio-leds";
  66. pinctrl-names = "default";
  67. pinctrl-0 = <&leds_opc>, <&leds_r_opc>;
  68.  
  69. pwr_led {
  70. label = "orangepi:green:pwr";
  71. gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
  72. default-state = "on";
  73. };
  74.  
  75. status_led {
  76. label = "orangepi:red:status";
  77. gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>;
  78. };
  79. };
  80.  
  81. r_gpio_keys {
  82. compatible = "gpio-keys";
  83. pinctrl-names = "default";
  84. pinctrl-0 = <&sw_r_opc>;
  85.  
  86. sw4 {
  87. label = "sw4";
  88. linux,code = <BTN_0>;
  89. gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
  90. };
  91. };
  92. sound_spdif {
  93. compatible = "simple-audio-card";
  94. simple-audio-card,name = "On-board SPDIF";
  95.  
  96. simple-audio-card,cpu {
  97. sound-dai = <&spdif>;
  98. };
  99.  
  100. simple-audio-card,codec {
  101. sound-dai = <&spdif_out>;
  102. };
  103. };
  104.  
  105. spdif_out: spdif-out {
  106. #sound-dai-cells = <0>;
  107. compatible = "linux,spdif-dit";
  108. };
  109.  
  110. reg_2v5: regulator-2v5 {
  111. compatible = "regulator-fixed";
  112. regulator-name = "2V5";
  113. regulator-min-microvolt = <2500000>;
  114. regulator-max-microvolt = <2500000>;
  115. regulator-always-on;
  116. };
  117.  
  118. reg_3v3: regulator-3v3 {
  119. compatible = "regulator-fixed";
  120. regulator-name = "3V3";
  121. regulator-min-microvolt = <3300000>;
  122. regulator-max-microvolt = <3300000>;
  123. regulator-always-on;
  124. };
  125.  
  126. sound {
  127. compatible = "simple-audio-card";
  128. simple-audio-card,name = "cx2092x";
  129. simple-audio-card,format = "i2s";
  130. //simple-audio-card,bitclock-master = <&codec_dai>;
  131. //simple-audio-card,frame-master = <&codec_dai>;
  132. simple-audio-card,routing =
  133. "Headphone Jack", "VOUTLHP",
  134. "Headphone Jack", "VOUTRHP",
  135. "Line Out Jack", "VOUTL",
  136. "Line Out Jack", "VOUTR",
  137. "VINM", "Mic Jack",
  138. "VINL", "Line In Jack",
  139. "VINR", "Line In Jack";
  140. simple-audio-card,widgets =
  141. "Headphone", "Headphone Jack",
  142. "Line", "Line In Jack",
  143. "Line", "Line Out Jack",
  144. "Microphone", "Mic Jack";
  145.  
  146. simple-audio-card,mclk-fs = <256>; // as it's not supported in dai codec driver, see asoc_simple_card_hw_params() in sound/soc/generic/simple-card.c
  147.  
  148. simple-audio-card,cpu {
  149. sound-dai = <&i2s0>;
  150. };
  151.  
  152. codec_dai: simple-audio-card,codec {
  153. sound-dai = <&ext_codec>;
  154. };
  155. };
  156.  
  157. clocks {
  158. mclk: mclk {
  159. compatible = "fixed-clock";
  160. #clock-cells = <0>;
  161. clock-frequency = <26000000>;
  162. };
  163. };
  164.  
  165. };
  166.  
  167. &codec {
  168. pinctrl-0 = <&codec_pa_pin>;
  169. allwinner,pa-gpios = <&pio 0 16 GPIO_ACTIVE_HIGH>; /* PA16 */
  170. allwinner,audio-routing =
  171. "Speaker", "LINEOUT",
  172. "MIC1", "Mic",
  173. "Mic", "MBIAS";
  174. status = "okay";
  175. };
  176.  
  177. &de {
  178. status = "okay";
  179. };
  180.  
  181. &ehci1 {
  182. status = "okay";
  183. };
  184.  
  185. &i2c0 {
  186. pinctrl-names = "default";
  187. pinctrl-0 = <&i2c0_pins>;
  188. status = "okay";
  189.  
  190. /* added for test with I2S codec board based on cx2092x */
  191. ext_codec: cx2092x@41 {
  192. #sound-dai-cells = <0>;
  193. compatible = "conexant,cx2092x";
  194. reg = <0x41>;
  195. dac-clk = <1>; // SYSCLK=0, WSPLL=1
  196. //status = "okay";
  197. };
  198.  
  199. };
  200.  
  201. &i2s0 {
  202. pinctrl-names = "default";
  203. pinctrl-0 = <&i2s0_bclk> , <&i2s0_lrclk> , <&i2s0_sdo0>, <&i2s0_sdi>;
  204. status = "okay";
  205. };
  206.  
  207. &ir {
  208. pinctrl-names = "default";
  209. pinctrl-0 = <&ir_pins_a>;
  210. status = "okay";
  211. };
  212.  
  213. &lcd0 {
  214. status = "okay";
  215. };
  216.  
  217. &emac {
  218. phy-handle = <&int_mii_phy>;
  219. phy-mode = "mii";
  220. allwinner,leds-active-low;
  221. status = "okay";
  222. };
  223.  
  224. &mmc0 {
  225. pinctrl-names = "default";
  226. pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
  227. vmmc-supply = <&reg_vcc3v3>;
  228. bus-width = <4>;
  229. cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
  230. cd-inverted;
  231. status = "okay";
  232. };
  233.  
  234. &ohci1 {
  235. status = "okay";
  236. };
  237.  
  238. &pio {
  239. codec_pa_pin: codec_pa_pin@0 {
  240. pins = "PA16";
  241. function = "gpio_out";
  242. };
  243.  
  244. leds_opc: led_pins@0 {
  245. pins = "PA15";
  246. function = "gpio_out";
  247. };
  248. };
  249.  
  250. &r_pio {
  251. leds_r_opc: led_pins@0 {
  252. pins = "PL10";
  253. function = "gpio_out";
  254. };
  255.  
  256. sw_r_opc: key_pins@0 {
  257. pins = "PL3";
  258. function = "gpio_in";
  259. };
  260. };
  261.  
  262. &uart0 {
  263. pinctrl-names = "default";
  264. pinctrl-0 = <&uart0_pins_a>;
  265. status = "okay";
  266. };
  267.  
  268. &uart1 {
  269. pinctrl-names = "default";
  270. pinctrl-0 = <&uart1_pins>;
  271. status = "disabled";
  272. };
  273.  
  274. &uart2 {
  275. pinctrl-names = "default";
  276. pinctrl-0 = <&uart2_pins>;
  277. status = "disabled";
  278. };
  279.  
  280. &uart3 {
  281. pinctrl-names = "default";
  282. pinctrl-0 = <&uart3_pins>;
  283. status = "disabled";
  284. };
  285.  
  286. &usbphy {
  287. /* USB VBUS is always on */
  288. status = "okay";
  289. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement