Re: [PATCH v2 08/13] media: mt9m001: remove remaining soc_camera specific code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2019年1月8日(火) 23:52 Akinobu Mita <akinobu.mita@xxxxxxxxx>:
>
> Remove remaining soc_camera specific code and drop soc_camera dependency
> from this driver.
>
> Cc: Guennadi Liakhovetski <g.liakhovetski@xxxxxx>
> Cc: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
> Cc: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
> Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
> ---
> * No changes from v1
>
>  drivers/media/i2c/Kconfig   |  2 +-
>  drivers/media/i2c/mt9m001.c | 84 ++++++++-------------------------------------
>  2 files changed, 15 insertions(+), 71 deletions(-)
>
> diff --git a/drivers/media/i2c/Kconfig b/drivers/media/i2c/Kconfig
> index ee3ef1b..bc248d9 100644
> --- a/drivers/media/i2c/Kconfig
> +++ b/drivers/media/i2c/Kconfig
> @@ -859,7 +859,7 @@ config VIDEO_VS6624
>
>  config VIDEO_MT9M001
>         tristate "mt9m001 support"
> -       depends on SOC_CAMERA && I2C
> +       depends on I2C && VIDEO_V4L2
>         help
>           This driver supports MT9M001 cameras from Micron, monochrome
>           and colour models.
> diff --git a/drivers/media/i2c/mt9m001.c b/drivers/media/i2c/mt9m001.c
> index 1619c8c..0f5e3f9 100644
> --- a/drivers/media/i2c/mt9m001.c
> +++ b/drivers/media/i2c/mt9m001.c
> @@ -15,15 +15,12 @@
>  #include <linux/slab.h>
>  #include <linux/videodev2.h>
>
> -#include <media/drv-intf/soc_mediabus.h>
> -#include <media/soc_camera.h>
>  #include <media/v4l2-ctrls.h>
> +#include <media/v4l2-device.h>
>  #include <media/v4l2-subdev.h>
>
>  /*
>   * mt9m001 i2c address 0x5d
> - * The platform has to define struct i2c_board_info objects and link to them
> - * from struct soc_camera_host_desc
>   */
>
>  /* mt9m001 selected register addresses */
> @@ -276,11 +273,15 @@ static int mt9m001_set_selection(struct v4l2_subdev *sd,
>         rect.width = ALIGN(rect.width, 2);
>         rect.left = ALIGN(rect.left, 2);
>
> -       soc_camera_limit_side(&rect.left, &rect.width,
> -                    MT9M001_COLUMN_SKIP, MT9M001_MIN_WIDTH, MT9M001_MAX_WIDTH);
> +       rect.width = clamp_t(u32, rect.width, MT9M001_MIN_WIDTH,
> +                       MT9M001_MAX_WIDTH);
> +       rect.left = clamp_t(u32, rect.left, MT9M001_COLUMN_SKIP,
> +                       MT9M001_COLUMN_SKIP + MT9M001_MAX_WIDTH - rect.width);
>
> -       soc_camera_limit_side(&rect.top, &rect.height,
> -                    MT9M001_ROW_SKIP, MT9M001_MIN_HEIGHT, MT9M001_MAX_HEIGHT);
> +       rect.height = clamp_t(u32, rect.height, MT9M001_MIN_HEIGHT,
> +                       MT9M001_MAX_HEIGHT);
> +       rect.top = clamp_t(u32, rect.top, MT9M001_ROW_SKIP,
> +                       MT9M001_ROW_SKIP + MT9M001_MAX_HEIGHT - rect.width);

Oops.  This line isn't correct. s/rect.width/rect.height/




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux