Hi Vinay, Cc: linux-arm-msm On 10/30/18 4:12 PM, Vinay Simha B N wrote: > hi, > > we are using 410c with apq8016 based board, want to configure mpp3 as > output and mpp4 as input. How to set the output voltage level(mpp3) by > runtime and read the analog input voltage(mpp4) in sysfs. please suggest. > > debian based linux kernel - 4.14 > added arch/arm64/boot/dts/qcom/pm8916.dtsi > > pm8916_vadc: vadc@3100 { > mpp4_in { > reg = <VADC_P_MUX4_1_1>; > qcom,decimation = <512>; > qcom,ratiometric; //0.625V and 1.25V > reference > qcom,hw-settle-time = <200>; > qcom,avg-samples = <1>; > qcom,pre-scaling = <1 1>; > }; > > in apq8016-sbc-pmic-pins.dtsi > ---------- > &pm8916_mpps { > > pinctrl-names = "default"; > pinctrl-0 = <&pm8916_mpp_analog_out &pm8916_mpp_analog_in>; > > pm8916_mpp_analog_in: pm8916_mpp4 { > pinconf { > pins = "mpp4"; > function = "analog"; > qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH5>; > }; > }; > pm8916_mpp_analog_out: pm8916_mpp_analog { > pinconf { > pins = "mpp3"; > function = "analog"; > qcom,analog-level = <PMIC_MPP_AOUT_LVL_1V25>; > output-high; > }; > }; > ------------ > > cat /sys/kernel/debug/gpio > gpiochip2: GPIOs 504-507, parent: platform/200f000.spmi:pm8916@0:mpps@a000, > 200f000.spmi:pm8916@0:mpps@a000: > mpp1 : out analog vin-2 0 high > mpp2 : out digital vin-0 0 low > mpp3 : out analog vin-0 0 low > mpp4 : in analog vin-0 0 low > -- regards, Stan