Re: [PATCH 1/3] omap-dma: Allow compile-testing omap1_camera driver

2014-09-09 Thread Nishanth Menon
hain_transfers(int chain_id);
> -extern int omap_stop_dma_chain_transfers(int chain_id);
>  extern int omap_get_dma_chain_index(int chain_id, int *ei, int *fi);
>  extern int omap_get_dma_chain_dst_pos(int chain_id);
>  extern int omap_get_dma_chain_src_pos(int chain_id);
> @@ -377,6 +349,87 @@ extern int omap_modify_dma_chain_params(int chain_id,
>  extern int omap_dma_chain_status(int chain_id);
>  #endif
>  
> +#ifndef CONFIG_COMPILE_TEST
> +extern int omap_request_dma(int dev_id, const char *dev_name,
> + void (*callback)(int lch, u16 ch_status, void *data),
> + void *data, int *dma_ch);
> +extern void omap_free_dma(int ch);
> +extern void omap_start_dma(int lch);
> +extern void omap_stop_dma(int lch);
> +extern void omap_set_dma_transfer_params(int lch, int data_type,
> +  int elem_count, int frame_count,
> +  int sync_mode,
> +  int dma_trigger, int src_or_dst_synch);
> +extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
> + unsigned long src_start,
> + int src_ei, int src_fi);
> +extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
> +  unsigned long dest_start,
> +  int dst_ei, int dst_fi);
> +extern void omap_set_dma_dest_burst_mode(int lch,
> +  enum omap_dma_burst_mode burst_mode);
> +extern void omap_dma_link_lch(int lch_head, int lch_queue);
> +
> +#ifndef CONFIG_ARCH_OMAP1
> +extern int omap_request_dma_chain(int dev_id, const char *dev_name,
> +   void (*callback) (int lch, u16 ch_status,
> + void *data),
> +   int *chain_id, int no_of_chans,
> +   int chain_mode,
> +   struct omap_dma_channel_params params);
> +extern int omap_free_dma_chain(int chain_id);
> +extern int omap_start_dma_chain_transfers(int chain_id);
> +extern int omap_stop_dma_chain_transfers(int chain_id);
> +#endif /* CONFIG_ARCH_OMAP1 */
> +#else
> + /* Stubs for compile testing some drivers on other archs */
> +
> +static inline
> +int omap_request_dma(int dev_id, const char *dev_name,
> +  void (*callback)(int lch, u16 ch_status, void *data),
> +  void *data, int *dma_ch) { return 0; }
> +
> +static inline void omap_free_dma(int ch) {}
> +static inline void omap_start_dma(int lch) {}
> +static inline void omap_stop_dma(int lch) {}
> +
> +static inline
> +void omap_set_dma_transfer_params(int lch, int data_type,
> +   int elem_count, int frame_count,
> +   int sync_mode,
> +   int dma_trigger, int src_or_dst_synch) {}
> +
> +static inline
> +void omap_set_dma_src_params(int lch, int src_port, int src_amode,
> +  unsigned long src_start,
> +  int src_ei, int src_fi) {}
> +
> +static inline
> +void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
> +   unsigned long dest_start,
> +   int dst_ei, int dst_fi) {}
> +
> +static inline
> +void omap_set_dma_dest_burst_mode(int lch,
> +   enum omap_dma_burst_mode burst_mode) {}
> +
> +static inline
> +void omap_dma_link_lch(int lch_head, int lch_queue) {}
> +
> +static inline
> +int omap_request_dma_chain(int dev_id, const char *dev_name,
> +void (*callback) (int lch, u16 ch_status,
> +      void *data),
> +int *chain_id, int no_of_chans,
> +int chain_mode,
> +struct omap_dma_channel_params params) { return 0; }
> +
> +static inline int omap_free_dma_chain(int chain_id) { return 0; }
> +static inline int omap_start_dma_chain_transfers(int chain_id) { return 0; }
> +static inline int omap_stop_dma_chain_transfers(int chain_id) { return 0; }
> +
> +#endif /* CONFIG_COMPILE_TEST */
> +
>  #if defined(CONFIG_ARCH_OMAP1) && IS_ENABLED(CONFIG_FB_OMAP)
>  #include 
>  #else
> 


-- 
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] staging: allow omap4iss to be modular

