diff mbox

[03/12] OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address

Message ID 71e703f319eacd5a7196d8b34601b52e32b946d3.1403807781.git.jsarha@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jyri Sarha June 26, 2014, 7:20 p.m. UTC
The hdmi_wp physical base address is needed for hdmi audio dma.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/video/fbdev/omap2/dss/hdmi.h    |    2 ++
 drivers/video/fbdev/omap2/dss/hdmi_wp.c |    6 ++++++
 2 files changed, 8 insertions(+)

Comments

Tomi Valkeinen June 27, 2014, 10:41 a.m. UTC | #1
On 26/06/14 22:20, Jyri Sarha wrote:
> The hdmi_wp physical base address is needed for hdmi audio dma.
> 
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
>  drivers/video/fbdev/omap2/dss/hdmi.h    |    2 ++
>  drivers/video/fbdev/omap2/dss/hdmi_wp.c |    6 ++++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
> index 1f01068..927cb4d 100644
> --- a/drivers/video/fbdev/omap2/dss/hdmi.h
> +++ b/drivers/video/fbdev/omap2/dss/hdmi.h
> @@ -250,6 +250,7 @@ struct hdmi_core_audio_config {
>  
>  struct hdmi_wp_data {
>  	void __iomem *base;
> +	phys_addr_t phys_base;
>  };
>  
>  struct hdmi_pll_data {
> @@ -317,6 +318,7 @@ void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp,
>  void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt,
>  		struct omap_video_timings *timings, struct hdmi_config *param);
>  int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp);
> +phys_addr_t hdmi_wp_get_phys_addr(struct hdmi_wp_data *wp);
>  
>  /* HDMI PLL funcs */
>  int hdmi_pll_enable(struct hdmi_pll_data *pll, struct hdmi_wp_data *wp);
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi_wp.c b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
> index 496327e..eadd4ed 100644
> --- a/drivers/video/fbdev/omap2/dss/hdmi_wp.c
> +++ b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
> @@ -247,6 +247,7 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
>  		DSSERR("can't get WP mem resource\n");
>  		return -EINVAL;
>  	}
> +	wp->phys_base = res->start;
>  
>  	wp->base = devm_ioremap_resource(&pdev->dev, res);
>  	if (IS_ERR(wp->base)) {
> @@ -256,3 +257,8 @@ int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
>  
>  	return 0;
>  }
> +
> +phys_addr_t hdmi_wp_get_phys_addr(struct hdmi_wp_data *wp)
> +{
> +	return wp->phys_base;
> +}
> 

Maybe it would be better to have a function which returns the phys
address for audio DMA? Only that one register is needed, right?

That makes the purpose of the function more obvious, and also if you
return the phys_base, the caller needs to know the offset to the DMA
register, and that offset should be a WP internal value.

 Tomi
Jyri Sarha June 27, 2014, 11:35 a.m. UTC | #2
On 06/27/2014 01:41 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
>> The hdmi_wp physical base address is needed for hdmi audio dma.
...
>
> Maybe it would be better to have a function which returns the phys
> address for audio DMA? Only that one register is needed, right?
>
> That makes the purpose of the function more obvious, and also if you
> return the phys_base, the caller needs to know the offset to the DMA
> register, and that offset should be a WP internal value.
>

Sounds good, I'll do that.

Cheers,
Jyri
diff mbox

Patch

diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
index 1f01068..927cb4d 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -250,6 +250,7 @@  struct hdmi_core_audio_config {
 
 struct hdmi_wp_data {
 	void __iomem *base;
+	phys_addr_t phys_base;
 };
 
 struct hdmi_pll_data {
@@ -317,6 +318,7 @@  void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp,
 void hdmi_wp_init_vid_fmt_timings(struct hdmi_video_format *video_fmt,
 		struct omap_video_timings *timings, struct hdmi_config *param);
 int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp);
+phys_addr_t hdmi_wp_get_phys_addr(struct hdmi_wp_data *wp);
 
 /* HDMI PLL funcs */
 int hdmi_pll_enable(struct hdmi_pll_data *pll, struct hdmi_wp_data *wp);
diff --git a/drivers/video/fbdev/omap2/dss/hdmi_wp.c b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
index 496327e..eadd4ed 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi_wp.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
@@ -247,6 +247,7 @@  int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
 		DSSERR("can't get WP mem resource\n");
 		return -EINVAL;
 	}
+	wp->phys_base = res->start;
 
 	wp->base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(wp->base)) {
@@ -256,3 +257,8 @@  int hdmi_wp_init(struct platform_device *pdev, struct hdmi_wp_data *wp)
 
 	return 0;
 }
+
+phys_addr_t hdmi_wp_get_phys_addr(struct hdmi_wp_data *wp)
+{
+	return wp->phys_base;
+}