mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
ledring: modify ioctl support 32bit and 64bit
PD#157849: modify ioctl support 32bit and 64bit Change-Id: I2f2395110454a2a05ec089601a937a1c884fa800 Signed-off-by: Renjun Xu <renjun.xu@amlogic.com>
This commit is contained in:
@@ -14245,3 +14245,8 @@ AMLOGIC LEDRING DRIVER
|
||||
M: Renjun Xu <renjun.xu@amlogic.com>
|
||||
F: drivers/amlogic/ledring/aml-is31fl32xx.c
|
||||
F: drivers/amlogic/ledring/aml-pca9557.c
|
||||
|
||||
AMLOGIC LEDRING DRIVER IOCTL
|
||||
M: Renjun Xu <renjun.xu@amlogic.com>
|
||||
F: drivers/amlogic/ledring/aml-is31fl32xx.c
|
||||
F: drivers/amlogic/ledring/aml-pca9557.c
|
||||
|
||||
@@ -685,6 +685,7 @@ static void setup_timer_task(void)
|
||||
static const struct file_operations is31fl32xx_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.compat_ioctl = is31fl32xx_ioctl,
|
||||
.unlocked_ioctl = is31fl32xx_ioctl,
|
||||
};
|
||||
|
||||
static int is31fl32xx_probe(struct i2c_client *client,
|
||||
@@ -694,7 +695,8 @@ static int is31fl32xx_probe(struct i2c_client *client,
|
||||
const struct of_device_id *of_dev_id;
|
||||
struct device *dev = &client->dev;
|
||||
struct is31fl32xx_priv *priv;
|
||||
int count;
|
||||
int count, i;
|
||||
int try_times = 0;
|
||||
int ret = 0;
|
||||
|
||||
pr_info("%s\n",__func__);
|
||||
@@ -725,11 +727,14 @@ static int is31fl32xx_probe(struct i2c_client *client,
|
||||
priv->client = client;
|
||||
priv->cdef = cdef;
|
||||
i2c_set_clientdata(client, priv);
|
||||
|
||||
ret = is31fl32xx_init_regs(priv);
|
||||
if (ret)
|
||||
goto err1;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
ret = is31fl32xx_init_regs(priv);
|
||||
if (ret) {
|
||||
if (++try_times >= 3)
|
||||
goto err1;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
ret = is31fl32xx_parse_dt(dev, priv);
|
||||
if (ret)
|
||||
goto err1;
|
||||
|
||||
@@ -437,6 +437,7 @@ static const struct file_operations led_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.read = leds_read,
|
||||
.compat_ioctl = leds_ioctl,
|
||||
.unlocked_ioctl = leds_ioctl,
|
||||
};
|
||||
|
||||
static int ledring_parse_child_dt(const struct device *dev, int *mode)
|
||||
@@ -493,7 +494,8 @@ static int ledring_parse_child_dt(const struct device *dev, int *mode)
|
||||
static int ledring_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *i2c_id)
|
||||
{
|
||||
int ret,i;
|
||||
int ret, i;
|
||||
int try_times = 0;
|
||||
struct device *dev = &client->dev;
|
||||
|
||||
g_client = client;
|
||||
@@ -516,14 +518,23 @@ static int ledring_probe(struct i2c_client *client,
|
||||
if (ret)
|
||||
goto err1;
|
||||
key_led_des->run_time = DEFAULT_SPEED;
|
||||
ret = leds_init(key_led_des->mode);
|
||||
if (ret < 0) {
|
||||
goto err1;
|
||||
for (i = 0; i < 3; i++) {
|
||||
ret = leds_init(key_led_des->mode);
|
||||
if (ret != 0) {
|
||||
if (++try_times >= 3)
|
||||
goto err1;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
ret = leds_init(key_led_des->mode);
|
||||
if (ret < 0)
|
||||
goto err3;
|
||||
for (i = 0; i < 3; i++) {
|
||||
ret = leds_init(key_led_des->mode);
|
||||
if (ret != 0) {
|
||||
if (++try_times >= 3)
|
||||
goto err3;
|
||||
} else
|
||||
break;
|
||||
}
|
||||
key_led_des->pca_input_dev = input_allocate_device();
|
||||
if (key_led_des->pca_input_dev == NULL) {
|
||||
pr_err("input_allocate_device err!\n");
|
||||
|
||||
Reference in New Issue
Block a user