2014-06-11 Thread Nishanth Menon
On 06/11/2014 09:49 AM, Arnd Bergmann wrote:
> On Wednesday 11 June 2014 09:42:04 Nishanth Menon wrote:
>> On 06/11/2014 09:35 AM, Arnd Bergmann wrote:
>>> The OMAP4 camera support depends on I2C and VIDEO_V4L2, both
>>> of which can be loadable modules. This causes build failures
>>> if we want the camera driver to be built-in.
>>>
>>> This can be solved by turning the option into "tristate",
>>> which unfortunately causes another problem, because the
>>> driver incorrectly calls a platform-internal interface
>>> for omap4_ctrl_pad_readl/omap4_ctrl_pad_writel.
>>> To work around that, we can export those symbols, but
>>> that isn't really the correct solution, as we should not
>>> have dependencies on platform code this way.
>>>
>>> Signed-off-by: Arnd Bergmann 
>>> ---
>>> This is one of just two patches we currently need to get
>>> 'make allmodconfig' to build again on ARM.
>>>
>>> diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
>>> index 751f354..05d2d98 100644
>>> --- a/arch/arm/mach-omap2/control.c
>>> +++ b/arch/arm/mach-omap2/control.c
>>> @@ -190,11 +190,13 @@ u32 omap4_ctrl_pad_readl(u16 offset)
>>>  {
>>> return readl_relaxed(OMAP4_CTRL_PAD_REGADDR(offset));
>>>  }
>>> +EXPORT_SYMBOL_GPL(omap4_ctrl_pad_readl);
>>>  
>>>  void omap4_ctrl_pad_writel(u32 val, u16 offset)
>>>  {
>>> writel_relaxed(val, OMAP4_CTRL_PAD_REGADDR(offset));
>>>  }
>>> +EXPORT_SYMBOL_GPL(omap4_ctrl_pad_writel);
>>>  
>>>  #ifdef CONFIG_ARCH_OMAP3
>>>  
>>> diff --git a/drivers/staging/media/omap4iss/Kconfig 
>>> b/drivers/staging/media/omap4iss/Kconfig
>>> index 78b0fba..0c3e3c1 100644
>>> --- a/drivers/staging/media/omap4iss/Kconfig
>>> +++ b/drivers/staging/media/omap4iss/Kconfig
>>> @@ -1,5 +1,5 @@
>>>  config VIDEO_OMAP4
>>> -   bool "OMAP 4 Camera support"
>>> +   tristate "OMAP 4 Camera support"
>>> depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && I2C && ARCH_OMAP4
>>> select VIDEOBUF2_DMA_CONTIG
>>> ---help---
>>>
>>
>> This was discussed in detail here:
>> http://marc.info/?t=14019869251&r=1&w=2
>> Direct dependency from a staging driver to mach-omap2 driver is not
>> something we'd like, right?
> 
> So it was decided to just leave ARM allmodconfig broken?
> 
> Why not at least do this instead?
> 
> 8<
> From 3a965f4fd5a6b3ef4a66aa4e7c916cfd34fd5706 Mon Sep 17 00:00:00 2001
> From: Arnd Bergmann 
> Date: Tue, 21 Jan 2014 09:32:43 +0100
> Subject: [PATCH] [media] staging: tighten omap4iss dependencies
> 
> The OMAP4 camera support depends on I2C and VIDEO_V4L2, both
> of which can be loadable modules. This causes build failures
> if we want the camera driver to be built-in.
> 
> This can be solved by turning the option into "tristate",
> which unfortunately causes another problem, because the
> driver incorrectly calls a platform-internal interface
> for omap4_ctrl_pad_readl/omap4_ctrl_pad_writel.
> 
> Instead, this patch just forbids the invalid configurations
> and ensures that the driver can only be built if all its
> dependencies are built-in.
> 
> Signed-off-by: Arnd Bergmann 
> 
> diff --git a/drivers/staging/media/omap4iss/Kconfig 
> b/drivers/staging/media/omap4iss/Kconfig
> index 78b0fba..8afc6fe 100644
> --- a/drivers/staging/media/omap4iss/Kconfig
> +++ b/drivers/staging/media/omap4iss/Kconfig
> @@ -1,6 +1,6 @@
>  config VIDEO_OMAP4
>   bool "OMAP 4 Camera support"
> - depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && I2C && ARCH_OMAP4
> + depends on VIDEO_V4L2=y && VIDEO_V4L2_SUBDEV_API && I2C=y && ARCH_OMAP4
>   select VIDEOBUF2_DMA_CONTIG
>   ---help---
> Driver for an OMAP 4 ISS controller.
> 

I am ok with this if Tony and Laurent have no issues. Considering that
Laurent was working on coverting iss driver to dt, the detailed
discussion could take place at that point in time.

-- 
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] staging: allow omap4iss to be modular

2014-06-11 Thread Nishanth Menon
On 06/11/2014 09:35 AM, Arnd Bergmann wrote:
> The OMAP4 camera support depends on I2C and VIDEO_V4L2, both
> of which can be loadable modules. This causes build failures
> if we want the camera driver to be built-in.
> 
> This can be solved by turning the option into "tristate",
> which unfortunately causes another problem, because the
> driver incorrectly calls a platform-internal interface
> for omap4_ctrl_pad_readl/omap4_ctrl_pad_writel.
> To work around that, we can export those symbols, but
> that isn't really the correct solution, as we should not
> have dependencies on platform code this way.
> 
> Signed-off-by: Arnd Bergmann 
> ---
> This is one of just two patches we currently need to get
> 'make allmodconfig' to build again on ARM.
> 
> diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
> index 751f354..05d2d98 100644
> --- a/arch/arm/mach-omap2/control.c
> +++ b/arch/arm/mach-omap2/control.c
> @@ -190,11 +190,13 @@ u32 omap4_ctrl_pad_readl(u16 offset)
>  {
>   return readl_relaxed(OMAP4_CTRL_PAD_REGADDR(offset));
>  }
> +EXPORT_SYMBOL_GPL(omap4_ctrl_pad_readl);
>  
>  void omap4_ctrl_pad_writel(u32 val, u16 offset)
>  {
>   writel_relaxed(val, OMAP4_CTRL_PAD_REGADDR(offset));
>  }
> +EXPORT_SYMBOL_GPL(omap4_ctrl_pad_writel);
>  
>  #ifdef CONFIG_ARCH_OMAP3
>  
> diff --git a/drivers/staging/media/omap4iss/Kconfig 
> b/drivers/staging/media/omap4iss/Kconfig
> index 78b0fba..0c3e3c1 100644
> --- a/drivers/staging/media/omap4iss/Kconfig
> +++ b/drivers/staging/media/omap4iss/Kconfig
> @@ -1,5 +1,5 @@
>  config VIDEO_OMAP4
> - bool "OMAP 4 Camera support"
> + tristate "OMAP 4 Camera support"
>   depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API && I2C && ARCH_OMAP4
>   select VIDEOBUF2_DMA_CONTIG
>   ---help---
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

This was discussed in detail here:
http://marc.info/?t=14019869251&r=1&w=2
Direct dependency from a staging driver to mach-omap2 driver is not
something we'd like, right?

-- 
Regards,
Nishanth Menon
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html