media: i2c: fix compile error when CONFIG_PM is not set

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I3a9d18629c20f543b2d992d9afe62d4b1b721dae
This commit is contained in:
Jianqun Xu
2023-01-31 17:44:58 +08:00
committed by Tao Huang
parent a8c4dcb234
commit 0a6fcdbf81
22 changed files with 54 additions and 42 deletions

View File

@@ -664,8 +664,10 @@ static int cn3927v_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
int dac = dev_vcm->start_current;
struct i2c_client *client = v4l2_get_subdevdata(sd);
#ifdef CONFIG_PM
v4l2_info(sd, "%s: enter, power.usage_count(%d)!\n", __func__,
atomic_read(&sd->dev->power.usage_count));
#endif
rval = pm_runtime_get_sync(sd->dev);
if (rval < 0) {
@@ -693,8 +695,10 @@ static int cn3927v_open(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
cn3927v_set_dac(dev_vcm, dac);
}
#ifdef CONFIG_PM
v4l2_info(sd, "%s: exit, power.usage_count(%d)!\n", __func__,
atomic_read(&sd->dev->power.usage_count));
#endif
return 0;
}
@@ -706,8 +710,10 @@ static int cn3927v_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
unsigned int move_time;
struct i2c_client *client = v4l2_get_subdevdata(sd);
#ifdef CONFIG_PM
v4l2_info(sd, "%s: enter, power.usage_count(%d)!\n", __func__,
atomic_read(&sd->dev->power.usage_count));
#endif
v4l2_dbg(1, debug, sd, "%s: current_lens_pos %d, current_related_pos %d\n",
__func__, dev_vcm->current_lens_pos, dev_vcm->current_related_pos);
@@ -734,8 +740,10 @@ static int cn3927v_close(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh)
pm_runtime_put(sd->dev);
#ifdef CONFIG_PM
v4l2_info(sd, "%s: exit, power.usage_count(%d)!\n", __func__,
atomic_read(&sd->dev->power.usage_count));
#endif
return 0;
}
@@ -1449,8 +1457,10 @@ static int __maybe_unused cn3927v_vcm_suspend(struct device *dev)
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct cn3927v_device *dev_vcm = sd_to_cn3927v_vcm(sd);
#ifdef CONFIG_PM
v4l2_dbg(1, debug, sd, "%s: enter, power.usage_count(%d)!\n", __func__,
atomic_read(&sd->dev->power.usage_count));
#endif
__cn3927v_set_power(dev_vcm, false);
return 0;
@@ -1462,8 +1472,10 @@ static int __maybe_unused cn3927v_vcm_resume(struct device *dev)
struct v4l2_subdev *sd = i2c_get_clientdata(client);
struct cn3927v_device *dev_vcm = sd_to_cn3927v_vcm(sd);
#ifdef CONFIG_PM
v4l2_dbg(1, debug, sd, "%s: enter, power.usage_count(%d)!\n", __func__,
atomic_read(&sd->dev->power.usage_count));
#endif
__cn3927v_set_power(dev_vcm, true);
return 0;

View File

@@ -818,7 +818,7 @@ static int fp5510_remove(struct i2c_client *client)
return 0;
}
static int fp5510_vcm_resume(struct device *dev)
static int __maybe_unused fp5510_vcm_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -830,7 +830,7 @@ static int fp5510_vcm_resume(struct device *dev)
return 0;
}
static int fp5510_vcm_suspend(struct device *dev)
static int __maybe_unused fp5510_vcm_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -1283,7 +1283,7 @@ static const struct v4l2_subdev_ops gc2053_subdev_ops = {
.pad = &gc2053_pad_ops,
};
static int gc2053_runtime_resume(struct device *dev)
static int __maybe_unused gc2053_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1293,7 +1293,7 @@ static int gc2053_runtime_resume(struct device *dev)
return 0;
}
static int gc2053_runtime_suspend(struct device *dev)
static int __maybe_unused gc2053_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -1379,7 +1379,7 @@ static const struct v4l2_subdev_ops gc2093_subdev_ops = {
.pad = &gc2093_pad_ops,
};
static int gc2093_runtime_resume(struct device *dev)
static int __maybe_unused gc2093_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1389,7 +1389,7 @@ static int gc2093_runtime_resume(struct device *dev)
return 0;
}
static int gc2093_runtime_suspend(struct device *dev)
static int __maybe_unused gc2093_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -729,7 +729,7 @@ static void __gc2385_power_off(struct gc2385 *gc2385)
regulator_bulk_disable(GC2385_NUM_SUPPLIES, gc2385->supplies);
}
static int gc2385_runtime_resume(struct device *dev)
static int __maybe_unused gc2385_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -738,7 +738,7 @@ static int gc2385_runtime_resume(struct device *dev)
return __gc2385_power_on(gc2385);
}
static int gc2385_runtime_suspend(struct device *dev)
static int __maybe_unused gc2385_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -2084,7 +2084,7 @@ static void __gc4c33_power_off(struct gc4c33 *gc4c33)
gpiod_set_value_cansleep(gc4c33->pwren_gpio, 0);
}
static int gc4c33_runtime_resume(struct device *dev)
static int __maybe_unused gc4c33_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -2093,7 +2093,7 @@ static int gc4c33_runtime_resume(struct device *dev)
return __gc4c33_power_on(gc4c33);
}
static int gc4c33_runtime_suspend(struct device *dev)
static int __maybe_unused gc4c33_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -2611,7 +2611,7 @@ static void __gc8034_power_off(struct gc8034 *gc8034)
regulator_bulk_disable(GC8034_NUM_SUPPLIES, gc8034->supplies);
}
static int gc8034_runtime_resume(struct device *dev)
static int __maybe_unused gc8034_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -2620,7 +2620,7 @@ static int gc8034_runtime_resume(struct device *dev)
return __gc8034_power_on(gc8034);
}
static int gc8034_runtime_suspend(struct device *dev)
static int __maybe_unused gc8034_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -2131,7 +2131,7 @@ static void __imx415_power_off(struct imx415 *imx415)
regulator_bulk_disable(IMX415_NUM_SUPPLIES, imx415->supplies);
}
static int imx415_runtime_resume(struct device *dev)
static int __maybe_unused imx415_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -2140,7 +2140,7 @@ static int imx415_runtime_resume(struct device *dev)
return __imx415_power_on(imx415);
}
static int imx415_runtime_suspend(struct device *dev)
static int __maybe_unused imx415_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -1929,7 +1929,7 @@ err_free_handler:
return ret;
}
static int nvp6188_runtime_resume(struct device *dev)
static int __maybe_unused nvp6188_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1938,7 +1938,7 @@ static int nvp6188_runtime_resume(struct device *dev)
return __nvp6188_power_on(nvp6188);
}
static int nvp6188_runtime_suspend(struct device *dev)
static int __maybe_unused nvp6188_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -2300,7 +2300,7 @@ static void __os04a10_power_off(struct os04a10 *os04a10)
usleep_range(30000, 31000);
}
static int os04a10_runtime_resume(struct device *dev)
static int __maybe_unused os04a10_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -2309,7 +2309,7 @@ static int os04a10_runtime_resume(struct device *dev)
return __os04a10_power_on(os04a10);
}
static int os04a10_runtime_suspend(struct device *dev)
static int __maybe_unused os04a10_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -923,7 +923,7 @@ static void __ov02b10_power_off(struct ov02b10 *ov02b10)
regulator_bulk_disable(OV02B10_NUM_SUPPLIES, ov02b10->supplies);
}
static int ov02b10_runtime_resume(struct device *dev)
static int __maybe_unused ov02b10_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -932,7 +932,7 @@ static int ov02b10_runtime_resume(struct device *dev)
return __ov02b10_power_on(ov02b10);
}
static int ov02b10_runtime_suspend(struct device *dev)
static int __maybe_unused ov02b10_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -1189,7 +1189,7 @@ static void __ov13850_power_off(struct ov13850 *ov13850)
regulator_bulk_disable(OV13850_NUM_SUPPLIES, ov13850->supplies);
}
static int ov13850_runtime_resume(struct device *dev)
static int __maybe_unused ov13850_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1198,7 +1198,7 @@ static int ov13850_runtime_resume(struct device *dev)
return __ov13850_power_on(ov13850);
}
static int ov13850_runtime_suspend(struct device *dev)
static int __maybe_unused ov13850_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -1512,7 +1512,7 @@ static void __ov13855_power_off(struct ov13855 *ov13855)
regulator_bulk_disable(OV13855_NUM_SUPPLIES, ov13855->supplies);
}
static int ov13855_runtime_resume(struct device *dev)
static int __maybe_unused ov13855_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1521,7 +1521,7 @@ static int ov13855_runtime_resume(struct device *dev)
return __ov13855_power_on(ov13855);
}
static int ov13855_runtime_suspend(struct device *dev)
static int __maybe_unused ov13855_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -6671,7 +6671,7 @@ static void __ov50c40_power_off(struct ov50c40 *ov50c40)
regulator_bulk_disable(OV50C40_NUM_SUPPLIES, ov50c40->supplies);
}
static int ov50c40_runtime_resume(struct device *dev)
static int __maybe_unused ov50c40_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -6680,7 +6680,7 @@ static int ov50c40_runtime_resume(struct device *dev)
return __ov50c40_power_on(ov50c40);
}
static int ov50c40_runtime_suspend(struct device *dev)
static int __maybe_unused ov50c40_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -1105,7 +1105,7 @@ static void __ov5695_power_off(struct ov5695 *ov5695)
regulator_bulk_disable(OV5695_NUM_SUPPLIES, ov5695->supplies);
}
static int ov5695_runtime_resume(struct device *dev)
static int __maybe_unused ov5695_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1114,7 +1114,7 @@ static int ov5695_runtime_resume(struct device *dev)
return __ov5695_power_on(ov5695);
}
static int ov5695_runtime_suspend(struct device *dev)
static int __maybe_unused ov5695_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -2803,7 +2803,7 @@ static void __ov8858_power_off(struct ov8858 *ov8858)
regulator_bulk_disable(OV8858_NUM_SUPPLIES, ov8858->supplies);
}
static int ov8858_runtime_resume(struct device *dev)
static int __maybe_unused ov8858_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -2812,7 +2812,7 @@ static int ov8858_runtime_resume(struct device *dev)
return __ov8858_power_on(ov8858);
}
static int ov8858_runtime_suspend(struct device *dev)
static int __maybe_unused ov8858_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -1015,7 +1015,7 @@ static void __s5k3l6xx_power_off(struct s5k3l6xx *s5k3l6xx)
regulator_bulk_disable(S5K3L6XX_NUM_SUPPLIES, s5k3l6xx->supplies);
}
static int s5k3l6xx_runtime_resume(struct device *dev)
static int __maybe_unused s5k3l6xx_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1024,7 +1024,7 @@ static int s5k3l6xx_runtime_resume(struct device *dev)
return __s5k3l6xx_power_on(s5k3l6xx);
}
static int s5k3l6xx_runtime_suspend(struct device *dev)
static int __maybe_unused s5k3l6xx_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -1764,7 +1764,7 @@ static void __s5kjn1_power_off(struct s5kjn1 *s5kjn1)
regulator_bulk_disable(S5KJN1_NUM_SUPPLIES, s5kjn1->supplies);
}
static int s5kjn1_runtime_resume(struct device *dev)
static int __maybe_unused s5kjn1_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1773,7 +1773,7 @@ static int s5kjn1_runtime_resume(struct device *dev)
return __s5kjn1_power_on(s5kjn1);
}
static int s5kjn1_runtime_suspend(struct device *dev)
static int __maybe_unused s5kjn1_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -1216,7 +1216,7 @@ static void __sc3336_power_off(struct sc3336 *sc3336)
regulator_bulk_disable(SC3336_NUM_SUPPLIES, sc3336->supplies);
}
static int sc3336_runtime_resume(struct device *dev)
static int __maybe_unused sc3336_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1225,7 +1225,7 @@ static int sc3336_runtime_resume(struct device *dev)
return __sc3336_power_on(sc3336);
}
static int sc3336_runtime_suspend(struct device *dev)
static int __maybe_unused sc3336_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -1033,7 +1033,7 @@ static void __sc4336_power_off(struct sc4336 *sc4336)
regulator_bulk_disable(SC4336_NUM_SUPPLIES, sc4336->supplies);
}
static int sc4336_runtime_resume(struct device *dev)
static int __maybe_unused sc4336_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1042,7 +1042,7 @@ static int sc4336_runtime_resume(struct device *dev)
return __sc4336_power_on(sc4336);
}
static int sc4336_runtime_suspend(struct device *dev)
static int __maybe_unused sc4336_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -1507,7 +1507,7 @@ static void __sc530ai_power_off(struct sc530ai *sc530ai)
regulator_bulk_disable(sc530ai_NUM_SUPPLIES, sc530ai->supplies);
}
static int sc530ai_runtime_resume(struct device *dev)
static int __maybe_unused sc530ai_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -1516,7 +1516,7 @@ static int sc530ai_runtime_resume(struct device *dev)
return __sc530ai_power_on(sc530ai);
}
static int sc530ai_runtime_suspend(struct device *dev)
static int __maybe_unused sc530ai_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);

View File

@@ -953,7 +953,7 @@ static void __thcv244_power_off(struct thcv244 *thcv244)
regulator_bulk_disable(THCV244_NUM_SUPPLIES, thcv244->supplies);
}
static int thcv244_runtime_resume(struct device *dev)
static int __maybe_unused thcv244_runtime_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);
@@ -962,7 +962,7 @@ static int thcv244_runtime_resume(struct device *dev)
return __thcv244_power_on(thcv244);
}
static int thcv244_runtime_suspend(struct device *dev)
static int __maybe_unused thcv244_runtime_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
struct v4l2_subdev *sd = i2c_get_clientdata(client);