get_gpio_by_name 返回 -1 ,小白求教育!
时间:10-02
整理:3721RD
点击:
static int s6d7aa0x01_LCD_vid_probe(struct platform_device *pdev)
{
int ret = 0;
// request power_EN pin
ret = get_GPIO_by_name("LCM_VCC_EN");
if (ret < 0) {
DRM_ERROR("Faild to get panel power_en gpio,use default power_en pin\n");
ret = GPIO_LCM_VCC_EN;
}
mipi_power_gpio = ret;
ret = gpio_request(mipi_power_gpio, "mipi_power");
if (ret) {
DRM_ERROR("Faild to request mini power gpio \n");
return -EINVAL;
}
gpio_direction_output(mipi_power_gpio, 1);
// request RESET pin
ret = get_gpio_by_name("LCMB_RXEN");
if (ret < 0) {
DRM_ERROR("Faild to get panel reset gpio,use default reset pin\n");
ret = MIPI_RESET_GPIO_DEFAULT;
}
mipi_reset_gpio = ret;
LOG:
<6>[ 2.140729] [drm] Initialized pvrsrvkm 8.1.0 2009-03-10 for 0000:00:02.0 on minor 0
<6>[ 2.141959] [drm] tc35876x_lcd_init
<6>[ 2.142368] [drm] otm1281_lcd_init
<6>[ 2.142638] [drm] nt35590_lcd_init
<6>[ 2.142920] [drm] nt35590_lcd_init
<6>[ 2.143191] [drm] h8c7_lcd_init
<6>[ 2.143617] [drm] lcd_init
<3>[ 2.143902] [drm:s6d7aa0x01_lcd_vid_probe] *ERROR* Faild to get panel power_en gpio,use default power_en pin
<3>[ 2.144475] [drm:s6d7aa0x01_lcd_vid_probe] *ERROR* Faild to get panel reset gpio,use default reset pin
<6>[ 2.145035] s6d7aa0x01_detect
<6>[ 2.155050] [drm] new update of use cases
<6>[ 2.374508] smb347 2-006a: Charging Status: STAT_C:0x5
<6>[ 2.374810] smb347 2-006a: level=92
<6>[ 2.378169] cw201x 2-0062: cw_bat->bat_change = 1, cw_bat->time_to_empty = 8191, cw_bat->capacity = 92, cw_bat->voltage = 4070000, cw_bat->dc_online = 0, cw_bat->usb_online = 0
<6>[ 3.689618] allocated 800x1280 fb
{
int ret = 0;
// request power_EN pin
ret = get_GPIO_by_name("LCM_VCC_EN");
if (ret < 0) {
DRM_ERROR("Faild to get panel power_en gpio,use default power_en pin\n");
ret = GPIO_LCM_VCC_EN;
}
mipi_power_gpio = ret;
ret = gpio_request(mipi_power_gpio, "mipi_power");
if (ret) {
DRM_ERROR("Faild to request mini power gpio \n");
return -EINVAL;
}
gpio_direction_output(mipi_power_gpio, 1);
// request RESET pin
ret = get_gpio_by_name("LCMB_RXEN");
if (ret < 0) {
DRM_ERROR("Faild to get panel reset gpio,use default reset pin\n");
ret = MIPI_RESET_GPIO_DEFAULT;
}
mipi_reset_gpio = ret;
LOG:
<6>[ 2.140729] [drm] Initialized pvrsrvkm 8.1.0 2009-03-10 for 0000:00:02.0 on minor 0
<6>[ 2.141959] [drm] tc35876x_lcd_init
<6>[ 2.142368] [drm] otm1281_lcd_init
<6>[ 2.142638] [drm] nt35590_lcd_init
<6>[ 2.142920] [drm] nt35590_lcd_init
<6>[ 2.143191] [drm] h8c7_lcd_init
<6>[ 2.143617] [drm] lcd_init
<3>[ 2.143902] [drm:s6d7aa0x01_lcd_vid_probe] *ERROR* Faild to get panel power_en gpio,use default power_en pin
<3>[ 2.144475] [drm:s6d7aa0x01_lcd_vid_probe] *ERROR* Faild to get panel reset gpio,use default reset pin
<6>[ 2.145035] s6d7aa0x01_detect
<6>[ 2.155050] [drm] new update of use cases
<6>[ 2.374508] smb347 2-006a: Charging Status: STAT_C:0x5
<6>[ 2.374810] smb347 2-006a: level=92
<6>[ 2.378169] cw201x 2-0062: cw_bat->bat_change = 1, cw_bat->time_to_empty = 8191, cw_bat->capacity = 92, cw_bat->voltage = 4070000, cw_bat->dc_online = 0, cw_bat->usb_online = 0
<6>[ 3.689618] allocated 800x1280 fb
这个应当在初始化时有设置这个GPIO口吧。
否则就会报这种错误。