Re: [PATCH 4/4] SoC camera: Tidy the header

2018-11-13 Thread Sakari Ailus
Hi Hans, Mauro,

On Wed, Oct 31, 2018 at 07:54:21AM -0300, Mauro Carvalho Chehab wrote:
> Em Wed, 31 Oct 2018 11:00:22 +0100
> Hans Verkuil  escreveu:
> 
> > On 10/31/2018 10:40 AM, Mauro Carvalho Chehab wrote:
> > > Em Wed, 31 Oct 2018 11:29:45 +0200
> > > Sakari Ailus  escreveu:
> > >   
> > >> Hi Mauro,
> > >>
> > >> On Tue, Oct 30, 2018 at 09:06:18AM -0300, Mauro Carvalho Chehab wrote:  
> > >>> Em Tue, 30 Oct 2018 01:00:29 +0200
> > >>> Sakari Ailus  escreveu:
> > >>> 
> >  Clean up the SoC camera framework header. It only exists now to keep 
> >  board
> >  code compiling. The header can be removed once the board code 
> >  dependencies
> >  to it has been removed.
> > 
> >  Signed-off-by: Sakari Ailus 
> >  ---
> >   include/media/soc_camera.h | 335 
> >  -
> >   1 file changed, 335 deletions(-)
> > 
> >  diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
> >  index b7e42a1b0910..14d19da6052a 100644
> >  --- a/include/media/soc_camera.h
> >  +++ b/include/media/soc_camera.h
> >  @@ -22,172 +22,6 @@
> >   #include 
> >   #include 
> > >>>
> > >>> That doesn't make any sense. soc_camera.h should have the same fate
> > >>> as the entire soc_camera infrastructure: either be removed or moved
> > >>> to staging, and everything else that doesn't have the same fate
> > >>> should get rid of this header.
> > >>
> > >> We can't just remove this; there is board code that depends on it.
> > >>
> > >> The intent is to remove the board code as well but presuming that the 
> > >> board
> > >> code would be merged through a different tree, it'd be less hassle to 
> > >> wait
> > >> a bit; hence the patch removing any unnecessary stuff here.  
> > > 
> > > Then we need *first* to remove board code, wait for those changes to be
> > > applied and *then* remove soc_camera (and not the opposite).  
> > 
> > Please note that the camera support for all the remaining boards using
> > soc_camera has been dead for years. The soc_camera drivers that they 
> > depended
> > on have been removed a long time ago.
> > 
> > So all they depend on are the header. We can safely remove soc_camera 
> > without
> > loss of functionality (and thus prevent others from basing new drivers on
> > soc_camera), while we work to update the board files so we can remove this 
> > last
> > header.
> > 
> > I have modified some board files here:
> > 
> > https://git.linuxtv.org/hverkuil/media_tree.git/commit/?h=rm-soc-camera&id=d7ae2fcf6e447022f0780bb86a2b63d5c7cf4d35
> 
> Good! the arch-specific mach-* changes should likely be on separate
> patches, though.
> 
> > Only arch/arm/mach-imx/mach-imx27_visstrim_m10.c hasn't been fixed yet in 
> > that
> > patch (ENOTIME).
> 
> So, the code we don't manage seems to be just 3 archs, right (mach-omap1,
> mach-pxa and mach-imx)?
> 
> Btw, the soc_camera dependent code at mach-imx27_visstrim_m10.c is:
> 
>   static struct soc_camera_link iclink_tvp5150 = {
>   .bus_id = 0,
>   .board_info = &visstrim_i2c_camera,
>   .i2c_adapter_id = 0,
>   .power = visstrim_camera_power,
>   .reset = visstrim_camera_reset,
>   };
> 
> ...
> platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0,
>   &iclink_tvp5150, 
> sizeof(iclink_tvp5150));
> 
> 
> As tvp5150 is not actually a soc_camera driver, I suspect that
> the conversion here would be to make it to use the tvp5150 driver
> directly, instead of doing it via soc_camera.

Using board files? The IMX27 SoC has plenty of dts files around which
suggests that it's just this particular board that has not been converted.
I don't think this is a good excuse to keep the board file stuff around.

If someone is willing to add dts files for the board, all the better. But
I'm not going to do that.

