Re: [PATCH 7/9] media: atomisp: gc0310: Remove gc0310_s_config() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 18, 2023 at 6:32 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>
> gc0310_s_config() used to call camera_sensor_platform_data.csi_cfg() back
> when the gc0310 driver was still using the atomisp_gmin_platform code
> for power-management.
>
> Now it is just a weirdly named wrapper around gc0310_detect(), drop
> gc0310_s_config() and make probe() call gc0310_detect() directly.

...

> -       ret = i2c_smbus_read_word_swapped(client, GC0310_SC_CMMN_CHIP_ID_H);
> +       ret = pm_runtime_get_sync(&client->dev);
> +       if (ret >= 0)
> +               ret = i2c_smbus_read_word_swapped(client, GC0310_SC_CMMN_CHIP_ID_H);
> +       pm_runtime_put(&client->dev);
>         if (ret < 0) {
>                 dev_err(&client->dev, "read sensor_id failed: %d\n", ret);
>                 return -ENODEV;

Not sure if it's good to have in this patch, but above can be cleaned up to

      pm_runtime_get_sync(&client->dev);
      ret = i2c_smbus_read_word_swapped(client, GC0310_SC_CMMN_CHIP_ID_H);
      pm_runtime_put(&client->dev);
      if (ret < 0) {
               dev_err(&client->dev, "read sensor_id failed: %d\n", ret);
               return ret;
      }

But I don't know what will be the response on the I2C bus if the
device is powered off.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux