We want to get gpio(AB25 AJ28) for expand gpio driver. but always error. How can I solve this problem
code:
pctl->intb_port = devm_gpiod_get_optional(device, "intb",
GPIOD_OUT_HIGH);
loge(" get intb gpio =%d\n", pctl->intb_port);
pctl->reset_port = of_get_named_gpio_flags(node,
"reset-gpios", 0, &pctl->reset_value);
//pctl->reset_port = devm_gpiod_get_optional(device, "reset",
// GPIOD_OUT_HIGH);
loge(" get gpio =%d\n", pctl->reset_port);
if (pctl->intb_port > 0 && pctl->reset_port > 0) {
ret = gpio_get_value(pctl->intb_port);
loge("intb gpio value = %d\n", ret);
ret = gpio_get_value(pctl->reset_port);
loge("reet gpio value = %d\n", ret);
}
dts:
ioexp0: ioexp0 {
#gpio-cells = <2>;
#interrupt-cells = <2>;
compatible = "ecarx,expand-io";
reg = <0x23>; //0x46 >> 1
gpio-controller;
interrupt-controller;
//ecarx,probe-reset;
intb-gpios = <&main_gpio0 53 GPIO_ACTIVE_HIGH>;
reset-gpios = <&main_gpio0 54 GPIO_ACTIVE_HIGH>;
1v8_en = <3>;
1v2_en = <4>;
3v3_en = <13>;
poc_en = <11>;
};
error log:
[ 1.053749] Ecarx Expand IO: get intb gpio =-517
[ 1.058650] Ecarx Expand IO: get gpio =-517
[ 1.063102] Ecarx Expand IO: ecarx_ioexp_init_hw : pinctrl test error[0xffffffffffffffed]
[ 1.072292] Ecarx Expand IO: ecarx_ioexp_probe, line 975
[ 1.122983] Ecarx Expand IO: ecarx_spb_cam_power_on: cam gpio 1v8=3, 1v2=4, 3v3=13, poc_en=11
[ 1.131876] Ecarx Expand IO: get gio 1v8 output=0
[ 1.136897] Ecarx Expand IO: get gio 1v8 =1
[ 1.141257] Ecarx Expand IO: ecarx_ioexp_probe success!!