> 
> > The problem is just lack of time to clean this up and figure out who should
> > take these board patches.
> 
> No need to rush it.
> 
> > So I think it is a nice solution to just replace the header with a dummy 
> > version
> > so the board files still compile, and then we can delete the dead soc_camera
> > driver. It's probably easier as well to push through the board file changes 
> > once
> > soc_camera is removed since you can just point out that the framework it 
> > depended
> > on is gone.
> 
> I still think that reverting the order and rushing the removal is not the
> way to go.

I think no-one can blame us for rushing the removal of this: it's been
broken for years.

I propose removing the dead code with the least effort while minimising
collateral damage as well as additional maintenance work done to support
the to-be-removed code.

As far as I can see, that involves:

- Removing the SoC camera framework (as my set does; there'll be v2 to fix
  a few minor matters),

- Removing the boar

Re: [PATCH 4/4] SoC camera: Tidy the header

2018-10-31 Thread Mauro Carvalho Chehab
Em Wed, 31 Oct 2018 11:00:22 +0100
Hans Verkuil  escreveu:

> On 10/31/2018 10:40 AM, Mauro Carvalho Chehab wrote:
> > Em Wed, 31 Oct 2018 11:29:45 +0200
> > Sakari Ailus  escreveu:
> >   
> >> Hi Mauro,
> >>
> >> On Tue, Oct 30, 2018 at 09:06:18AM -0300, Mauro Carvalho Chehab wrote:  
> >>> Em Tue, 30 Oct 2018 01:00:29 +0200
> >>> Sakari Ailus  escreveu:
> >>> 
>  Clean up the SoC camera framework header. It only exists now to keep 
>  board
>  code compiling. The header can be removed once the board code 
>  dependencies
>  to it has been removed.
> 
>  Signed-off-by: Sakari Ailus 
>  ---
>   include/media/soc_camera.h | 335 
>  -
>   1 file changed, 335 deletions(-)
> 
>  diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
>  index b7e42a1b0910..14d19da6052a 100644
>  --- a/include/media/soc_camera.h
>  +++ b/include/media/soc_camera.h
>  @@ -22,172 +22,6 @@
>   #include 
>   #include 
> >>>
> >>> That doesn't make any sense. soc_camera.h should have the same fate
> >>> as the entire soc_camera infrastructure: either be removed or moved
> >>> to staging, and everything else that doesn't have the same fate
> >>> should get rid of this header.
> >>
> >> We can't just remove this; there is board code that depends on it.
> >>
> >> The intent is to remove the board code as well but presuming that the board
> >> code would be merged through a different tree, it'd be less hassle to wait
> >> a bit; hence the patch removing any unnecessary stuff here.  
> > 
> > Then we need *first* to remove board code, wait for those changes to be
> > applied and *then* remove soc_camera (and not the opposite).  
> 
> Please note that the camera support for all the remaining boards using
> soc_camera has been dead for years. The soc_camera drivers that they depended
> on have been removed a long time ago.
> 
> So all they depend on are the header. We can safely remove soc_camera without
> loss of functionality (and thus prevent others from basing new drivers on
> soc_camera), while we work to update the board files so we can remove this 
> last
> header.
> 
> I have modified some board files here:
> 
> https://git.linuxtv.org/hverkuil/media_tree.git/commit/?h=rm-soc-camera&id=d7ae2fcf6e447022f0780bb86a2b63d5c7cf4d35

Good! the arch-specific mach-* changes should likely be on separate
patches, though.

> Only arch/arm/mach-imx/mach-imx27_visstrim_m10.c hasn't been fixed yet in that
> patch (ENOTIME).

So, the code we don't manage seems to be just 3 archs, right (mach-omap1,
mach-pxa and mach-imx)?

Btw, the soc_camera dependent code at mach-imx27_visstrim_m10.c is:

static struct soc_camera_link iclink_tvp5150 = {
.bus_id = 0,
.board_info = &visstrim_i2c_camera,
.i2c_adapter_id = 0,
.power = visstrim_camera_power,
.reset = visstrim_camera_reset,
};

...
platform_device_register_resndata(NULL, "soc-camera-pdrv", 0, NULL, 0,
  &iclink_tvp5150, sizeof(iclink_tvp5150));


As tvp5150 is not actually a soc_camera driver, I suspect that
the conversion here would be to make it to use the tvp5150 driver
directly, instead of doing it via soc_camera.

> The problem is just lack of time to clean this up and figure out who should
> take these board patches.

No need to rush it.

> So I think it is a nice solution to just replace the header with a dummy 
> version
> so the board files still compile, and then we can delete the dead soc_camera
> driver. It's probably easier as well to push through the board file changes 
> once
> soc_camera is removed since you can just point out that the framework it 
> depended
> on is gone.

I still think that reverting the order and rushing the removal is not the
way to go.

For example, on that specific imx.27 board above mentioned, it may
still be working with the tvp5150 driver[1] and replacing the soc_camera.h 
by a dummy version would just break for no good reason.

[1] I don't have such board to test, nor I checked if what's left from
soc_camera still allows the tvp5150 driver to register.


Thanks,
Mauro




Re: [PATCH 4/4] SoC camera: Tidy the header

2018-10-31 Thread Hans Verkuil
On 10/31/2018 10:40 AM, Mauro Carvalho Chehab wrote:
> Em Wed, 31 Oct 2018 11:29:45 +0200
> Sakari Ailus  escreveu:
> 
>> Hi Mauro,
>>
>> On Tue, Oct 30, 2018 at 09:06:18AM -0300, Mauro Carvalho Chehab wrote:
>>> Em Tue, 30 Oct 2018 01:00:29 +0200
>>> Sakari Ailus  escreveu:
>>>   
 Clean up the SoC camera framework header. It only exists now to keep board
 code compiling. The header can be removed once the board code dependencies
 to it has been removed.

 Signed-off-by: Sakari Ailus 
 ---
  include/media/soc_camera.h | 335 
 -
  1 file changed, 335 deletions(-)

 diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
 index b7e42a1b0910..14d19da6052a 100644
 --- a/include/media/soc_camera.h
 +++ b/include/media/soc_camera.h
 @@ -22,172 +22,6 @@
  #include 
  #include   
>>>
>>> That doesn't make any sense. soc_camera.h should have the same fate
>>> as the entire soc_camera infrastructure: either be removed or moved
>>> to staging, and everything else that doesn't have the same fate
>>> should get rid of this header.  
>>
>> We can't just remove this; there is board code that depends on it.
>>
>> The intent is to remove the board code as well but presuming that the board
>> code would be merged through a different tree, it'd be less hassle to wait
>> a bit; hence the patch removing any unnecessary stuff here.
> 
> Then we need *first* to remove board code, wait for those changes to be
> applied and *then* remove soc_camera (and not the opposite).

Please note that the camera support for all the remaining boards using
soc_camera has been dead for years. The soc_camera drivers that they depended
on have been removed a long time ago.

So all they depend on are the header. We can safely remove soc_camera without
loss of functionality (and thus prevent others from basing new drivers on
soc_camera), while we work to update the board files so we can remove this last
header.

I have modified some board files here:

https://git.linuxtv.org/hverkuil/media_tree.git/commit/?h=rm-soc-camera&id=d7ae2fcf6e447022f0780bb86a2b63d5c7cf4d35

Only arch/arm/mach-imx/mach-imx27_visstrim_m10.c hasn't been fixed yet in that
patch (ENOTIME).

The problem is just lack of time to clean this up and figure out who should
take these board patches.

So I think it is a nice solution to just replace the header with a dummy version
so the board files still compile, and then we can delete the dead soc_camera
driver. It's probably easier as well to push through the board file changes once
soc_camera is removed since you can just point out that the framework it 
depended
on is gone.

Regards,

Hans


Re: [PATCH 4/4] SoC camera: Tidy the header

2018-10-31 Thread Sakari Ailus
On Wed, Oct 31, 2018 at 06:40:30AM -0300, Mauro Carvalho Chehab wrote:
> Em Wed, 31 Oct 2018 11:29:45 +0200
> Sakari Ailus  escreveu:
> 
> > Hi Mauro,
> > 
> > On Tue, Oct 30, 2018 at 09:06:18AM -0300, Mauro Carvalho Chehab wrote:
> > > Em Tue, 30 Oct 2018 01:00:29 +0200
> > > Sakari Ailus  escreveu:
> > >   
> > > > Clean up the SoC camera framework header. It only exists now to keep 
> > > > board
> > > > code compiling. The header can be removed once the board code 
> > > > dependencies
> > > > to it has been removed.
> > > > 
> > > > Signed-off-by: Sakari Ailus 
> > > > ---
> > > >  include/media/soc_camera.h | 335 
> > > > -
> > > >  1 file changed, 335 deletions(-)
> > > > 
> > > > diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
> > > > index b7e42a1b0910..14d19da6052a 100644
> > > > --- a/include/media/soc_camera.h
> > > > +++ b/include/media/soc_camera.h
> > > > @@ -22,172 +22,6 @@
> > > >  #include 
> > > >  #include   
> > > 
> > > That doesn't make any sense. soc_camera.h should have the same fate
> > > as the entire soc_camera infrastructure: either be removed or moved
> > > to staging, and everything else that doesn't have the same fate
> > > should get rid of this header.  
> > 
> > We can't just remove this; there is board code that depends on it.
> > 
> > The intent is to remove the board code as well but presuming that the board
> > code would be merged through a different tree, it'd be less hassle to wait
> > a bit; hence the patch removing any unnecessary stuff here.
> 
> Then we need *first* to remove board code, wait for those changes to be
> applied and *then* remove soc_camera (and not the opposite).

I'll post patches to remove the affeced board code soon, too. I have no
objections to merge it through the media tree either, if the maintainers
agree.

-- 
Sakari Ailus
sakari.ai...@linux.intel.com


Re: [PATCH 4/4] SoC camera: Tidy the header

2018-10-31 Thread Sakari Ailus
On Wed, Oct 31, 2018 at 06:40:30AM -0300, Mauro Carvalho Chehab wrote:
> Em Wed, 31 Oct 2018 11:29:45 +0200
> Sakari Ailus  escreveu:
> 
> > Hi Mauro,
> > 
> > On Tue, Oct 30, 2018 at 09:06:18AM -0300, Mauro Carvalho Chehab wrote:
> > > Em Tue, 30 Oct 2018 01:00:29 +0200
> > > Sakari Ailus  escreveu:
> > >   
> > > > Clean up the SoC camera framework header. It only exists now to keep 
> > > > board
> > > > code compiling. The header can be removed once the board code 
> > > > dependencies
> > > > to it has been removed.
> > > > 
> > > > Signed-off-by: Sakari Ailus 
> > > > ---
> > > >  include/media/soc_camera.h | 335 
> > > > -
> > > >  1 file changed, 335 deletions(-)
> > > > 
> > > > diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
> > > > index b7e42a1b0910..14d19da6052a 100644
> > > > --- a/include/media/soc_camera.h
> > > > +++ b/include/media/soc_camera.h
> > > > @@ -22,172 +22,6 @@
> > > >  #include 
> > > >  #include   
> > > 
> > > That doesn't make any sense. soc_camera.h should have the same fate
> > > as the entire soc_camera infrastructure: either be removed or moved
> > > to staging, and everything else that doesn't have the same fate
> > > should get rid of this header.  
> > 
> > We can't just remove this; there is board code that depends on it.
> > 
> > The intent is to remove the board code as well but presuming that the board
> > code would be merged through a different tree, it'd be less hassle to wait
> > a bit; hence the patch removing any unnecessary stuff here.
> 
> Then we need *first* to remove board code, wait for those changes to be
> applied and *then* remove soc_camera (and not the opposite).

Any reasoning behind that?

It's dead code and there is no dependency between the SoC camera framework
(apart from the header) and the board code.

-- 
Sakari Ailus
sakari.ai...@linux.intel.com


Re: [PATCH 4/4] SoC camera: Tidy the header

2018-10-31 Thread Mauro Carvalho Chehab
Em Wed, 31 Oct 2018 11:29:45 +0200
Sakari Ailus  escreveu:

> Hi Mauro,
> 
> On Tue, Oct 30, 2018 at 09:06:18AM -0300, Mauro Carvalho Chehab wrote:
> > Em Tue, 30 Oct 2018 01:00:29 +0200
> > Sakari Ailus  escreveu:
> >   
> > > Clean up the SoC camera framework header. It only exists now to keep board
> > > code compiling. The header can be removed once the board code dependencies
> > > to it has been removed.
> > > 
> > > Signed-off-by: Sakari Ailus 
> > > ---
> > >  include/media/soc_camera.h | 335 
> > > -
> > >  1 file changed, 335 deletions(-)
> > > 
> > > diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
> > > index b7e42a1b0910..14d19da6052a 100644
> > > --- a/include/media/soc_camera.h
> > > +++ b/include/media/soc_camera.h
> > > @@ -22,172 +22,6 @@
> > >  #include 
> > >  #include   
> > 
> > That doesn't make any sense. soc_camera.h should have the same fate
> > as the entire soc_camera infrastructure: either be removed or moved
> > to staging, and everything else that doesn't have the same fate
> > should get rid of this header.  
> 
> We can't just remove this; there is board code that depends on it.
> 
> The intent is to remove the board code as well but presuming that the board
> code would be merged through a different tree, it'd be less hassle to wait
> a bit; hence the patch removing any unnecessary stuff here.

Then we need *first* to remove board code, wait for those changes to be
applied and *then* remove soc_camera (and not the opposite).

Thanks,
Mauro


Re: [PATCH 4/4] SoC camera: Tidy the header

2018-10-31 Thread Sakari Ailus
Hi Mauro,

On Tue, Oct 30, 2018 at 09:06:18AM -0300, Mauro Carvalho Chehab wrote:
> Em Tue, 30 Oct 2018 01:00:29 +0200
> Sakari Ailus  escreveu:
> 
> > Clean up the SoC camera framework header. It only exists now to keep board
> > code compiling. The header can be removed once the board code dependencies
> > to it has been removed.
> > 
> > Signed-off-by: Sakari Ailus 
> > ---
> >  include/media/soc_camera.h | 335 
> > -
> >  1 file changed, 335 deletions(-)
> > 
> > diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
> > index b7e42a1b0910..14d19da6052a 100644
> > --- a/include/media/soc_camera.h
> > +++ b/include/media/soc_camera.h
> > @@ -22,172 +22,6 @@
> >  #include 
> >  #include 
> 
> That doesn't make any sense. soc_camera.h should have the same fate
> as the entire soc_camera infrastructure: either be removed or moved
> to staging, and everything else that doesn't have the same fate
> should get rid of this header.

We can't just remove this; there is board code that depends on it.

The intent is to remove the board code as well but presuming that the board
code would be merged through a different tree, it'd be less hassle to wait
a bit; hence the patch removing any unnecessary stuff here.

-- 
Regards,

Sakari Ailus
sakari.ai...@linux.intel.com


Re: [PATCH 4/4] SoC camera: Tidy the header

2018-10-30 Thread Mauro Carvalho Chehab
Em Tue, 30 Oct 2018 01:00:29 +0200
Sakari Ailus  escreveu:

> Clean up the SoC camera framework header. It only exists now to keep board
> code compiling. The header can be removed once the board code dependencies
> to it has been removed.
> 
> Signed-off-by: Sakari Ailus 
> ---
>  include/media/soc_camera.h | 335 
> -
>  1 file changed, 335 deletions(-)
> 
> diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
> index b7e42a1b0910..14d19da6052a 100644
> --- a/include/media/soc_camera.h
> +++ b/include/media/soc_camera.h
> @@ -22,172 +22,6 @@
>  #include 
>  #include 

That doesn't make any sense. soc_camera.h should have the same fate
as the entire soc_camera infrastructure: either be removed or moved
to staging, and everything else that doesn't have the same fate
should get rid of this header.

Regards,
Mauro

>  
> -struct file;
> -struct soc_camera_desc;
> -struct soc_camera_async_client;
> -
> -struct soc_camera_device {
> - struct list_head list;  /* list of all registered devices */
> - struct soc_camera_desc *sdesc;
> - struct device *pdev;/* Platform device */
> - struct device *parent;  /* Camera host device */
> - struct device *control; /* E.g., the i2c client */
> - s32 user_width;
> - s32 user_height;
> - u32 bytesperline;   /* for padding, zero if unused */
> - u32 sizeimage;
> - enum v4l2_colorspace colorspace;
> - unsigned char iface;/* Host number */
> - unsigned char devnum;   /* Device number per host */
> - struct soc_camera_sense *sense; /* See comment in struct definition */
> - struct video_device *vdev;
> - struct v4l2_ctrl_handler ctrl_handler;
> - const struct soc_camera_format_xlate *current_fmt;
> - struct soc_camera_format_xlate *user_formats;
> - int num_user_formats;
> - enum v4l2_field field;  /* Preserve field over close() */
> - void *host_priv;/* Per-device host private data */
> - /* soc_camera.c private count. Only accessed with .host_lock held */
> - int use_count;
> - struct file *streamer;  /* stream owner */
> - struct v4l2_clk *clk;
> - /* Asynchronous subdevice management */
> - struct soc_camera_async_client *sasc;
> - /* video buffer queue */
> - struct vb2_queue vb2_vidq;
> -};
> -
> -/* Host supports programmable stride */
> -#define SOCAM_HOST_CAP_STRIDE(1 << 0)
> -
> -enum soc_camera_subdev_role {
> - SOCAM_SUBDEV_DATA_SOURCE = 1,
> - SOCAM_SUBDEV_DATA_SINK,
> - SOCAM_SUBDEV_DATA_PROCESSOR,
> -};
> -
> -struct soc_camera_async_subdev {
> - struct v4l2_async_subdev asd;
> - enum soc_camera_subdev_role role;
> -};
> -
> -struct soc_camera_host {
> - struct v4l2_device v4l2_dev;
> - struct list_head list;
> - struct mutex host_lock; /* Main synchronisation lock */
> - struct mutex clk_lock;  /* Protect pipeline modifications */
> - unsigned char nr;   /* Host number */
> - u32 capabilities;
> - struct soc_camera_device *icd;  /* Currently attached client */
> - void *priv;
> - const char *drv_name;
> - struct soc_camera_host_ops *ops;
> - struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
> - unsigned int *asd_sizes;/* 0-terminated array of asd group 
> sizes */
> -};
> -
> -struct soc_camera_host_ops {
> - struct module *owner;
> - int (*add)(struct soc_camera_device *);
> - void (*remove)(struct soc_camera_device *);
> - int (*clock_start)(struct soc_camera_host *);
> - void (*clock_stop)(struct soc_camera_host *);
> - /*
> -  * .get_formats() is called for each client device format, but
> -  * .put_formats() is only called once. Further, if any of the calls to
> -  * .get_formats() fail, .put_formats() will not be called at all, the
> -  * failing .get_formats() must then clean up internally.
> -  */
> - int (*get_formats)(struct soc_camera_device *, unsigned int,
> -struct soc_camera_format_xlate *);
> - void (*put_formats)(struct soc_camera_device *);
> - int (*get_selection)(struct soc_camera_device *, struct v4l2_selection 
> *);
> - int (*set_selection)(struct soc_camera_device *, struct v4l2_selection 
> *);
> - /*
> -  * The difference to .set_selection() is, that .set_liveselection is 
> not allowed
> -  * to change the output sizes
> -  */
> - int (*set_liveselection)(struct soc_camera_device *, struct 
> v4l2_selection *);
> - int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *);
> - int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *);
> - int (*init_videobuf2)(struct vb2_queue *,
> -   struct soc_camera_device *);
> - int (*querycap)(struct soc_camera_host *, struct v4l2_capabil

Re: [PATCH 4/4] SoC camera: Tidy the header

2018-10-30 Thread Mauro Carvalho Chehab
Em Tue, 30 Oct 2018 01:00:29 +0200
Sakari Ailus  escreveu:

> Clean up the SoC camera framework header. It only exists now to keep board
> code compiling. The header can be removed once the board code dependencies
> to it has been removed.
> 
> Signed-off-by: Sakari Ailus 
> ---
>  include/media/soc_camera.h | 335 
> -
>  1 file changed, 335 deletions(-)
> 
> diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
> index b7e42a1b0910..14d19da6052a 100644
> --- a/include/media/soc_camera.h
> +++ b/include/media/soc_camera.h
> @@ -22,172 +22,6 @@
>  #include 
>  #include 

That doesn't make any sense. soc_camera.h should have the same fate
as the entire soc_camera infrastructure: either be removed or moved
to staging, and everything else that doesn't have the same fate
should get rid of this header.

Regards,
Mauro

>  
> -struct file;
> -struct soc_camera_desc;
> -struct soc_camera_async_client;
> -
> -struct soc_camera_device {
> - struct list_head list;  /* list of all registered devices */
> - struct soc_camera_desc *sdesc;
> - struct device *pdev;/* Platform device */
> - struct device *parent;  /* Camera host device */
> - struct device *control; /* E.g., the i2c client */
> - s32 user_width;
> - s32 user_height;
> - u32 bytesperline;   /* for padding, zero if unused */
> - u32 sizeimage;
> - enum v4l2_colorspace colorspace;
> - unsigned char iface;/* Host number */
> - unsigned char devnum;   /* Device number per host */
> - struct soc_camera_sense *sense; /* See comment in struct definition */
> - struct video_device *vdev;
> - struct v4l2_ctrl_handler ctrl_handler;
> - const struct soc_camera_format_xlate *current_fmt;
> - struct soc_camera_format_xlate *user_formats;
> - int num_user_formats;
> - enum v4l2_field field;  /* Preserve field over close() */
> - void *host_priv;/* Per-device host private data */
> - /* soc_camera.c private count. Only accessed with .host_lock held */
> - int use_count;
> - struct file *streamer;  /* stream owner */
> - struct v4l2_clk *clk;
> - /* Asynchronous subdevice management */
> - struct soc_camera_async_client *sasc;
> - /* video buffer queue */
> - struct vb2_queue vb2_vidq;
> -};
> -
> -/* Host supports programmable stride */
> -#define SOCAM_HOST_CAP_STRIDE(1 << 0)
> -
> -enum soc_camera_subdev_role {
> - SOCAM_SUBDEV_DATA_SOURCE = 1,
> - SOCAM_SUBDEV_DATA_SINK,
> - SOCAM_SUBDEV_DATA_PROCESSOR,
> -};
> -
> -struct soc_camera_async_subdev {
> - struct v4l2_async_subdev asd;
> - enum soc_camera_subdev_role role;
> -};
> -
> -struct soc_camera_host {
> - struct v4l2_device v4l2_dev;
> - struct list_head list;
> - struct mutex host_lock; /* Main synchronisation lock */
> - struct mutex clk_lock;  /* Protect pipeline modifications */
> - unsigned char nr;   /* Host number */
> - u32 capabilities;
> - struct soc_camera_device *icd;  /* Currently attached client */
> - void *priv;
> - const char *drv_name;
> - struct soc_camera_host_ops *ops;
> - struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
> - unsigned int *asd_sizes;/* 0-terminated array of asd group 
> sizes */
> -};
> -
> -struct soc_camera_host_ops {
> - struct module *owner;
> - int (*add)(struct soc_camera_device *);
> - void (*remove)(struct soc_camera_device *);
> - int (*clock_start)(struct soc_camera_host *);
> - void (*clock_stop)(struct soc_camera_host *);
> - /*
> -  * .get_formats() is called for each client device format, but
> -  * .put_formats() is only called once. Further, if any of the calls to
> -  * .get_formats() fail, .put_formats() will not be called at all, the
> -  * failing .get_formats() must then clean up internally.
> -  */
> - int (*get_formats)(struct soc_camera_device *, unsigned int,
> -struct soc_camera_format_xlate *);
> - void (*put_formats)(struct soc_camera_device *);
> - int (*get_selection)(struct soc_camera_device *, struct v4l2_selection 
> *);
> - int (*set_selection)(struct soc_camera_device *, struct v4l2_selection 
> *);
> - /*
> -  * The difference to .set_selection() is, that .set_liveselection is 
> not allowed
> -  * to change the output sizes
> -  */
> - int (*set_liveselection)(struct soc_camera_device *, struct 
> v4l2_selection *);
> - int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *);
> - int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *);
> - int (*init_videobuf2)(struct vb2_queue *,
> -   struct soc_camera_device *);
> - int (*querycap)(struct soc_camera_host *, struct v4l2_capabil

[PATCH 4/4] SoC camera: Tidy the header

2018-10-29 Thread Sakari Ailus
Clean up the SoC camera framework header. It only exists now to keep board
code compiling. The header can be removed once the board code dependencies
to it has been removed.

Signed-off-by: Sakari Ailus 
---
 include/media/soc_camera.h | 335 -
 1 file changed, 335 deletions(-)

diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index b7e42a1b0910..14d19da6052a 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -22,172 +22,6 @@
 #include 
 #include 
 
-struct file;
-struct soc_camera_desc;
-struct soc_camera_async_client;
-
-struct soc_camera_device {
-   struct list_head list;  /* list of all registered devices */
-   struct soc_camera_desc *sdesc;
-   struct device *pdev;/* Platform device */
-   struct device *parent;  /* Camera host device */
-   struct device *control; /* E.g., the i2c client */
-   s32 user_width;
-   s32 user_height;
-   u32 bytesperline;   /* for padding, zero if unused */
-   u32 sizeimage;
-   enum v4l2_colorspace colorspace;
-   unsigned char iface;/* Host number */
-   unsigned char devnum;   /* Device number per host */
-   struct soc_camera_sense *sense; /* See comment in struct definition */
-   struct video_device *vdev;
-   struct v4l2_ctrl_handler ctrl_handler;
-   const struct soc_camera_format_xlate *current_fmt;
-   struct soc_camera_format_xlate *user_formats;
-   int num_user_formats;
-   enum v4l2_field field;  /* Preserve field over close() */
-   void *host_priv;/* Per-device host private data */
-   /* soc_camera.c private count. Only accessed with .host_lock held */
-   int use_count;
-   struct file *streamer;  /* stream owner */
-   struct v4l2_clk *clk;
-   /* Asynchronous subdevice management */
-   struct soc_camera_async_client *sasc;
-   /* video buffer queue */
-   struct vb2_queue vb2_vidq;
-};
-
-/* Host supports programmable stride */
-#define SOCAM_HOST_CAP_STRIDE  (1 << 0)
-
-enum soc_camera_subdev_role {
-   SOCAM_SUBDEV_DATA_SOURCE = 1,
-   SOCAM_SUBDEV_DATA_SINK,
-   SOCAM_SUBDEV_DATA_PROCESSOR,
-};
-
-struct soc_camera_async_subdev {
-   struct v4l2_async_subdev asd;
-   enum soc_camera_subdev_role role;
-};
-
-struct soc_camera_host {
-   struct v4l2_device v4l2_dev;
-   struct list_head list;
-   struct mutex host_lock; /* Main synchronisation lock */
-   struct mutex clk_lock;  /* Protect pipeline modifications */
-   unsigned char nr;   /* Host number */
-   u32 capabilities;
-   struct soc_camera_device *icd;  /* Currently attached client */
-   void *priv;
-   const char *drv_name;
-   struct soc_camera_host_ops *ops;
-   struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
-   unsigned int *asd_sizes;/* 0-terminated array of asd group 
sizes */
-};
-
-struct soc_camera_host_ops {
-   struct module *owner;
-   int (*add)(struct soc_camera_device *);
-   void (*remove)(struct soc_camera_device *);
-   int (*clock_start)(struct soc_camera_host *);
-   void (*clock_stop)(struct soc_camera_host *);
-   /*
-* .get_formats() is called for each client device format, but
-* .put_formats() is only called once. Further, if any of the calls to
-* .get_formats() fail, .put_formats() will not be called at all, the
-* failing .get_formats() must then clean up internally.
-*/
-   int (*get_formats)(struct soc_camera_device *, unsigned int,
-  struct soc_camera_format_xlate *);
-   void (*put_formats)(struct soc_camera_device *);
-   int (*get_selection)(struct soc_camera_device *, struct v4l2_selection 
*);
-   int (*set_selection)(struct soc_camera_device *, struct v4l2_selection 
*);
-   /*
-* The difference to .set_selection() is, that .set_liveselection is 
not allowed
-* to change the output sizes
-*/
-   int (*set_liveselection)(struct soc_camera_device *, struct 
v4l2_selection *);
-   int (*set_fmt)(struct soc_camera_device *, struct v4l2_format *);
-   int (*try_fmt)(struct soc_camera_device *, struct v4l2_format *);
-   int (*init_videobuf2)(struct vb2_queue *,
- struct soc_camera_device *);
-   int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
-   int (*set_bus_param)(struct soc_camera_device *);
-   int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
-   int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
-   int (*enum_framesizes)(struct soc_camera_device *, struct 
v4l2_frmsizeenum *);
-   __poll_t (*poll)(struct file *, poll_table *);
-};
-
-#define SOCAM_SENSOR_INVERT_