mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
modify wl2868c driver to adapt new return value
-The '.remove' function return void on new kernel version -modify wl2868c driver to adapt this. Change-Id: I9c37607f4c0588b890c489e5f95054d559ce5233 Signed-off-by: wangxiaofeng <wangxf32@motorola.com> Reviewed-on: https://gerrit.mot.com/2772224 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: <liuyy62@motorola.com> Reviewed-by: Zhichao Chen <chenzc2@motorola.com> Reviewed-by: wangdp11 <wangdp11@motorola.com> Reviewed-by: Pengfei Qiao <qiaopf1@motorola.com> Reviewed-by: Zhenxin Xi <xizx@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
ca67639019
commit
ca226dcb12
1 changed files with 20 additions and 0 deletions
|
|
@ -19,6 +19,7 @@
|
|||
#include <linux/regulator/driver.h>
|
||||
#include <linux/regulator/machine.h>
|
||||
#include <linux/regulator/of_regulator.h>
|
||||
#include <linux/version.h>
|
||||
#include "wl2868c-regulator.h"
|
||||
static int ldo_chipid = -1;
|
||||
enum slg51000_regulators {
|
||||
|
|
@ -442,6 +443,24 @@ static void wl2868c_i2c_shutdown(struct i2c_client *client)
|
|||
}
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
|
||||
static void wl2868c_i2c_remove(struct i2c_client *client)
|
||||
{
|
||||
struct wl2868c *chip = i2c_get_clientdata(client);
|
||||
struct gpio_desc *desc;
|
||||
|
||||
if (chip->chip_cs_pin > 0) {
|
||||
desc = gpio_to_desc(chip->chip_cs_pin);
|
||||
gpiod_direction_output_raw(desc, GPIOF_INIT_LOW);
|
||||
}
|
||||
|
||||
if (NULL != chip->vio_reg) {
|
||||
regulator_disable(chip->vio_reg);
|
||||
regulator_put(chip->vio_reg);
|
||||
}
|
||||
|
||||
}
|
||||
#else
|
||||
static int wl2868c_i2c_remove(struct i2c_client *client)
|
||||
{
|
||||
struct wl2868c *chip = i2c_get_clientdata(client);
|
||||
|
|
@ -460,6 +479,7 @@ static int wl2868c_i2c_remove(struct i2c_client *client)
|
|||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct i2c_device_id wl2868c_i2c_id[] = {
|
||||
{"wl2868c", 0},
|
||||
|
|
|
|||
Loading…
Reference in a new issue