[media] smiapp: Remove set_xclk() callback from hwconfig
authorSakari Ailus <sakari.ailus@linux.intel.com>
Wed, 31 Aug 2016 12:38:54 +0000 (09:38 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 5 Sep 2016 18:53:20 +0000 (15:53 -0300)
The clock framework is generally so well supported that there's no reason
to keep this one around.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/i2c/smiapp/smiapp-core.c
include/media/i2c/smiapp.h

index 061f44a611c13016b1b4810d244259ef6c47f4c6..d8b78c678f77515394f3779d8413cfae0300ae6e 100644 (file)
@@ -1201,11 +1201,7 @@ static int smiapp_power_on(struct smiapp_sensor *sensor)
        }
        usleep_range(1000, 1000);
 
-       if (sensor->hwcfg->set_xclk)
-               rval = sensor->hwcfg->set_xclk(
-                       &sensor->src->sd, sensor->hwcfg->ext_clk);
-       else
-               rval = clk_prepare_enable(sensor->ext_clk);
+       rval = clk_prepare_enable(sensor->ext_clk);
        if (rval < 0) {
                dev_dbg(&client->dev, "failed to enable xclk\n");
                goto out_xclk_fail;
@@ -1322,10 +1318,7 @@ static int smiapp_power_on(struct smiapp_sensor *sensor)
 
 out_cci_addr_fail:
        gpiod_set_value(sensor->xshutdown, 0);
-       if (sensor->hwcfg->set_xclk)
-               sensor->hwcfg->set_xclk(&sensor->src->sd, 0);
-       else
-               clk_disable_unprepare(sensor->ext_clk);
+       clk_disable_unprepare(sensor->ext_clk);
 
 out_xclk_fail:
        regulator_disable(sensor->vana);
@@ -1347,10 +1340,7 @@ static void smiapp_power_off(struct smiapp_sensor *sensor)
                             SMIAPP_SOFTWARE_RESET);
 
        gpiod_set_value(sensor->xshutdown, 0);
-       if (sensor->hwcfg->set_xclk)
-               sensor->hwcfg->set_xclk(&sensor->src->sd, 0);
-       else
-               clk_disable_unprepare(sensor->ext_clk);
+       clk_disable_unprepare(sensor->ext_clk);
        usleep_range(5000, 5000);
        regulator_disable(sensor->vana);
        sensor->streaming = false;
@@ -2551,22 +2541,20 @@ static int smiapp_init(struct smiapp_sensor *sensor)
                return PTR_ERR(sensor->vana);
        }
 
-       if (!sensor->hwcfg->set_xclk) {
-               sensor->ext_clk = devm_clk_get(&client->dev, NULL);
-               if (IS_ERR(sensor->ext_clk)) {
-                       dev_err(&client->dev, "could not get clock (%ld)\n",
-                               PTR_ERR(sensor->ext_clk));
-                       return -EPROBE_DEFER;
-               }
+       sensor->ext_clk = devm_clk_get(&client->dev, NULL);
+       if (IS_ERR(sensor->ext_clk)) {
+               dev_err(&client->dev, "could not get clock (%ld)\n",
+                       PTR_ERR(sensor->ext_clk));
+               return -EPROBE_DEFER;
+       }
 
-               rval = clk_set_rate(sensor->ext_clk,
-                                   sensor->hwcfg->ext_clk);
-               if (rval < 0) {
-                       dev_err(&client->dev,
-                               "unable to set clock freq to %u\n",
-                               sensor->hwcfg->ext_clk);
-                       return rval;
-               }
+       rval = clk_set_rate(sensor->ext_clk,
+                           sensor->hwcfg->ext_clk);
+       if (rval < 0) {
+               dev_err(&client->dev,
+                       "unable to set clock freq to %u\n",
+                       sensor->hwcfg->ext_clk);
+               return rval;
        }
 
        sensor->xshutdown = devm_gpiod_get_optional(&client->dev, "xshutdown",
@@ -3108,10 +3096,7 @@ static int smiapp_remove(struct i2c_client *client)
 
        if (sensor->power_count) {
                gpiod_set_value(sensor->xshutdown, 0);
-               if (sensor->hwcfg->set_xclk)
-                       sensor->hwcfg->set_xclk(&sensor->src->sd, 0);
-               else
-                       clk_disable_unprepare(sensor->ext_clk);
+               clk_disable_unprepare(sensor->ext_clk);
                sensor->power_count = 0;
        }
 
index eacc3f4e3deb8dbc76c1e5be4544418e55205696..635007e7441a9f5695771683351e85a59b794e5c 100644 (file)
@@ -73,8 +73,6 @@ struct smiapp_hwconfig {
        enum smiapp_module_board_orient module_board_orient;
 
        struct smiapp_flash_strobe_parms *strobe_setup;
-
-       int (*set_xclk)(struct v4l2_subdev *sd, int hz);
 };
 
 #endif /* __SMIAPP_H_  */