AnsweredAssumed Answered

imx6ul adc driver

Question asked by 小辉哥 on Jan 28, 2016
Latest reply on Mar 23, 2017 by 玉栋 郭

Dear all,

I want to put the GPIO1_IO09 pin configured to adc functionI have modified the imx6ul-14x14-evk.dts and imx6ul.dtsi .

The following: (Red font is I modified in the imx6ul-14x14-evk.dts)

 

reg_sd1_vmmc: regulator@1 {

  compatible = "regulator-fixed";

  regulator-name = "VSD_3V3";

  regulator-min-microvolt = <3300000>;

  regulator-max-microvolt = <3300000>;

//gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;

  //enable-active-high;

  };

 

 

  reg_vref_3v3: regulator@2 {

  compatible = "regulator-fixed";

  regulator-name = "vref-3v3";

  regulator-min-microvolt = <3300000>;

  regulator-max-microvolt = <3300000>;

  };

 

&adc1 {

  pinctrl-names = "default";

  pinctrl-0 = <&pinctrl_adc1>;

  vref-supply = <&reg_vref_3v3>;

  status = "okay";

};

pinctrl_hog_1: hoggrp-1 {

  fsl,pins = <

  MX6UL_PAD_LCD_RESET__WDOG1_WDOG_ANY    0x30b0

  MX6UL_PAD_UART1_RTS_B__GPIO1_IO19 0x17059 /* SD1 CD */

  MX6UL_PAD_GPIO1_IO05__USDHC1_VSELECT 0x17059 /* SD1 VSELECT */

  //MX6UL_PAD_GPIO1_IO09__GPIO1_IO09        0x17059 /* SD1 RESET */

  >;

  };

 

pinctrl_adc1: adc1grp {

  fsl,pins = <

  MX6UL_PAD_GPIO1_IO09__GPIO1_IO09 0xb0

  >;

  };

imx6ul.dtsi file i modified :

 

adc1: adc@02198000 {

  compatible = "fsl,imx6ul-adc", "fsl,vf610-adc";

  reg = <0x02198000 0x4000>;

  interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;

  clocks = <&clks IMX6UL_CLK_ADC1>;

  num-channels = <10>;

  clock-names = "adc";

  status = "disabled";

 

When I send this pin is connected to the different voltage(3.3V or 2.5V), found the adc values will not change,

 

root@imx_mfgtools_nogpu:/sys/bus/iio/devices/iio:device0# cat in_voltage9_raw

4080

root@imx_mfgtools_nogpu:/sys/bus/iio/devices/iio:device0# cat in_voltage9_raw

4077

root@imx_mfgtools_nogpu:/sys/bus/iio/devices/iio:device0# cat in_voltage9_raw

 

Can you tell me how to modify to get the right result?

Best Regards,

xiaohuige

Outcomes