Skip to content

Commit bf21a52

Browse files
committed
drivers: media: imx219: Remove enum binning_mode
The enum binning_mode is redundant, it only uses values from the earlier defined binning modes. Remove it. Signed-off-by: Naushir Patuck <[email protected]>
1 parent 99972b2 commit bf21a52

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

drivers/media/i2c/imx219.c

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,6 @@
148148
#define IMX219_PIXEL_ARRAY_WIDTH 3280U
149149
#define IMX219_PIXEL_ARRAY_HEIGHT 2464U
150150

151-
enum binning_mode {
152-
BINNING_NONE = IMX219_BINNING_NONE,
153-
BINNING_X2 = IMX219_BINNING_X2,
154-
BINNING_ANALOG_X2 = IMX219_BINNING_X2_ANALOG,
155-
};
156-
157151
/* Mode : resolution and related config&values */
158152
struct imx219_mode {
159153
/* Frame width */
@@ -409,8 +403,8 @@ static u32 imx219_get_format_bpp(const struct v4l2_mbus_framefmt *format)
409403
}
410404
}
411405

412-
static enum binning_mode imx219_get_binning(struct imx219 *imx219, u8 *bin_h,
413-
u8 *bin_v)
406+
static unsigned int imx219_get_binning(struct imx219 *imx219, u8 *bin_h,
407+
u8 *bin_v)
414408
{
415409
struct v4l2_subdev_state *state =
416410
v4l2_subdev_get_locked_active_state(&imx219->sd);
@@ -422,23 +416,23 @@ static enum binning_mode imx219_get_binning(struct imx219 *imx219, u8 *bin_h,
422416
*bin_v = crop->height / format->height;
423417

424418
if (*bin_h == 2 && *bin_v == 2)
425-
return BINNING_ANALOG_X2;
419+
return IMX219_BINNING_X2_ANALOG;
426420
else if (*bin_h == 2 || *bin_v == 2)
427421
/*
428422
* Don't use analog binning if only one dimension
429423
* is binned, as it crops the other dimension
430424
*/
431-
return BINNING_X2;
425+
return IMX219_BINNING_X2;
432426
else
433-
return BINNING_NONE;
427+
return IMX219_BINNING_NONE;
434428
}
435429

436430
static inline u32 imx219_get_rate_factor(struct imx219 *imx219)
437431
{
438432
u8 bin_h, bin_v;
439-
enum binning_mode binning = imx219_get_binning(imx219, &bin_h, &bin_v);
433+
unsigned int binning = imx219_get_binning(imx219, &bin_h, &bin_v);
440434

441-
if (binning == BINNING_ANALOG_X2)
435+
if (binning == IMX219_BINNING_X2_ANALOG)
442436
return 2;
443437

444438
return 1;
@@ -674,7 +668,7 @@ static int imx219_set_framefmt(struct imx219 *imx219,
674668
{
675669
const struct v4l2_mbus_framefmt *format;
676670
const struct v4l2_rect *crop;
677-
enum binning_mode binning;
671+
unsigned int binning;
678672
u8 bin_h, bin_v;
679673
u32 bpp;
680674
int ret = 0;
@@ -694,9 +688,9 @@ static int imx219_set_framefmt(struct imx219 *imx219,
694688

695689
binning = imx219_get_binning(imx219, &bin_h, &bin_v);
696690
cci_write(imx219->regmap, IMX219_REG_BINNING_MODE_H,
697-
(bin_h == 2) ? binning : BINNING_NONE, &ret);
691+
(bin_h == 2) ? binning : IMX219_BINNING_NONE, &ret);
698692
cci_write(imx219->regmap, IMX219_REG_BINNING_MODE_V,
699-
(bin_v == 2) ? binning : BINNING_NONE, &ret);
693+
(bin_v == 2) ? binning : IMX219_BINNING_NONE, &ret);
700694

701695
cci_write(imx219->regmap, IMX219_REG_X_OUTPUT_SIZE,
702696
format->width, &ret);

0 commit comments

Comments
 (0)