Commit 9e993ed0 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mauro Carvalho Chehab

media: staging: atomisp: Remove non-ACPI leftovers

Since all drivers are solely requiring ACPI enumeration, there is no
need to additionally check for legacy platform data or ACPI handle.

Remove leftovers from the sensors and platform code.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent cb02ae3d
...@@ -1370,13 +1370,9 @@ static int gc0310_probe(struct i2c_client *client) ...@@ -1370,13 +1370,9 @@ static int gc0310_probe(struct i2c_client *client)
dev->fmt_idx = 0; dev->fmt_idx = 0;
v4l2_i2c_subdev_init(&(dev->sd), client, &gc0310_ops); v4l2_i2c_subdev_init(&(dev->sd), client, &gc0310_ops);
if (ACPI_COMPANION(&client->dev))
pdata = gmin_camera_platform_data(&dev->sd, pdata = gmin_camera_platform_data(&dev->sd,
ATOMISP_INPUT_FORMAT_RAW_8, ATOMISP_INPUT_FORMAT_RAW_8,
atomisp_bayer_order_grbg); atomisp_bayer_order_grbg);
else
pdata = client->dev.platform_data;
if (!pdata) { if (!pdata) {
ret = -EINVAL; ret = -EINVAL;
goto out_free; goto out_free;
......
...@@ -1108,8 +1108,6 @@ static int gc2235_probe(struct i2c_client *client) ...@@ -1108,8 +1108,6 @@ static int gc2235_probe(struct i2c_client *client)
dev->fmt_idx = 0; dev->fmt_idx = 0;
v4l2_i2c_subdev_init(&(dev->sd), client, &gc2235_ops); v4l2_i2c_subdev_init(&(dev->sd), client, &gc2235_ops);
gcpdev = client->dev.platform_data;
if (ACPI_COMPANION(&client->dev))
gcpdev = gmin_camera_platform_data(&dev->sd, gcpdev = gmin_camera_platform_data(&dev->sd,
ATOMISP_INPUT_FORMAT_RAW_10, ATOMISP_INPUT_FORMAT_RAW_10,
atomisp_bayer_order_grbg); atomisp_bayer_order_grbg);
...@@ -1147,10 +1145,8 @@ static int gc2235_probe(struct i2c_client *client) ...@@ -1147,10 +1145,8 @@ static int gc2235_probe(struct i2c_client *client)
if (ret) if (ret)
gc2235_remove(client); gc2235_remove(client);
if (ACPI_HANDLE(&client->dev)) return atomisp_register_i2c_module(&dev->sd, gcpdev, RAW_CAMERA);
ret = atomisp_register_i2c_module(&dev->sd, gcpdev, RAW_CAMERA);
return ret;
out_free: out_free:
v4l2_device_unregister_subdev(&dev->sd); v4l2_device_unregister_subdev(&dev->sd);
kfree(dev); kfree(dev);
......
...@@ -824,22 +824,15 @@ static void *lm3554_platform_data_func(struct i2c_client *client) ...@@ -824,22 +824,15 @@ static void *lm3554_platform_data_func(struct i2c_client *client)
{ {
static struct lm3554_platform_data platform_data; static struct lm3554_platform_data platform_data;
if (ACPI_COMPANION(&client->dev)) {
platform_data.gpio_reset = platform_data.gpio_reset =
desc_to_gpio(gpiod_get_index(&(client->dev), desc_to_gpio(gpiod_get_index(&client->dev,
NULL, 2, GPIOD_OUT_LOW)); NULL, 2, GPIOD_OUT_LOW));
platform_data.gpio_strobe = platform_data.gpio_strobe =
desc_to_gpio(gpiod_get_index(&(client->dev), desc_to_gpio(gpiod_get_index(&client->dev,
NULL, 0, GPIOD_OUT_LOW)); NULL, 0, GPIOD_OUT_LOW));
platform_data.gpio_torch = platform_data.gpio_torch =
desc_to_gpio(gpiod_get_index(&(client->dev), desc_to_gpio(gpiod_get_index(&client->dev,
NULL, 1, GPIOD_OUT_LOW)); NULL, 1, GPIOD_OUT_LOW));
} else {
platform_data.gpio_reset = -1;
platform_data.gpio_strobe = -1;
platform_data.gpio_torch = -1;
}
dev_info(&client->dev, "camera pdata: lm3554: reset: %d strobe %d torch %d\n", dev_info(&client->dev, "camera pdata: lm3554: reset: %d strobe %d torch %d\n",
platform_data.gpio_reset, platform_data.gpio_strobe, platform_data.gpio_reset, platform_data.gpio_strobe,
platform_data.gpio_torch); platform_data.gpio_torch);
...@@ -868,9 +861,6 @@ static int lm3554_probe(struct i2c_client *client) ...@@ -868,9 +861,6 @@ static int lm3554_probe(struct i2c_client *client)
if (!flash) if (!flash)
return -ENOMEM; return -ENOMEM;
flash->pdata = client->dev.platform_data;
if (!flash->pdata || ACPI_COMPANION(&client->dev))
flash->pdata = lm3554_platform_data_func(client); flash->pdata = lm3554_platform_data_func(client);
v4l2_i2c_subdev_init(&flash->sd, client, &lm3554_ops); v4l2_i2c_subdev_init(&flash->sd, client, &lm3554_ops);
...@@ -914,9 +904,7 @@ static int lm3554_probe(struct i2c_client *client) ...@@ -914,9 +904,7 @@ static int lm3554_probe(struct i2c_client *client)
dev_err(&client->dev, "gpio request/direction_output fail"); dev_err(&client->dev, "gpio request/direction_output fail");
goto fail2; goto fail2;
} }
if (ACPI_HANDLE(&client->dev)) return atomisp_register_i2c_module(&flash->sd, NULL, LED_FLASH);
err = atomisp_register_i2c_module(&flash->sd, NULL, LED_FLASH);
return 0;
fail2: fail2:
media_entity_cleanup(&flash->sd.entity); media_entity_cleanup(&flash->sd.entity);
v4l2_ctrl_handler_free(&flash->ctrl_handler); v4l2_ctrl_handler_free(&flash->ctrl_handler);
......
...@@ -1844,8 +1844,6 @@ static int mt9m114_probe(struct i2c_client *client) ...@@ -1844,8 +1844,6 @@ static int mt9m114_probe(struct i2c_client *client)
return -ENOMEM; return -ENOMEM;
v4l2_i2c_subdev_init(&dev->sd, client, &mt9m114_ops); v4l2_i2c_subdev_init(&dev->sd, client, &mt9m114_ops);
pdata = client->dev.platform_data;
if (ACPI_COMPANION(&client->dev))
pdata = gmin_camera_platform_data(&dev->sd, pdata = gmin_camera_platform_data(&dev->sd,
ATOMISP_INPUT_FORMAT_RAW_10, ATOMISP_INPUT_FORMAT_RAW_10,
atomisp_bayer_order_grbg); atomisp_bayer_order_grbg);
......
...@@ -1447,13 +1447,9 @@ static int ov2680_probe(struct i2c_client *client) ...@@ -1447,13 +1447,9 @@ static int ov2680_probe(struct i2c_client *client)
dev->fmt_idx = 0; dev->fmt_idx = 0;
v4l2_i2c_subdev_init(&(dev->sd), client, &ov2680_ops); v4l2_i2c_subdev_init(&(dev->sd), client, &ov2680_ops);
if (ACPI_COMPANION(&client->dev))
pdata = gmin_camera_platform_data(&dev->sd, pdata = gmin_camera_platform_data(&dev->sd,
ATOMISP_INPUT_FORMAT_RAW_10, ATOMISP_INPUT_FORMAT_RAW_10,
atomisp_bayer_order_bggr); atomisp_bayer_order_bggr);
else
pdata = client->dev.platform_data;
if (!pdata) { if (!pdata) {
ret = -EINVAL; ret = -EINVAL;
goto out_free; goto out_free;
......
...@@ -1259,7 +1259,6 @@ static int ov2722_probe(struct i2c_client *client) ...@@ -1259,7 +1259,6 @@ static int ov2722_probe(struct i2c_client *client)
struct ov2722_device *dev; struct ov2722_device *dev;
void *ovpdev; void *ovpdev;
int ret; int ret;
struct acpi_device *adev;
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) if (!dev)
...@@ -1270,14 +1269,9 @@ static int ov2722_probe(struct i2c_client *client) ...@@ -1270,14 +1269,9 @@ static int ov2722_probe(struct i2c_client *client)
dev->fmt_idx = 0; dev->fmt_idx = 0;
v4l2_i2c_subdev_init(&(dev->sd), client, &ov2722_ops); v4l2_i2c_subdev_init(&(dev->sd), client, &ov2722_ops);
ovpdev = client->dev.platform_data;
adev = ACPI_COMPANION(&client->dev);
if (adev) {
adev->power.flags.power_resources = 0;
ovpdev = gmin_camera_platform_data(&dev->sd, ovpdev = gmin_camera_platform_data(&dev->sd,
ATOMISP_INPUT_FORMAT_RAW_10, ATOMISP_INPUT_FORMAT_RAW_10,
atomisp_bayer_order_grbg); atomisp_bayer_order_grbg);
}
ret = ov2722_s_config(&dev->sd, client->irq, ovpdev); ret = ov2722_s_config(&dev->sd, client->irq, ovpdev);
if (ret) if (ret)
...@@ -1296,10 +1290,7 @@ static int ov2722_probe(struct i2c_client *client) ...@@ -1296,10 +1290,7 @@ static int ov2722_probe(struct i2c_client *client)
if (ret) if (ret)
ov2722_remove(client); ov2722_remove(client);
if (ACPI_HANDLE(&client->dev)) return atomisp_register_i2c_module(&dev->sd, ovpdev, RAW_CAMERA);
ret = atomisp_register_i2c_module(&dev->sd, ovpdev, RAW_CAMERA);
return ret;
out_ctrl_handler_free: out_ctrl_handler_free:
v4l2_ctrl_handler_free(&dev->ctrl_handler); v4l2_ctrl_handler_free(&dev->ctrl_handler);
......
...@@ -1948,7 +1948,6 @@ static int ov5693_probe(struct i2c_client *client) ...@@ -1948,7 +1948,6 @@ static int ov5693_probe(struct i2c_client *client)
int i2c; int i2c;
int ret = 0; int ret = 0;
void *pdata = client->dev.platform_data; void *pdata = client->dev.platform_data;
struct acpi_device *adev;
unsigned int i; unsigned int i;
/* /*
...@@ -1974,14 +1973,9 @@ static int ov5693_probe(struct i2c_client *client) ...@@ -1974,14 +1973,9 @@ static int ov5693_probe(struct i2c_client *client)
dev->fmt_idx = 0; dev->fmt_idx = 0;
v4l2_i2c_subdev_init(&(dev->sd), client, &ov5693_ops); v4l2_i2c_subdev_init(&(dev->sd), client, &ov5693_ops);
adev = ACPI_COMPANION(&client->dev);
if (adev) {
adev->power.flags.power_resources = 0;
pdata = gmin_camera_platform_data(&dev->sd, pdata = gmin_camera_platform_data(&dev->sd,
ATOMISP_INPUT_FORMAT_RAW_10, ATOMISP_INPUT_FORMAT_RAW_10,
atomisp_bayer_order_bggr); atomisp_bayer_order_bggr);
}
if (!pdata) if (!pdata)
goto out_free; goto out_free;
......
...@@ -2077,7 +2077,6 @@ static int ov8858_probe(struct i2c_client *client) ...@@ -2077,7 +2077,6 @@ static int ov8858_probe(struct i2c_client *client)
v4l2_i2c_subdev_init(&(dev->sd), client, &ov8858_ops); v4l2_i2c_subdev_init(&(dev->sd), client, &ov8858_ops);
if (ACPI_COMPANION(&client->dev)) {
pdata = gmin_camera_platform_data(&dev->sd, pdata = gmin_camera_platform_data(&dev->sd,
ATOMISP_INPUT_FORMAT_RAW_10, ATOMISP_INPUT_FORMAT_RAW_10,
atomisp_bayer_order_bggr); atomisp_bayer_order_bggr);
...@@ -2099,7 +2098,7 @@ static int ov8858_probe(struct i2c_client *client) ...@@ -2099,7 +2098,7 @@ static int ov8858_probe(struct i2c_client *client)
"%s: failed to register subdev\n", __func__); "%s: failed to register subdev\n", __func__);
goto out_free; goto out_free;
} }
}
/* /*
* sd->name is updated with sensor driver name by the v4l2. * sd->name is updated with sensor driver name by the v4l2.
* change it to sensor name in this case. * change it to sensor name in this case.
......
...@@ -114,7 +114,7 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev, ...@@ -114,7 +114,7 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
struct i2c_board_info *bi; struct i2c_board_info *bi;
struct gmin_subdev *gs; struct gmin_subdev *gs;
struct i2c_client *client = v4l2_get_subdevdata(subdev); struct i2c_client *client = v4l2_get_subdevdata(subdev);
struct acpi_device *adev; struct acpi_device *adev = ACPI_COMPANION(&client->dev);
dev_info(&client->dev, "register atomisp i2c module type %d\n", type); dev_info(&client->dev, "register atomisp i2c module type %d\n", type);
...@@ -124,8 +124,6 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev, ...@@ -124,8 +124,6 @@ int atomisp_register_i2c_module(struct v4l2_subdev *subdev,
* tickled during suspend/resume. This has caused power and * tickled during suspend/resume. This has caused power and
* performance issues on multiple devices. * performance issues on multiple devices.
*/ */
adev = ACPI_COMPANION(&client->dev);
if (adev)
adev->power.flags.power_resources = 0; adev->power.flags.power_resources = 0;
for (i = 0; i < MAX_SUBDEVS; i++) for (i = 0; i < MAX_SUBDEVS; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment