media: i2c: imx283: Drop runtime suspend/resume functions

The imx283_runtime_suspend and imx283_runtime_resume functions
simply call imx283_power_off and imx283_power_on, respectively.
Since these functions do not add any additional logic, they are
unnecessary and can be removed.

Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
This commit is contained in:
Tarang Raval 2025-02-24 16:35:54 +05:30 committed by Hans Verkuil
parent 2256456c26
commit 5b1ea9af99

View File

@ -1170,8 +1170,10 @@ static int imx283_disable_streams(struct v4l2_subdev *sd,
}
/* Power/clock management functions */
static int imx283_power_on(struct imx283 *imx283)
static int imx283_power_on(struct device *dev)
{
struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct imx283 *imx283 = to_imx283(sd);
int ret;
ret = regulator_bulk_enable(ARRAY_SIZE(imx283_supply_name),
@ -1199,8 +1201,11 @@ static int imx283_power_on(struct imx283 *imx283)
return ret;
}
static int imx283_power_off(struct imx283 *imx283)
static int imx283_power_off(struct device *dev)
{
struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct imx283 *imx283 = to_imx283(sd);
gpiod_set_value_cansleep(imx283->reset_gpio, 1);
regulator_bulk_disable(ARRAY_SIZE(imx283_supply_name), imx283->supplies);
clk_disable_unprepare(imx283->xclk);
@ -1208,24 +1213,6 @@ static int imx283_power_off(struct imx283 *imx283)
return 0;
}
static int imx283_runtime_resume(struct device *dev)
{
struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct imx283 *imx283 = to_imx283(sd);
return imx283_power_on(imx283);
}
static int imx283_runtime_suspend(struct device *dev)
{
struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct imx283 *imx283 = to_imx283(sd);
imx283_power_off(imx283);
return 0;
}
static int imx283_get_regulators(struct imx283 *imx283)
{
unsigned int i;
@ -1516,7 +1503,7 @@ static int imx283_probe(struct i2c_client *client)
* The sensor must be powered for imx283_identify_module()
* to be able to read the CHIP_ID register
*/
ret = imx283_power_on(imx283);
ret = imx283_power_on(imx283->dev);
if (ret)
return ret;
@ -1589,7 +1576,7 @@ static int imx283_probe(struct i2c_client *client)
pm_runtime_disable(imx283->dev);
pm_runtime_set_suspended(imx283->dev);
error_power_off:
imx283_power_off(imx283);
imx283_power_off(imx283->dev);
return ret;
}
@ -1606,12 +1593,12 @@ static void imx283_remove(struct i2c_client *client)
pm_runtime_disable(imx283->dev);
if (!pm_runtime_status_suspended(imx283->dev))
imx283_power_off(imx283);
imx283_power_off(imx283->dev);
pm_runtime_set_suspended(imx283->dev);
}
static DEFINE_RUNTIME_DEV_PM_OPS(imx283_pm_ops, imx283_runtime_suspend,
imx283_runtime_resume, NULL);
static DEFINE_RUNTIME_DEV_PM_OPS(imx283_pm_ops, imx283_power_off,
imx283_power_on, NULL);
static const struct of_device_id imx283_dt_ids[] = {
{ .compatible = "sony,imx283" },