]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: i2c: et8ek8: Drop support for per-mode external clock frequency
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Tue, 12 Aug 2025 21:45:54 +0000 (00:45 +0300)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 9 Sep 2025 13:59:19 +0000 (15:59 +0200)
The et8ek8 driver supports programming different external clock
frequencies for different modes, but in practice all modes use a 9.6MHz
external clock. Drop support for this feature and use a hardcoded
frequency, in preparation for further refactoring of external clock
handling.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/i2c/et8ek8/et8ek8_driver.c
drivers/media/i2c/et8ek8/et8ek8_mode.c
drivers/media/i2c/et8ek8/et8ek8_reg.h

index 4787b2c430f8e0da4e475391d1f6cf4f504c8302..d46fe7a0eec2c91befc510b2bccaef00b0d905c8 100644 (file)
@@ -816,7 +816,7 @@ static int et8ek8_power_on(struct et8ek8_sensor *sensor)
 {
        struct v4l2_subdev *subdev = &sensor->subdev;
        struct i2c_client *client = v4l2_get_subdevdata(subdev);
-       unsigned int xclk_freq;
+       unsigned int xclk_freq = 9600000;
        int val, rval;
 
        rval = regulator_enable(sensor->vana);
@@ -825,11 +825,6 @@ static int et8ek8_power_on(struct et8ek8_sensor *sensor)
                return rval;
        }
 
-       if (sensor->current_reglist)
-               xclk_freq = sensor->current_reglist->mode.ext_clock;
-       else
-               xclk_freq = sensor->xclk_freq;
-
        rval = clk_set_rate(sensor->ext_clk, xclk_freq);
        if (rval < 0) {
                dev_err(&client->dev, "unable to set extclk clock freq to %u\n",
@@ -1085,9 +1080,6 @@ static int et8ek8_set_frame_interval(struct v4l2_subdev *subdev,
        if (!reglist)
                return -EINVAL;
 
-       if (sensor->current_reglist->mode.ext_clock != reglist->mode.ext_clock)
-               return -EINVAL;
-
        sensor->current_reglist = reglist;
        et8ek8_update_controls(sensor);
 
index c9088eb0a8125563469a7d84131ca944eb6a7ddd..914be1007099dfbe74817c97d23708fff3f23a2a 100644 (file)
@@ -44,7 +44,6 @@ static struct et8ek8_reglist mode1_poweron_mode2_16vga_2592x1968_12_07fps = {
                .window_width = 2592,
                .window_height = 1968,
                .pixel_clock = 80000000,
-               .ext_clock = 9600000,
                .timeperframe = {
                        .numerator = 100,
                        .denominator = 1207
@@ -145,7 +144,6 @@ static struct et8ek8_reglist mode1_16vga_2592x1968_13_12fps_dpcm10_8 = {
                .window_width = 2592,
                .window_height = 1968,
                .pixel_clock = 80000000,
-               .ext_clock = 9600000,
                .timeperframe = {
                        .numerator = 100,
                        .denominator = 1292
@@ -201,7 +199,6 @@ static struct et8ek8_reglist mode3_4vga_1296x984_29_99fps_dpcm10_8 = {
                .window_width = 1296,
                .window_height = 984,
                .pixel_clock = 96533333,
-               .ext_clock = 9600000,
                .timeperframe = {
                        .numerator = 100,
                        .denominator = 3000
@@ -257,7 +254,6 @@ static struct et8ek8_reglist mode4_svga_864x656_29_88fps = {
                .window_width = 864,
                .window_height = 656,
                .pixel_clock = 80000000,
-               .ext_clock = 9600000,
                .timeperframe = {
                        .numerator = 100,
                        .denominator = 2988
@@ -313,7 +309,6 @@ static struct et8ek8_reglist mode5_vga_648x492_29_93fps = {
                .window_width = 648,
                .window_height = 492,
                .pixel_clock = 80000000,
-               .ext_clock = 9600000,
                .timeperframe = {
                        .numerator = 100,
                        .denominator = 2993
@@ -369,7 +364,6 @@ static struct et8ek8_reglist mode2_16vga_2592x1968_3_99fps = {
                .window_width = 2592,
                .window_height = 1968,
                .pixel_clock = 80000000,
-               .ext_clock = 9600000,
                .timeperframe = {
                        .numerator = 100,
                        .denominator = 399
@@ -424,7 +418,6 @@ static struct et8ek8_reglist mode_648x492_5fps = {
                .window_width = 648,
                .window_height = 492,
                .pixel_clock = 13333333,
-               .ext_clock = 9600000,
                .timeperframe = {
                        .numerator = 100,
                        .denominator = 499
@@ -480,7 +473,6 @@ static struct et8ek8_reglist mode3_4vga_1296x984_5fps = {
                .window_width = 1296,
                .window_height = 984,
                .pixel_clock = 49400000,
-               .ext_clock = 9600000,
                .timeperframe = {
                        .numerator = 100,
                        .denominator = 501
@@ -536,7 +528,6 @@ static struct et8ek8_reglist mode_4vga_1296x984_25fps_dpcm10_8 = {
                .window_width = 1296,
                .window_height = 984,
                .pixel_clock = 84266667,
-               .ext_clock = 9600000,
                .timeperframe = {
                        .numerator = 100,
                        .denominator = 2500
index c90e74935f127943d712fc8bf330851d80a9e8c1..3305986c7c9c63eb50054618f347c6ac18846504 100644 (file)
@@ -37,7 +37,6 @@ struct et8ek8_mode {
        u16 window_height;
 
        u32 pixel_clock;                /* in Hz */
-       u32 ext_clock;                  /* in Hz */
        struct v4l2_fract timeperframe;
        u32 max_exp;                    /* Maximum exposure value */
        u32 bus_format;                 /* MEDIA_BUS_FMT_ */