Message ID | 1546959110-19445-1-git-send-email-akinobu.mita@gmail.com |
---|---|
Headers | show |
Series | media: mt9m001: switch soc_mt9m001 to a standard subdev sensor driver | expand |
2019年1月8日(火) 23:52 Akinobu Mita <akinobu.mita@gmail.com>: > > Remove remaining soc_camera specific code and drop soc_camera dependency > from this driver. > > Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> > Cc: Sakari Ailus <sakari.ailus@linux.intel.com> > Cc: Mauro Carvalho Chehab <mchehab@kernel.org> > Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> > --- > * 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/
Hi Mita-san, On Wed, Jan 09, 2019 at 12:40:33AM +0900, Akinobu Mita wrote: > 2019年1月8日(火) 23:52 Akinobu Mita <akinobu.mita@gmail.com>: > > > > Remove remaining soc_camera specific code and drop soc_camera dependency > > from this driver. > > > > Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> > > Cc: Sakari Ailus <sakari.ailus@linux.intel.com> > > Cc: Mauro Carvalho Chehab <mchehab@kernel.org> > > Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> > > --- > > * 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/ Could you resend just that patch? The rest seems fine as-is, at least on a quick glance. I'm also waiting for Rob's ack to the binding patch.
Hi Mita-san, On Tue, Jan 08, 2019 at 11:51:37PM +0900, Akinobu Mita wrote: > This patchset converts soc_camera mt9m001 driver to a standard subdev > sensor driver. > > * v2 > - Update binding doc suggested by Rob Herring. > - Fix MODULE_LICENSE() masmatch. > - Sort headers alphabetically. > - Add new label for error handling in s_stream() callback. > - Replace pm_runtime_get_noresume() + pm_runtime_put_sync() with a > single pm_runtime_idle() call in probe() function. > - Change the argument of mt9m001_power_o{n,ff} to struct device, and > use them for runtime PM callbacks directly. > - Remove redundant Kconfig dependency > - Preserve subdev flags set by v4l2_i2c_subdev_init(). > - Set initial try format with default configuration instead of > current one. While this set improved the original mt9m001 driver a lot, it did not add a MAINTAINERS entry for it. The same applies to the mt9m111 driver. Could you provide the MAINTAINERS entries for the two drivers, please? Thanks.
2019年2月4日(月) 18:06 Sakari Ailus <sakari.ailus@iki.fi>: > > Hi Mita-san, > > On Tue, Jan 08, 2019 at 11:51:37PM +0900, Akinobu Mita wrote: > > This patchset converts soc_camera mt9m001 driver to a standard subdev > > sensor driver. > > > > * v2 > > - Update binding doc suggested by Rob Herring. > > - Fix MODULE_LICENSE() masmatch. > > - Sort headers alphabetically. > > - Add new label for error handling in s_stream() callback. > > - Replace pm_runtime_get_noresume() + pm_runtime_put_sync() with a > > single pm_runtime_idle() call in probe() function. > > - Change the argument of mt9m001_power_o{n,ff} to struct device, and > > use them for runtime PM callbacks directly. > > - Remove redundant Kconfig dependency > > - Preserve subdev flags set by v4l2_i2c_subdev_init(). > > - Set initial try format with default configuration instead of > > current one. > > While this set improved the original mt9m001 driver a lot, it did not add a > MAINTAINERS entry for it. The same applies to the mt9m111 driver. > > Could you provide the MAINTAINERS entries for the two drivers, please? As long as I have those two sensors, I can review and test the patches. So I would like to add the following MAINTAINERS entries. MT9M001 CAMERA SENSOR M: Sakari Ailus <sakari.ailus@linux.intel.com> R: Akinobu Mita <akinobu.mita@gmail.com> L: linux-media@vger.kernel.org T: git git://linuxtv.org/media_tree.git S: Maintained F: Documentation/devicetree/bindings/media/i2c/mt9m001.txt F: drivers/media/i2c/mt9m001.c MT9M111 CAMERA SENSOR M: Sakari Ailus <sakari.ailus@linux.intel.com> R: Akinobu Mita <akinobu.mita@gmail.com> L: linux-media@vger.kernel.org T: git git://linuxtv.org/media_tree.git S: Maintained F: Documentation/devicetree/bindings/media/i2c/mt9m111.txt F: drivers/media/i2c/mt9m111.c
On Tue, Feb 05, 2019 at 10:39:56PM +0900, Akinobu Mita wrote: > 2019年2月4日(月) 18:06 Sakari Ailus <sakari.ailus@iki.fi>: > > > > Hi Mita-san, > > > > On Tue, Jan 08, 2019 at 11:51:37PM +0900, Akinobu Mita wrote: > > > This patchset converts soc_camera mt9m001 driver to a standard subdev > > > sensor driver. > > > > > > * v2 > > > - Update binding doc suggested by Rob Herring. > > > - Fix MODULE_LICENSE() masmatch. > > > - Sort headers alphabetically. > > > - Add new label for error handling in s_stream() callback. > > > - Replace pm_runtime_get_noresume() + pm_runtime_put_sync() with a > > > single pm_runtime_idle() call in probe() function. > > > - Change the argument of mt9m001_power_o{n,ff} to struct device, and > > > use them for runtime PM callbacks directly. > > > - Remove redundant Kconfig dependency > > > - Preserve subdev flags set by v4l2_i2c_subdev_init(). > > > - Set initial try format with default configuration instead of > > > current one. > > > > While this set improved the original mt9m001 driver a lot, it did not add a > > MAINTAINERS entry for it. The same applies to the mt9m111 driver. > > > > Could you provide the MAINTAINERS entries for the two drivers, please? > > As long as I have those two sensors, I can review and test the patches. > So I would like to add the following MAINTAINERS entries. Ok. Works for me. Could you send a patch to add the entries, please? > > MT9M001 CAMERA SENSOR > M: Sakari Ailus <sakari.ailus@linux.intel.com> > R: Akinobu Mita <akinobu.mita@gmail.com> > L: linux-media@vger.kernel.org > T: git git://linuxtv.org/media_tree.git > S: Maintained > F: Documentation/devicetree/bindings/media/i2c/mt9m001.txt > F: drivers/media/i2c/mt9m001.c > > MT9M111 CAMERA SENSOR > M: Sakari Ailus <sakari.ailus@linux.intel.com> > R: Akinobu Mita <akinobu.mita@gmail.com> > L: linux-media@vger.kernel.org > T: git git://linuxtv.org/media_tree.git > S: Maintained > F: Documentation/devicetree/bindings/media/i2c/mt9m111.txt > F: drivers/media/i2c/mt9m111.c