dev->fmt_idx = 0;
v4l2_i2c_subdev_init(&(dev->sd), client, &gc0310_ops);
- if (ACPI_COMPANION(&client->dev))
- pdata = gmin_camera_platform_data(&dev->sd,
- ATOMISP_INPUT_FORMAT_RAW_8,
- atomisp_bayer_order_grbg);
- else
- pdata = client->dev.platform_data;
-
+ pdata = gmin_camera_platform_data(&dev->sd,
+ ATOMISP_INPUT_FORMAT_RAW_8,
+ atomisp_bayer_order_grbg);
if (!pdata) {
ret = -EINVAL;
goto out_free;
dev->fmt_idx = 0;
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_bayer_order_grbg);
if (ret)
gc2235_remove(client);
- if (ACPI_HANDLE(&client->dev))
- ret = atomisp_register_i2c_module(&dev->sd, gcpdev, RAW_CAMERA);
+ return atomisp_register_i2c_module(&dev->sd, gcpdev, RAW_CAMERA);
- return ret;
out_free:
v4l2_device_unregister_subdev(&dev->sd);
kfree(dev);
{
static struct lm3554_platform_data platform_data;
- if (ACPI_COMPANION(&client->dev)) {
- platform_data.gpio_reset =
- desc_to_gpio(gpiod_get_index(&(client->dev),
+ platform_data.gpio_reset =
+ desc_to_gpio(gpiod_get_index(&client->dev,
NULL, 2, GPIOD_OUT_LOW));
- platform_data.gpio_strobe =
- desc_to_gpio(gpiod_get_index(&(client->dev),
+ platform_data.gpio_strobe =
+ desc_to_gpio(gpiod_get_index(&client->dev,
NULL, 0, GPIOD_OUT_LOW));
- platform_data.gpio_torch =
- desc_to_gpio(gpiod_get_index(&(client->dev),
+ platform_data.gpio_torch =
+ desc_to_gpio(gpiod_get_index(&client->dev,
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",
platform_data.gpio_reset, platform_data.gpio_strobe,
platform_data.gpio_torch);
if (!flash)
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);
flash->sd.internal_ops = &lm3554_internal_ops;
dev_err(&client->dev, "gpio request/direction_output fail");
goto fail2;
}
- if (ACPI_HANDLE(&client->dev))
- err = atomisp_register_i2c_module(&flash->sd, NULL, LED_FLASH);
- return 0;
+ return atomisp_register_i2c_module(&flash->sd, NULL, LED_FLASH);
fail2:
media_entity_cleanup(&flash->sd.entity);
v4l2_ctrl_handler_free(&flash->ctrl_handler);
return -ENOMEM;
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,
- ATOMISP_INPUT_FORMAT_RAW_10,
- atomisp_bayer_order_grbg);
+ pdata = gmin_camera_platform_data(&dev->sd,
+ ATOMISP_INPUT_FORMAT_RAW_10,
+ atomisp_bayer_order_grbg);
if (pdata)
ret = mt9m114_s_config(&dev->sd, client->irq, pdata);
if (!pdata || ret) {
dev->fmt_idx = 0;
v4l2_i2c_subdev_init(&(dev->sd), client, &ov2680_ops);
- if (ACPI_COMPANION(&client->dev))
- pdata = gmin_camera_platform_data(&dev->sd,
- ATOMISP_INPUT_FORMAT_RAW_10,
- atomisp_bayer_order_bggr);
- else
- pdata = client->dev.platform_data;
-
+ pdata = gmin_camera_platform_data(&dev->sd,
+ ATOMISP_INPUT_FORMAT_RAW_10,
+ atomisp_bayer_order_bggr);
if (!pdata) {
ret = -EINVAL;
goto out_free;
struct ov2722_device *dev;
void *ovpdev;
int ret;
- struct acpi_device *adev;
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev)
dev->fmt_idx = 0;
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,
- ATOMISP_INPUT_FORMAT_RAW_10,
- atomisp_bayer_order_grbg);
- }
+ ovpdev = gmin_camera_platform_data(&dev->sd,
+ ATOMISP_INPUT_FORMAT_RAW_10,
+ atomisp_bayer_order_grbg);
ret = ov2722_s_config(&dev->sd, client->irq, ovpdev);
if (ret)
if (ret)
ov2722_remove(client);
- if (ACPI_HANDLE(&client->dev))
- ret = atomisp_register_i2c_module(&dev->sd, ovpdev, RAW_CAMERA);
-
- return ret;
+ return atomisp_register_i2c_module(&dev->sd, ovpdev, RAW_CAMERA);
out_ctrl_handler_free:
v4l2_ctrl_handler_free(&dev->ctrl_handler);
int i2c;
int ret = 0;
void *pdata = client->dev.platform_data;
- struct acpi_device *adev;
unsigned int i;
/*
dev->fmt_idx = 0;
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,
- ATOMISP_INPUT_FORMAT_RAW_10,
- atomisp_bayer_order_bggr);
- }
-
+ pdata = gmin_camera_platform_data(&dev->sd,
+ ATOMISP_INPUT_FORMAT_RAW_10,
+ atomisp_bayer_order_bggr);
if (!pdata)
goto out_free;
v4l2_i2c_subdev_init(&(dev->sd), client, &ov8858_ops);
- if (ACPI_COMPANION(&client->dev)) {
- pdata = gmin_camera_platform_data(&dev->sd,
- ATOMISP_INPUT_FORMAT_RAW_10,
- atomisp_bayer_order_bggr);
- if (!pdata) {
- dev_err(&client->dev,
- "%s: failed to get acpi platform data\n",
- __func__);
- goto out_free;
- }
- ret = ov8858_s_config(&dev->sd, client->irq, pdata);
- if (ret) {
- dev_err(&client->dev,
- "%s: failed to set config\n", __func__);
- goto out_free;
- }
- ret = atomisp_register_i2c_module(&dev->sd, pdata, RAW_CAMERA);
- if (ret) {
- dev_err(&client->dev,
- "%s: failed to register subdev\n", __func__);
- goto out_free;
- }
+ pdata = gmin_camera_platform_data(&dev->sd,
+ ATOMISP_INPUT_FORMAT_RAW_10,
+ atomisp_bayer_order_bggr);
+ if (!pdata) {
+ dev_err(&client->dev,
+ "%s: failed to get acpi platform data\n",
+ __func__);
+ goto out_free;
+ }
+ ret = ov8858_s_config(&dev->sd, client->irq, pdata);
+ if (ret) {
+ dev_err(&client->dev,
+ "%s: failed to set config\n", __func__);
+ goto out_free;
}
+ ret = atomisp_register_i2c_module(&dev->sd, pdata, RAW_CAMERA);
+ if (ret) {
+ dev_err(&client->dev,
+ "%s: failed to register subdev\n", __func__);
+ goto out_free;
+ }
+
/*
* sd->name is updated with sensor driver name by the v4l2.
* change it to sensor name in this case.
struct i2c_board_info *bi;
struct gmin_subdev *gs;
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);
* tickled during suspend/resume. This has caused power and
* 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++)
if (!pdata.subdevs[i].type)