From 812ded0d8d6800728c4c11abed7546d735449123 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Wed, 15 Feb 2023 09:14:04 +0000 Subject: [PATCH] add rk809 spk hp --- kernel/drivers/misc/nkio/nk_io_core.c | 71 +++++++++++++++++++++++++---------- 1 files changed, 50 insertions(+), 21 deletions(-) diff --git a/kernel/drivers/misc/nkio/nk_io_core.c b/kernel/drivers/misc/nkio/nk_io_core.c index 46e2120..4193df9 100755 --- a/kernel/drivers/misc/nkio/nk_io_core.c +++ b/kernel/drivers/misc/nkio/nk_io_core.c @@ -139,27 +139,6 @@ } - //usb_en_oc_gpio - ret = of_get_named_gpio_flags(node, "usb_en_oc_gpio", 0, &flags); - if (ret < 0) { - printk("%s() Can not read property usb_en_oc_gpio\n", __FUNCTION__); - goto err; - } else { - pdata->usb_en_oc_gpio = ret; - gpio_free(ret); - ret = devm_gpio_request(&pdev->dev, pdata->usb_en_oc_gpio, "usb_en_oc_gpio"); - if (ret < 0){ - printk("%s() devm_gpio_request usb_en_oc_gpio request ERROR\n", __FUNCTION__); - goto err; - } - - ret = gpio_direction_output(pdata->usb_en_oc_gpio,1); - if(ret < 0){ - printk("%s() gpio_direction_input usb_en_oc_gpio set ERROR\n", __FUNCTION__); - goto err; - } - } - //hub_host2_5V_rest_gpio ret = of_get_named_gpio_flags(node, "hub_host2_5V_rest_gpio", 0, &flags); if (ret < 0) { @@ -292,7 +271,57 @@ } } + //hp_en_gpio + ret = of_get_named_gpio_flags(node, "hp_en_gpio", 0, &flags); + if (ret < 0) { + printk("%s() Can not read property hp_en_gpio\n", __FUNCTION__); + } else { + pdata->hp_en_gpio = ret; + ret = devm_gpio_request(&pdev->dev, pdata->hp_en_gpio, "hp_en_gpio"); + if(ret < 0){ + printk("%s() devm_gpio_request hp_en_gpio request ERROR\n", __FUNCTION__); + } + ret = gpio_direction_output(pdata->hp_en_gpio,1); + if(ret < 0){ + printk("%s() gpio_direction_output hp_en_gpio set ERROR\n", __FUNCTION__); + } + } + + //wifi_power_en_gpio + ret = of_get_named_gpio_flags(node, "wifi_power_en_gpio", 0, &flags); + if (ret < 0) { + printk("%s() Can not read property wifi_power_en_gpio\n", __FUNCTION__); + } else { + pdata->wifi_power_en_gpio = ret; + + ret = devm_gpio_request(&pdev->dev, pdata->wifi_power_en_gpio, "wifi_power_en_gpio"); + if(ret < 0){ + printk("%s() devm_gpio_request wifi_power_en_gpio request ERROR\n", __FUNCTION__); + } + ret = gpio_direction_output(pdata->wifi_power_en_gpio,1); + if(ret < 0){ + printk("%s() gpio_direction_output wifi_power_en_gpio set ERROR\n", __FUNCTION__); + } + } + + + //spk_out_gpio + ret = of_get_named_gpio_flags(node, "spk_out_gpio", 0, &flags); + if (ret < 0) { + printk("%s() Can not read property spk_out_gpio\n", __FUNCTION__); + } else { + pdata->spk_out_gpio = ret; + + ret = devm_gpio_request(&pdev->dev, pdata->spk_out_gpio, "spk_out_gpio"); + if(ret < 0){ + printk("%s() devm_gpio_request spk_out_gpio request ERROR\n", __FUNCTION__); + } + ret = gpio_direction_output(pdata->spk_out_gpio,0); + if(ret < 0){ + printk("%s() gpio_direction_output spk_out_gpio set ERROR\n", __FUNCTION__); + } + } //air_mode_4g_gpio ret = of_get_named_gpio_flags(node, "air_mode_4g_gpio", 0, &flags); if (ret < 0) { -- Gitblit v1.6.2