* [PATCH 12/12] OMAPDSS: Remove all references to obsolete HDMI audio callbacks
From: Jyri Sarha @ 2014-06-26 19:21 UTC (permalink / raw)
To: alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
detheridge, jyri.sarha, Jyri Sarha
In-Reply-To: <cover.1403807781.git.jsarha@ti.com>
In new model these callbacks are obsolete since the ASoC component
drivers are integrated into the HDMI drivers and no callbacks are
needed anymore.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
.../fbdev/omap2/displays-new/connector-hdmi.c | 99 --------------------
.../fbdev/omap2/displays-new/encoder-tpd12s015.c | 56 -----------
include/video/omapdss.h | 31 ------
3 files changed, 186 deletions(-)
diff --git a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c b/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c
index 131c6e2..dd36d71 100644
--- a/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c
+++ b/drivers/video/fbdev/omap2/displays-new/connector-hdmi.c
@@ -170,98 +170,6 @@ static bool hdmic_detect(struct omap_dss_device *dssdev)
return in->ops.hdmi->detect(in);
}
-static int hdmic_audio_enable(struct omap_dss_device *dssdev)
-{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
- struct omap_dss_device *in = ddata->in;
- int r;
-
- /* enable audio only if the display is active */
- if (!omapdss_device_is_enabled(dssdev))
- return -EPERM;
-
- r = in->ops.hdmi->audio_enable(in);
- if (r)
- return r;
-
- dssdev->audio_state = OMAP_DSS_AUDIO_ENABLED;
-
- return 0;
-}
-
-static void hdmic_audio_disable(struct omap_dss_device *dssdev)
-{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
- struct omap_dss_device *in = ddata->in;
-
- in->ops.hdmi->audio_disable(in);
-
- dssdev->audio_state = OMAP_DSS_AUDIO_DISABLED;
-}
-
-static int hdmic_audio_start(struct omap_dss_device *dssdev)
-{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
- struct omap_dss_device *in = ddata->in;
- int r;
-
- /*
- * No need to check the panel state. It was checked when trasitioning
- * to AUDIO_ENABLED.
- */
- if (dssdev->audio_state != OMAP_DSS_AUDIO_ENABLED)
- return -EPERM;
-
- r = in->ops.hdmi->audio_start(in);
- if (r)
- return r;
-
- dssdev->audio_state = OMAP_DSS_AUDIO_PLAYING;
-
- return 0;
-}
-
-static void hdmic_audio_stop(struct omap_dss_device *dssdev)
-{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
- struct omap_dss_device *in = ddata->in;
-
- in->ops.hdmi->audio_stop(in);
-
- dssdev->audio_state = OMAP_DSS_AUDIO_ENABLED;
-}
-
-static bool hdmic_audio_supported(struct omap_dss_device *dssdev)
-{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
- struct omap_dss_device *in = ddata->in;
-
- if (!omapdss_device_is_enabled(dssdev))
- return false;
-
- return in->ops.hdmi->audio_supported(in);
-}
-
-static int hdmic_audio_config(struct omap_dss_device *dssdev,
- struct omap_dss_audio *audio)
-{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
- struct omap_dss_device *in = ddata->in;
- int r;
-
- /* config audio only if the display is active */
- if (!omapdss_device_is_enabled(dssdev))
- return -EPERM;
-
- r = in->ops.hdmi->audio_config(in, audio);
- if (r)
- return r;
-
- dssdev->audio_state = OMAP_DSS_AUDIO_CONFIGURED;
-
- return 0;
-}
-
static int hdmic_set_hdmi_mode(struct omap_dss_device *dssdev, bool hdmi_mode)
{
struct panel_drv_data *ddata = to_panel_data(dssdev);
@@ -296,13 +204,6 @@ static struct omap_dss_driver hdmic_driver = {
.detect = hdmic_detect,
.set_hdmi_mode = hdmic_set_hdmi_mode,
.set_hdmi_infoframe = hdmic_set_infoframe,
-
- .audio_enable = hdmic_audio_enable,
- .audio_disable = hdmic_audio_disable,
- .audio_start = hdmic_audio_start,
- .audio_stop = hdmic_audio_stop,
- .audio_supported = hdmic_audio_supported,
- .audio_config = hdmic_audio_config,
};
static int hdmic_probe_pdata(struct platform_device *pdev)
diff --git a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
index c891d8f..235e3d5 100644
--- a/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
+++ b/drivers/video/fbdev/omap2/displays-new/encoder-tpd12s015.c
@@ -193,55 +193,6 @@ static bool tpd_detect(struct omap_dss_device *dssdev)
return gpio_get_value_cansleep(ddata->hpd_gpio);
}
-static int tpd_audio_enable(struct omap_dss_device *dssdev)
-{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
- struct omap_dss_device *in = ddata->in;
-
- return in->ops.hdmi->audio_enable(in);
-}
-
-static void tpd_audio_disable(struct omap_dss_device *dssdev)
-{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
- struct omap_dss_device *in = ddata->in;
-
- in->ops.hdmi->audio_disable(in);
-}
-
-static int tpd_audio_start(struct omap_dss_device *dssdev)
-{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
- struct omap_dss_device *in = ddata->in;
-
- return in->ops.hdmi->audio_start(in);
-}
-
-static void tpd_audio_stop(struct omap_dss_device *dssdev)
-{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
- struct omap_dss_device *in = ddata->in;
-
- in->ops.hdmi->audio_stop(in);
-}
-
-static bool tpd_audio_supported(struct omap_dss_device *dssdev)
-{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
- struct omap_dss_device *in = ddata->in;
-
- return in->ops.hdmi->audio_supported(in);
-}
-
-static int tpd_audio_config(struct omap_dss_device *dssdev,
- struct omap_dss_audio *audio)
-{
- struct panel_drv_data *ddata = to_panel_data(dssdev);
- struct omap_dss_device *in = ddata->in;
-
- return in->ops.hdmi->audio_config(in, audio);
-}
-
static int tpd_set_infoframe(struct omap_dss_device *dssdev,
const struct hdmi_avi_infoframe *avi)
{
@@ -275,13 +226,6 @@ static const struct omapdss_hdmi_ops tpd_hdmi_ops = {
.detect = tpd_detect,
.set_infoframe = tpd_set_infoframe,
.set_hdmi_mode = tpd_set_hdmi_mode,
-
- .audio_enable = tpd_audio_enable,
- .audio_disable = tpd_audio_disable,
- .audio_start = tpd_audio_start,
- .audio_stop = tpd_audio_stop,
- .audio_supported = tpd_audio_supported,
- .audio_config = tpd_audio_config,
};
static int tpd_probe_pdata(struct platform_device *pdev)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 069dfca..9035325 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -635,19 +635,6 @@ struct omapdss_hdmi_ops {
int (*set_hdmi_mode)(struct omap_dss_device *dssdev, bool hdmi_mode);
int (*set_infoframe)(struct omap_dss_device *dssdev,
const struct hdmi_avi_infoframe *avi);
-
- /*
- * Note: These functions might sleep. Do not call while
- * holding a spinlock/readlock.
- */
- int (*audio_enable)(struct omap_dss_device *dssdev);
- void (*audio_disable)(struct omap_dss_device *dssdev);
- bool (*audio_supported)(struct omap_dss_device *dssdev);
- int (*audio_config)(struct omap_dss_device *dssdev,
- struct omap_dss_audio *audio);
- /* Note: These functions may not sleep */
- int (*audio_start)(struct omap_dss_device *dssdev);
- void (*audio_stop)(struct omap_dss_device *dssdev);
};
struct omapdss_dsi_ops {
@@ -858,24 +845,6 @@ struct omap_dss_driver {
int (*set_hdmi_mode)(struct omap_dss_device *dssdev, bool hdmi_mode);
int (*set_hdmi_infoframe)(struct omap_dss_device *dssdev,
const struct hdmi_avi_infoframe *avi);
-
- /*
- * For display drivers that support audio. This encompasses
- * HDMI and DisplayPort at the moment.
- */
- /*
- * Note: These functions might sleep. Do not call while
- * holding a spinlock/readlock.
- */
- int (*audio_enable)(struct omap_dss_device *dssdev);
- void (*audio_disable)(struct omap_dss_device *dssdev);
- bool (*audio_supported)(struct omap_dss_device *dssdev);
- int (*audio_config)(struct omap_dss_device *dssdev,
- struct omap_dss_audio *audio);
- /* Note: These functions may not sleep */
- int (*audio_start)(struct omap_dss_device *dssdev);
- void (*audio_stop)(struct omap_dss_device *dssdev);
-
};
enum omapdss_version omapdss_get_version(void);
--
1.7.9.5
^ permalink raw reply related
* Please ignore this orphan patch.
From: Jyri Sarha @ 2014-06-26 19:26 UTC (permalink / raw)
To: alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
detheridge, jyri.sarha
In-Reply-To: <8e2fa441e7ffab7c5eaa68f72eb19691a9d26692.1403807726.git.jsarha@ti.com>
Best regards,
Jyri
^ permalink raw reply
* RE: [PATCH] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
From: Dexuan Cui @ 2014-06-26 20:32 UTC (permalink / raw)
To: Greg KH
Cc: linux-fbdev@vger.kernel.org, jasowang@redhat.com,
driverdev-devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org, tomi.valkeinen@ti.com,
olaf@aepfle.de, apw@canonical.com, plagnioj@jcrosoft.com,
Haiyang Zhang
In-Reply-To: <20140626033608.GA32654@kroah.com>
> > >> MS-TFS: 157532
> >
> > > What is this line for?
> >
> > Hi Greg,
> > This line is for our internal bug repository.
> > We have an automated system to correlate bugs with fixes so that our test
> > team knows when a bug fix has been accepted upstream and they need to
> > write a new test case for it.
> >
> > The MS-TFS line has appeared in the commit description for a while if you
> > search for it in 'git log' of linux-next.
> >
> > Please let us know if you have further comments.
>
> Please don't add marker lines like this that provide no relevancy to
> anyone else. I don't allow gerrit ids for the same reason. If you want
> to refer to a public bug tracker, that's great, otherwise, don't
> include it.
>
> greg k-h
Ok, I'll remove the line and re-submit a v2 patch(the patch itself will be
the same).
Thanks,
-- Dexuan
^ permalink raw reply
* [PATCH v2] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
From: Dexuan Cui @ 2014-06-26 20:37 UTC (permalink / raw)
To: gregkh, linux-kernel, driverdev-devel, plagnioj, tomi.valkeinen,
linux-fbdev, olaf, apw, jasowang
Cc: haiyangz
Currently the VSC has no chance to notify the VSP of the dirty rectangle on VM
panic because the notification work is done in a workqueue, and in panic() the
kernel typically ends up in an infinite loop, and a typical kernel config has
CONFIG_PREEMPT_VOLUNTARY=y and CONFIG_PREEMPT is not set, so a context switch
can't happen in panic() and the workqueue won't have a chance to run. As a
result, the VM Connection window can't refresh until it's closed and we
re-connect to the VM.
We can register a handler on panic_notifier_list: the handler can notify
the VSC and switch the framebuffer driver to a "synchronous mode", meaning
the VSC flushes any future framebuffer change to the VSP immediately.
v2: removed the MS-TFS line in the commit message
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/video/fbdev/hyperv_fb.c | 58 ++++++++++++++++++++++++++++++++++++++---
1 file changed, 55 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/hyperv_fb.c b/drivers/video/fbdev/hyperv_fb.c
index e23392e..291d171 100644
--- a/drivers/video/fbdev/hyperv_fb.c
+++ b/drivers/video/fbdev/hyperv_fb.c
@@ -226,11 +226,16 @@ struct hvfb_par {
u8 recv_buf[MAX_VMBUS_PKT_SIZE];
};
+static struct fb_info *hvfb_info;
+
static uint screen_width = HVFB_WIDTH;
static uint screen_height = HVFB_HEIGHT;
static uint screen_depth;
static uint screen_fb_size;
+/* If true, the VSC notifies the VSP on every framebuffer change */
+static bool synchronous_fb;
+
/* Send message to Hyper-V host */
static inline int synthvid_send(struct hv_device *hdev,
struct synthvid_msg *msg)
@@ -532,6 +537,20 @@ static void hvfb_update_work(struct work_struct *w)
schedule_delayed_work(&par->dwork, HVFB_UPDATE_DELAY);
}
+static int hvfb_on_panic(struct notifier_block *nb,
+ unsigned long e, void *p)
+{
+ if (hvfb_info)
+ synthvid_update(hvfb_info);
+
+ synchronous_fb = true;
+
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block hvfb_panic_nb = {
+ .notifier_call = hvfb_on_panic,
+};
/* Framebuffer operation handlers */
@@ -582,14 +601,41 @@ static int hvfb_blank(int blank, struct fb_info *info)
return 1; /* get fb_blank to set the colormap to all black */
}
+static void hvfb_cfb_fillrect(struct fb_info *p,
+ const struct fb_fillrect *rect)
+{
+ cfb_fillrect(p, rect);
+
+ if (unlikely(synchronous_fb))
+ synthvid_update(p);
+}
+
+static void hvfb_cfb_copyarea(struct fb_info *p,
+ const struct fb_copyarea *area)
+{
+ cfb_copyarea(p, area);
+
+ if (unlikely(synchronous_fb))
+ synthvid_update(p);
+}
+
+static void hvfb_cfb_imageblit(struct fb_info *p,
+ const struct fb_image *image)
+{
+ cfb_imageblit(p, image);
+
+ if (unlikely(synchronous_fb))
+ synthvid_update(p);
+}
+
static struct fb_ops hvfb_ops = {
.owner = THIS_MODULE,
.fb_check_var = hvfb_check_var,
.fb_set_par = hvfb_set_par,
.fb_setcolreg = hvfb_setcolreg,
- .fb_fillrect = cfb_fillrect,
- .fb_copyarea = cfb_copyarea,
- .fb_imageblit = cfb_imageblit,
+ .fb_fillrect = hvfb_cfb_fillrect,
+ .fb_copyarea = hvfb_cfb_copyarea,
+ .fb_imageblit = hvfb_cfb_imageblit,
.fb_blank = hvfb_blank,
};
@@ -801,6 +847,9 @@ static int hvfb_probe(struct hv_device *hdev,
par->fb_ready = true;
+ hvfb_info = info;
+ atomic_notifier_chain_register(&panic_notifier_list, &hvfb_panic_nb);
+
return 0;
error:
@@ -820,6 +869,9 @@ static int hvfb_remove(struct hv_device *hdev)
struct fb_info *info = hv_get_drvdata(hdev);
struct hvfb_par *par = info->par;
+ atomic_notifier_chain_unregister(&panic_notifier_list, &hvfb_panic_nb);
+ hvfb_info = NULL;
+
par->update = false;
par->fb_ready = false;
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] pwm-backlight: use devm_gpiod_get_optional()
From: Thierry Reding @ 2014-06-27 6:13 UTC (permalink / raw)
To: Lee Jones
Cc: Alexandre Courbot, Jingoo Han, Bryan Wu, linux-fbdev,
linux-kernel, gnurou
In-Reply-To: <20140625120331.GE13518@lee--X1>
[-- Attachment #1: Type: text/plain, Size: 1431 bytes --]
On Wed, Jun 25, 2014 at 01:03:31PM +0100, Lee Jones wrote:
> On Wed, 25 Jun 2014, Thierry Reding wrote:
> > On Wed, Jun 25, 2014 at 10:54:47AM +0100, Lee Jones wrote:
> > > > Make use of the new devm_gpiod_get_optional() to simplify the probe
> > > > code.
> > > >
> > > > Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> > > > ---
> > > > drivers/video/backlight/pwm_bl.c | 7 ++-----
> > > > 1 file changed, 2 insertions(+), 5 deletions(-)
> > >
> > > Looks good. Applied, thanks.
> >
> > Technically pwm_bl.c is my turf. However I only adopted it way back when
> > the backlight subsystem was orphaned, but it seems Jingoo, Bryan and you
> > are taking good care of it these days, so perhaps it would be a good
> > idea to move it back to your custody?
>
> Yeah, the whole 'driver maintainer' sketch could get pretty complex.
> It's pretty clean-cut in the PWM subsystem as only one exists, but
> Backlight and MFD have a whole bunch, and I don't usually wait for
> them to Ack/Nack before applying or providing review comments.
>
> I'm happy to play it however you like really. I'm sure the boys and I
> can handle it if you so wish. Even better if you would say in the
> MAINTAINERS file and provide review comments when patches are
> submitted. I do think all 'drivers/video/backlight' changes should go
> in via the Backlight tree though.
Okay, that works for me.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 14/15] OMAPDSS: HDMI: remove the unused code
From: Tomi Valkeinen @ 2014-06-27 10:16 UTC (permalink / raw)
To: Jyri Sarha, linux-fbdev, linux-omap, Archit Taneja
In-Reply-To: <53AC6EDD.6040300@ti.com>
[-- Attachment #1: Type: text/plain, Size: 2605 bytes --]
On 26/06/14 22:05, Jyri Sarha wrote:
> On 06/24/2014 01:03 PM, Tomi Valkeinen wrote:
>> We no longer need the horrible driver internal videmode tables, which
>> were used to decide if a given videomode is a HDMI or DVI mode. So
>> remove all related code.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> ---
>> drivers/video/fbdev/omap2/dss/hdmi.h | 11 -
>> drivers/video/fbdev/omap2/dss/hdmi_common.c | 316
>> ----------------------------
>> 2 files changed, 327 deletions(-)
>>
>> diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h
>> b/drivers/video/fbdev/omap2/dss/hdmi.h
>> index e3956defc1c3..262771b9b76b 100644
>> --- a/drivers/video/fbdev/omap2/dss/hdmi.h
>> +++ b/drivers/video/fbdev/omap2/dss/hdmi.h
> ...
>> @@ -192,7 +187,6 @@ struct hdmi_video_format {
>>
>> struct hdmi_config {
>> struct omap_video_timings timings;
>> - struct hdmi_cm cm;
>> struct hdmi_avi_infoframe infoframe;
>> enum hdmi_core_hdmi_dvi hdmi_dvi_mode;
>> };
>
> The HDMI audio finctionality is broken already now, but removing
> hdmi_config.cm will cause compilation failure if HDMI audio is enabled.
Ah, true.
> I'll mail a patch set to fix OMAP4+ HDMI audio shortly. The set should
> be applied on top of these patches and it fixes (obviously) the
> compilation issue too.
I'll rather fix my series. It's not good to introduce compilation errors.
So I'll just add the following in my patches:
diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c
b/drivers/video/fbdev/omap2/dss/hdmi4.c
index 342ddb47811a..6a8550cf43e5 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -491,7 +491,7 @@ static int hdmi_audio_enable(struct omap_dss_device
*dssdev)
mutex_lock(&hdmi.lock);
- if (!hdmi_mode_has_audio(hdmi.cfg.cm.mode)) {
+ if (!hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode)) {
r = -EPERM;
goto err;
}
@@ -529,7 +529,7 @@ static bool hdmi_audio_supported(struct
omap_dss_device *dssdev)
mutex_lock(&hdmi.lock);
- r = hdmi_mode_has_audio(hdmi.cfg.cm.mode);
+ r = hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode);
mutex_unlock(&hdmi.lock);
return r;
@@ -543,7 +543,7 @@ static int hdmi_audio_config(struct omap_dss_device
*dssdev,
mutex_lock(&hdmi.lock);
- if (!hdmi_mode_has_audio(hdmi.cfg.cm.mode)) {
+ if (!hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode)) {
r = -EPERM;
goto err;
}
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply related
* Re: [PATCH 14/15] OMAPDSS: HDMI: remove the unused code
From: Tomi Valkeinen @ 2014-06-27 10:20 UTC (permalink / raw)
To: Jyri Sarha, linux-fbdev, linux-omap, Archit Taneja
In-Reply-To: <53AD4485.3070506@ti.com>
[-- Attachment #1: Type: text/plain, Size: 1828 bytes --]
On 27/06/14 13:16, Tomi Valkeinen wrote:
> On 26/06/14 22:05, Jyri Sarha wrote:
>> On 06/24/2014 01:03 PM, Tomi Valkeinen wrote:
>>> We no longer need the horrible driver internal videmode tables, which
>>> were used to decide if a given videomode is a HDMI or DVI mode. So
>>> remove all related code.
>>>
>>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>>> ---
>>> drivers/video/fbdev/omap2/dss/hdmi.h | 11 -
>>> drivers/video/fbdev/omap2/dss/hdmi_common.c | 316
>>> ----------------------------
>>> 2 files changed, 327 deletions(-)
>>>
>>> diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h
>>> b/drivers/video/fbdev/omap2/dss/hdmi.h
>>> index e3956defc1c3..262771b9b76b 100644
>>> --- a/drivers/video/fbdev/omap2/dss/hdmi.h
>>> +++ b/drivers/video/fbdev/omap2/dss/hdmi.h
>> ...
>>> @@ -192,7 +187,6 @@ struct hdmi_video_format {
>>>
>>> struct hdmi_config {
>>> struct omap_video_timings timings;
>>> - struct hdmi_cm cm;
>>> struct hdmi_avi_infoframe infoframe;
>>> enum hdmi_core_hdmi_dvi hdmi_dvi_mode;
>>> };
>>
>> The HDMI audio finctionality is broken already now, but removing
>> hdmi_config.cm will cause compilation failure if HDMI audio is enabled.
>
> Ah, true.
>
>> I'll mail a patch set to fix OMAP4+ HDMI audio shortly. The set should
>> be applied on top of these patches and it fixes (obviously) the
>> compilation issue too.
>
> I'll rather fix my series. It's not good to introduce compilation errors.
>
> So I'll just add the following in my patches:
>
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c
Oh, and the same for hdmi5.c. Although that code is not compiled anyway,
but I think it's still better to fix it.
That could introduce a conflict with your series, but it's trivial.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 03/12] OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address
From: Tomi Valkeinen @ 2014-06-27 10:41 UTC (permalink / raw)
To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha
In-Reply-To: <71e703f319eacd5a7196d8b34601b52e32b946d3.1403807781.git.jsarha@ti.com>
[-- Attachment #1: Type: text/plain, Size: 2284 bytes --]
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
From: Tomi Valkeinen @ 2014-06-27 11:10 UTC (permalink / raw)
To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha
In-Reply-To: <69f5b1481bd8b8a005b5d9142626f3529a0d71c7.1403807781.git.jsarha@ti.com>
[-- Attachment #1: Type: text/plain, Size: 3618 bytes --]
On 26/06/14 22:20, Jyri Sarha wrote:
> Integrate ASoC DAI component driver in to the OMAP hdmi driver. The
> patch also updates the relevant entry in ti,omap5-dss DT binding
> document. The driver registers a dummy hdmi codec driver and a
> simple-card driver to produce a fully functional ALSA device. The DAI
> driver is implemented in hdmi_audio.c, but it still needs to be
> registered from hdmi4.c or hdmi5.c.
>
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
> drivers/video/fbdev/omap2/dss/Makefile | 2 +
> drivers/video/fbdev/omap2/dss/hdmi.h | 38 +++-
> drivers/video/fbdev/omap2/dss/hdmi_audio.c | 317 ++++++++++++++++++++++++++++
> 3 files changed, 355 insertions(+), 2 deletions(-)
> create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
>
> diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile
> index 245f933..8260987 100644
> --- a/drivers/video/fbdev/omap2/dss/Makefile
> +++ b/drivers/video/fbdev/omap2/dss/Makefile
> @@ -14,5 +14,7 @@ omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o
> omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \
> hdmi_phy.o
> omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
> +omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o
> omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o
> +omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o
> ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
> index 927cb4d..cc6ecb5 100644
> --- a/drivers/video/fbdev/omap2/dss/hdmi.h
> +++ b/drivers/video/fbdev/omap2/dss/hdmi.h
> @@ -25,6 +25,11 @@
> #include <linux/hdmi.h>
> #include <video/omapdss.h>
>
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
I think you're a bit overeager with these ifdefs =). They make the code
more difficult to read. The question is, what is their purpose here? I'm
quite sure those includes below can be included just fine even without
HDMI support in the driver. So as far as I see, their only purpose would
be to very minimally speed up the kernel compilation.
> +#include <sound/dmaengine_pcm.h>
> +#include <uapi/sound/asound.h>
> +#endif
> +
> #include "dss.h"
>
> /* HDMI Wrapper */
> @@ -338,6 +343,35 @@ int hdmi_parse_lanes_of(struct platform_device *pdev, struct device_node *ep,
> struct hdmi_phy_data *phy);
>
> #if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
Same here. The struct definition doesn't do any harm, even if the audio
support is not compiled in.
> +struct hdmi_audio_data {
> + /* These should be initialized when hdmi_audio_register() is called */
> + struct mutex *hdmi_lock;
> + struct hdmi_wp_data *wp;
> + struct hdmi_core_data *core;
> + struct hdmi_config *cfg;
> + struct snd_soc_dai_driver *hdmi_dai_drv;
> +
> + int (*audio_start)(struct hdmi_core_data *core,
> + struct hdmi_wp_data *wp);
> + void (*audio_stop)(struct hdmi_core_data *core,
> + struct hdmi_wp_data *wp);
> + int (*audio_config)(struct hdmi_core_data *core,
> + struct hdmi_wp_data *wp,
> + struct omap_dss_audio *audio,
> + u32 pclk);
> +
> + /* These are of audio implementation's private use */
> + struct snd_dmaengine_dai_dma_data dma_data;
> + struct omap_dss_audio dss_audio;
> + struct snd_aes_iec958 iec;
> + struct snd_cea_861_aud_if cea;
> + struct platform_device *codec_pdev;
> + struct platform_device *card_pdev;
> +};
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 03/12] OMAPDSS: hdmi_wp: Add function for getting hdmi_wp physical base address
From: Jyri Sarha @ 2014-06-27 11:35 UTC (permalink / raw)
To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha
In-Reply-To: <53AD4A72.5050905@ti.com>
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
^ permalink raw reply
* Re: [PATCH 06/12] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
From: Tomi Valkeinen @ 2014-06-27 11:39 UTC (permalink / raw)
To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha
In-Reply-To: <f61b31d0b08c8a0b6ee295d5b0da62ead23983c9.1403807781.git.jsarha@ti.com>
[-- Attachment #1: Type: text/plain, Size: 3243 bytes --]
On 26/06/14 22:20, Jyri Sarha wrote:
> Add audio datamember to hdmi struct and call register and unregister
> functions form hdmi_audio.c. Register function registers the
> integrated cpu dai, dummy HDMI codec, and simple-card machine driver
> for complete HDMI audio support.
>
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
> drivers/video/fbdev/omap2/dss/hdmi4.c | 45 +++++++++++++++++++++++++++++++++
> 1 file changed, 45 insertions(+)
>
> diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
> index 342ddb4..48f11f8 100644
> --- a/drivers/video/fbdev/omap2/dss/hdmi4.c
> +++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
> @@ -34,6 +34,11 @@
> #include <linux/regulator/consumer.h>
> #include <video/omapdss.h>
>
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
No need for the ifdef here either.
> +#include <sound/soc.h>
> +#include <sound/soc-dai.h>
> +#endif
> +
> #include "hdmi4_core.h"
> #include "dss.h"
> #include "dss_features.h"
> @@ -52,6 +57,9 @@ static struct {
> struct clk *sys_clk;
> struct regulator *vdda_hdmi_dac_reg;
>
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
> + struct hdmi_audio_data audio;
> +#endif
> bool core_enabled;
>
> struct omap_dss_device output;
> @@ -671,6 +679,21 @@ err:
> return r;
> }
>
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
> +static struct snd_soc_dai_driver omap_hdmi_dai = {
> + .name = "omap4-hdmi-dai",
> + .playback = {
> + .channels_min = 2,
> + .channels_max = 8,
> + .rates = (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |
> + SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_88200 |
> + SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |
> + SNDRV_PCM_RATE_192000),
> + .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
> + },
> +};
> +#endif
> +
> /* HDMI HW IP initialisation */
> static int omapdss_hdmihw_probe(struct platform_device *pdev)
> {
> @@ -727,6 +750,25 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
>
> hdmi_init_output(pdev);
>
> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
> + /* drvdata is only used by HDMI audio */
> + hdmi.audio.hdmi_lock = &hdmi.lock;
> + hdmi.audio.wp = &hdmi.wp;
> + hdmi.audio.core = &hdmi.core;
> + hdmi.audio.cfg = &hdmi.cfg;
> + hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
> + hdmi.audio.audio_start = hdmi4_audio_start;
> + hdmi.audio.audio_stop = hdmi4_audio_stop;
> + hdmi.audio.audio_config = hdmi4_audio_config;
> + dev_set_drvdata(&pdev->dev, &hdmi.audio);
> + r = hdmi_audio_register(pdev);
> + if (r) {
> + DSSERR("Registering HDMI audio failed\n");
> + hdmi_uninit_output(pdev);
> + pm_runtime_disable(&pdev->dev);
> + return r;
> + }
> +#endif
I don't think it's a good idea to reserve the driver data for audio. We
need to change the hdmi drivers sooner or later to support multiple
instances, and at that point having drvdata for audio will cause problems.
If you don't want to make the hdmi struct public yet, maybe just add a
function to this file which takes a pointer to the hdmi struct and
returns the audio part. That way you can set the whole hdmi struct as
driver data, which should be future safe.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 07/12] OMAPDSS: Kconfig: Select audio dependencies if OMAP5_DSS_HDMI_AUDIO=y
From: Tomi Valkeinen @ 2014-06-27 11:49 UTC (permalink / raw)
To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha
In-Reply-To: <67ea660311de39b8a35e90a9a7d3b345fdaaf895.1403807781.git.jsarha@ti.com>
[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]
On 26/06/14 22:20, Jyri Sarha wrote:
> Adds help section and SND_SOC dependency to OMAP4_DSS_HDMI_AUDIO.
> Selects SND_OMAP_SOC, SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD if
> OMAP4_DSS_HDMI_AUDIO is enabled.
>
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
> drivers/video/fbdev/omap2/dss/Kconfig | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig
> index 871f722..1cce26c 100644
> --- a/drivers/video/fbdev/omap2/dss/Kconfig
> +++ b/drivers/video/fbdev/omap2/dss/Kconfig
> @@ -6,9 +6,9 @@ menuconfig OMAP2_DSS
> select VIDEOMODE_HELPERS
> select OMAP2_DSS_INIT
> select HDMI
> - select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO
> - select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO
> - select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO
> + select SND_OMAP_SOC if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
> + select SND_SOC_HDMI_CODEC if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
> + select SND_SIMPLE_CARD if OMAP4_DSS_HDMI_AUDIO || OMAP5_DSS_HDMI_AUDIO
> help
> OMAP2+ Display Subsystem support.
>
> @@ -99,8 +99,16 @@ config OMAP5_DSS_HDMI
> specification.
>
> config OMAP5_DSS_HDMI_AUDIO
> + bool "HDMI audio support for OMAP5"
> depends on OMAP5_DSS_HDMI
> - bool
> + depends on SND_SOC=y || OMAP2_DSS = SND_SOC
> + default y
These selects and depends ons make me feel a bit uneasy, but I don't
have any idea how to deal with it in a nicer way...
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
From: Tomi Valkeinen @ 2014-06-27 11:57 UTC (permalink / raw)
To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha
In-Reply-To: <69f5b1481bd8b8a005b5d9142626f3529a0d71c7.1403807781.git.jsarha@ti.com>
[-- Attachment #1: Type: text/plain, Size: 1806 bytes --]
On 26/06/14 22:20, Jyri Sarha wrote:
> Integrate ASoC DAI component driver in to the OMAP hdmi driver. The
> patch also updates the relevant entry in ti,omap5-dss DT binding
> document. The driver registers a dummy hdmi codec driver and a
> simple-card driver to produce a fully functional ALSA device. The DAI
> driver is implemented in hdmi_audio.c, but it still needs to be
> registered from hdmi4.c or hdmi5.c.
>
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
> drivers/video/fbdev/omap2/dss/Makefile | 2 +
> drivers/video/fbdev/omap2/dss/hdmi.h | 38 +++-
> drivers/video/fbdev/omap2/dss/hdmi_audio.c | 317 ++++++++++++++++++++++++++++
> 3 files changed, 355 insertions(+), 2 deletions(-)
> create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
>
> diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile
> index 245f933..8260987 100644
> --- a/drivers/video/fbdev/omap2/dss/Makefile
> +++ b/drivers/video/fbdev/omap2/dss/Makefile
> @@ -14,5 +14,7 @@ omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o
> omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \
> hdmi_phy.o
> omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
> +omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o
> omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o
> +omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o
This adds the hdmi_audio.o twice. I'm not sure what the linker does, but
I don't think that's correct.
Maybe have a internal CONFIG_OMAP_DSS_HDMI_AUDIO option, which is
selected if OMAP4 or OMAP5 HDMI AUDIO is selected by the user.
That same internal option could be used in the code also (where is
applies), instead of "if OMAP4_AUDIO || OMAP5_AUDIO".
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
From: Jyri Sarha @ 2014-06-27 12:06 UTC (permalink / raw)
To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha
In-Reply-To: <53AD5C28.6000009@ti.com>
On 06/27/2014 02:57 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
...
>> --- a/drivers/video/fbdev/omap2/dss/Makefile
>> +++ b/drivers/video/fbdev/omap2/dss/Makefile
>> @@ -14,5 +14,7 @@ omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o
>> omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \
>> hdmi_phy.o
>> omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
>> +omapdss-$(CONFIG_OMAP4_DSS_HDMI_AUDIO) += hdmi_audio.o
>> omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o
>> +omapdss-$(CONFIG_OMAP5_DSS_HDMI_AUDIO) += hdmi_audio.o
>
> This adds the hdmi_audio.o twice. I'm not sure what the linker does, but
> I don't think that's correct.
>
Well, it works, but it is ugly.
> Maybe have a internal CONFIG_OMAP_DSS_HDMI_AUDIO option, which is
> selected if OMAP4 or OMAP5 HDMI AUDIO is selected by the user.
>
> That same internal option could be used in the code also (where is
> applies), instead of "if OMAP4_AUDIO || OMAP5_AUDIO".
>
I'll implement your suggestion.
Cheers,
Jyri
^ permalink raw reply
* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
From: Tomi Valkeinen @ 2014-06-27 12:11 UTC (permalink / raw)
To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha
In-Reply-To: <69f5b1481bd8b8a005b5d9142626f3529a0d71c7.1403807781.git.jsarha@ti.com>
[-- Attachment #1: Type: text/plain, Size: 1379 bytes --]
On 26/06/14 22:20, Jyri Sarha wrote:
> Integrate ASoC DAI component driver in to the OMAP hdmi driver. The
> patch also updates the relevant entry in ti,omap5-dss DT binding
> document. The driver registers a dummy hdmi codec driver and a
> simple-card driver to produce a fully functional ALSA device. The DAI
> driver is implemented in hdmi_audio.c, but it still needs to be
> registered from hdmi4.c or hdmi5.c.
>
> Signed-off-by: Jyri Sarha <jsarha@ti.com>
> ---
<snip>
> +static const struct snd_soc_dai_ops hdmi_dai_ops = {
> + .startup = hdmi_dai_startup,
> + .hw_params = hdmi_dai_hw_params,
> + .prepare = hdmi_dai_prepare,
> + .trigger = hdmi_dai_trigger,
> + .shutdown = hdmi_dai_shutdown,
> +};
> +
> +static const struct snd_soc_component_driver omap_hdmi_component = {
> + .name = "omapdss_hdmi",
> +};
> +
> +static struct asoc_simple_card_info card_info = {
> + .name = "HDMI",
> + .card = "OMAPHDMI",
> + .codec_dai.name = "hdmi-hifi",
> +};
The above is not const. That, and the contents of the struct make me
wonder, what happens if we have two HDMI instances?
I know the core driver doesn't work with multiple instances yet, but as
I mentioned, it has to be done sooner or later. And on the core driver
side it should be quite straightforward.
I'd rather not introduce new restrictions for that goal.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 09/12] ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
From: Mark Brown @ 2014-06-27 12:17 UTC (permalink / raw)
To: Jyri Sarha
Cc: alsa-devel, linux-fbdev, linux-omap, peter.ujfalusi,
liam.r.girdwood, tomi.valkeinen, detheridge, jyri.sarha
In-Reply-To: <93e1aaeba564e0e38ffbd7254adfbb54e3206211.1403807781.git.jsarha@ti.com>
[-- Attachment #1: Type: text/plain, Size: 353 bytes --]
On Thu, Jun 26, 2014 at 10:21:00PM +0300, Jyri Sarha wrote:
> Removes omap-hdmi DAI driver, omap-hdmi-card driver, the related
> Kconfig options, and Makefile entries. The HDMI DAI drivers has been
> integrated directly to OMAP4+ HDMI drivers and simple-card driver is
> used instead of omap-hdmi-card driver.
Acked-by: Mark Brown <broonie@linaro.org>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
From: Jyri Sarha @ 2014-06-27 12:26 UTC (permalink / raw)
To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha
In-Reply-To: <53AD5F65.2010107@ti.com>
On 06/27/2014 03:11 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
...
>> +static struct asoc_simple_card_info card_info = {
>> + .name = "HDMI",
>> + .card = "OMAPHDMI",
>> + .codec_dai.name = "hdmi-hifi",
>> +};
>
> The above is not const. That, and the contents of the struct make me
> wonder, what happens if we have two HDMI instances?
>
> I know the core driver doesn't work with multiple instances yet, but as
> I mentioned, it has to be done sooner or later. And on the core driver
> side it should be quite straightforward.
>
> I'd rather not introduce new restrictions for that goal.
>
Ok, I'll alloc that with devm_kzalloc().
Cheers,
Jyri
^ permalink raw reply
* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
From: Tomi Valkeinen @ 2014-06-27 13:06 UTC (permalink / raw)
To: Jyri Sarha, alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, liam.r.girdwood, detheridge, broonie, jyri.sarha
In-Reply-To: <53AD62FB.10402@ti.com>
[-- Attachment #1: Type: text/plain, Size: 900 bytes --]
On 27/06/14 15:26, Jyri Sarha wrote:
> On 06/27/2014 03:11 PM, Tomi Valkeinen wrote:
>> On 26/06/14 22:20, Jyri Sarha wrote:
> ...
>>> +static struct asoc_simple_card_info card_info = {
>>> + .name = "HDMI",
>>> + .card = "OMAPHDMI",
>>> + .codec_dai.name = "hdmi-hifi",
>>> +};
>>
>> The above is not const. That, and the contents of the struct make me
>> wonder, what happens if we have two HDMI instances?
>>
>> I know the core driver doesn't work with multiple instances yet, but as
>> I mentioned, it has to be done sooner or later. And on the core driver
>> side it should be quite straightforward.
>>
>> I'd rather not introduce new restrictions for that goal.
>>
>
> Ok, I'll alloc that with devm_kzalloc().
Do the strings in the struct need to be unique? If so, you probably need
to append something to them based on the hdmi device instance.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH 04/12] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
From: Jyri Sarha @ 2014-06-27 15:33 UTC (permalink / raw)
To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha
In-Reply-To: <53AD6C5E.10805@ti.com>
On 06/27/2014 04:06 PM, Tomi Valkeinen wrote:
> On 27/06/14 15:26, Jyri Sarha wrote:
>> On 06/27/2014 03:11 PM, Tomi Valkeinen wrote:
>>> On 26/06/14 22:20, Jyri Sarha wrote:
>> ...
>>>> +static struct asoc_simple_card_info card_info = {
>>>> + .name = "HDMI",
>>>> + .card = "OMAPHDMI",
>>>> + .codec_dai.name = "hdmi-hifi",
>>>> +};
>>>
>>> The above is not const. That, and the contents of the struct make me
>>> wonder, what happens if we have two HDMI instances?
>>>
>>> I know the core driver doesn't work with multiple instances yet, but as
>>> I mentioned, it has to be done sooner or later. And on the core driver
>>> side it should be quite straightforward.
>>>
>>> I'd rather not introduce new restrictions for that goal.
>>>
>>
>> Ok, I'll alloc that with devm_kzalloc().
>
> Do the strings in the struct need to be unique? If so, you probably need
> to append something to them based on the hdmi device instance.
>
I dont think they need to be unique, but it anyway makes sense to embed
the HDMI device name into the audio device name, so I'll add it.
BTW, platform_device_register_data() memdups the platform data, so a
stack variable should be Ok for asoc_simple_card_info.
Cheers,
Jyri
^ permalink raw reply
* Re: [PATCH 06/12] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
From: Jyri Sarha @ 2014-06-27 15:33 UTC (permalink / raw)
To: Tomi Valkeinen, alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, detheridge, jyri.sarha
In-Reply-To: <53AD57F9.3030300@ti.com>
On 06/27/2014 02:39 PM, Tomi Valkeinen wrote:
> On 26/06/14 22:20, Jyri Sarha wrote:
...
>> +#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
>> + /* drvdata is only used by HDMI audio */
>> + hdmi.audio.hdmi_lock = &hdmi.lock;
>> + hdmi.audio.wp = &hdmi.wp;
>> + hdmi.audio.core = &hdmi.core;
>> + hdmi.audio.cfg = &hdmi.cfg;
>> + hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
>> + hdmi.audio.audio_start = hdmi4_audio_start;
>> + hdmi.audio.audio_stop = hdmi4_audio_stop;
>> + hdmi.audio.audio_config = hdmi4_audio_config;
>> + dev_set_drvdata(&pdev->dev, &hdmi.audio);
>> + r = hdmi_audio_register(pdev);
>> + if (r) {
>> + DSSERR("Registering HDMI audio failed\n");
>> + hdmi_uninit_output(pdev);
>> + pm_runtime_disable(&pdev->dev);
>> + return r;
>> + }
>> +#endif
>
> I don't think it's a good idea to reserve the driver data for audio. We
> need to change the hdmi drivers sooner or later to support multiple
> instances, and at that point having drvdata for audio will cause problems.
>
> If you don't want to make the hdmi struct public yet, maybe just add a
> function to this file which takes a pointer to the hdmi struct and
> returns the audio part. That way you can set the whole hdmi struct as
> driver data, which should be future safe.
>
Adding a function is not as simple as that because the OMAP4 and OMAP5
structs are subtly different and hdmi_audio.c is common to both. I'll
make the minimal changes to make the struct public.
Cheers,
Jyri
^ permalink raw reply
* [PATCH v2 00/13] Rework OMAP4+ HDMI audio support
From: Jyri Sarha @ 2014-06-27 18:38 UTC (permalink / raw)
To: alsa-devel, linux-fbdev, linux-omap
Cc: liam.r.girdwood, detheridge, broonie, Jyri Sarha, peter.ujfalusi,
tomi.valkeinen, jyri.sarha
Chanhes since fist version:
- Make hdmi struct public
- http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078220.html
- Change hdmi_wp_get_phys_addr() to hdmi_wp_get_audio_dma_addr()
- http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078213.html
- Remove unnecessary ifdefs
- http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078218.html
- http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078220.html
- Make audio support multiple instance safe
- http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078225.html
- Add hdmi_audio.o only once to linking line
- http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078223.html
- Unique name for audio card
- http://mailman.alsa-project.org/pipermail/alsa-devel/2014-June/078230.html
The patches are based on linux 3.16-rc2 and OMAPDSS HDMI infoframe
patches[1] from Tomi Valkeinen. The base, the patches, and couple of
additional not-to-be-merged omap2plus_defconfig patches can be found
here:
git://git.ti.com/~jyrisarha/ti-linux-kernel/jyrisarhas-audio-video-linux-feature-tree.git omap-hdmi-audio
The patch set fixes OMAP4+ HDMI audio. The structure of the
implementation looks a bit different than before. Instead of creating
a driver specific API for a separate ASoC component driver to connect
to, this implementation integrates an the ASoC cpu-dai component
driver into the HDMI driver. Also the other ASoC component drivers
needed for operational audio are automatically registered by the HDMI
driver. There is no need to add anything to the device tree as long as
the nodes needed for HDMI video are there.
Big part of the HDMI audio code is still unchanged and there is a need
for a cleanup there. Also there is still probably something wrong with
speaker mapping of multi-channel streams. I will get back to cleaning
up these issues later.
Best regards,
Jyri
Jyri Sarha (13):
ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
OMAPDSS: hdmi_wp: Add function for getting audio dma address
OMAPDSS: hdmi: Make hdmi structure public
OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver
implementation
OMAPDSS: Kconfig: Update OMAP4_DSS_HDMI_AUDIO option
OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
OMAPDSS: Kconfig: Update OMAP5_DSS_HDMI_AUDIO option
OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver
ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
OMAPDSS: hdmi4: Remove callbacks for an external ASoC DAI driver
OMAPDSS: hdmi5: Remove callbacks for an external ASoC DAI driver
OMAPDSS: Remove all references to obsolete HDMI audio callbacks
arch/arm/mach-omap2/devices.c | 28 --
.../fbdev/omap2/displays-new/connector-hdmi.c | 99 ------
.../fbdev/omap2/displays-new/encoder-tpd12s015.c | 56 ---
drivers/video/fbdev/omap2/dss/Kconfig | 29 +-
drivers/video/fbdev/omap2/dss/Makefile | 1 +
drivers/video/fbdev/omap2/dss/hdmi.h | 62 +++-
drivers/video/fbdev/omap2/dss/hdmi4.c | 188 +++-------
drivers/video/fbdev/omap2/dss/hdmi5.c | 189 +++-------
drivers/video/fbdev/omap2/dss/hdmi_audio.c | 323 +++++++++++++++++
drivers/video/fbdev/omap2/dss/hdmi_wp.c | 6 +
include/video/omapdss.h | 31 --
sound/soc/omap/Kconfig | 13 -
sound/soc/omap/Makefile | 4 -
sound/soc/omap/omap-hdmi-card.c | 87 -----
sound/soc/omap/omap-hdmi.c | 364 --------------------
sound/soc/omap/omap-hdmi.h | 38 --
16 files changed, 517 insertions(+), 1001 deletions(-)
create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
delete mode 100644 sound/soc/omap/omap-hdmi-card.c
delete mode 100644 sound/soc/omap/omap-hdmi.c
delete mode 100644 sound/soc/omap/omap-hdmi.h
--
1.7.9.5
^ permalink raw reply
* [PATCH v2 01/13] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
From: Jyri Sarha @ 2014-06-27 18:38 UTC (permalink / raw)
To: alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
detheridge, jyri.sarha, Jyri Sarha
In-Reply-To: <cover.1403894190.git.jsarha@ti.com>
This code is not working currently and it can be removed. There is a
conflict in sharing resources with the actual HDMI driver and with
the ASoC HDMI audio DAI driver.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
arch/arm/mach-omap2/devices.c | 28 ----------------------------
1 file changed, 28 deletions(-)
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 592ba0a..b6f8f34 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -297,33 +297,6 @@ static void omap_init_audio(void)
static inline void omap_init_audio(void) {}
#endif
-#if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI) || \
- defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE)
-
-static struct platform_device omap_hdmi_audio = {
- .name = "omap-hdmi-audio",
- .id = -1,
-};
-
-static void __init omap_init_hdmi_audio(void)
-{
- struct omap_hwmod *oh;
- struct platform_device *pdev;
-
- oh = omap_hwmod_lookup("dss_hdmi");
- if (!oh)
- return;
-
- pdev = omap_device_build("omap-hdmi-audio-dai", -1, oh, NULL, 0);
- WARN(IS_ERR(pdev),
- "Can't build omap_device for omap-hdmi-audio-dai.\n");
-
- platform_device_register(&omap_hdmi_audio);
-}
-#else
-static inline void omap_init_hdmi_audio(void) {}
-#endif
-
#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
#include <linux/platform_data/spi-omap2-mcspi.h>
@@ -459,7 +432,6 @@ static int __init omap2_init_devices(void)
*/
omap_init_audio();
omap_init_camera();
- omap_init_hdmi_audio();
omap_init_mbox();
/* If dtb is there, the devices will be created dynamically */
if (!of_have_populated_dt()) {
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 02/13] OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
From: Jyri Sarha @ 2014-06-27 18:38 UTC (permalink / raw)
To: alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
detheridge, jyri.sarha, Jyri Sarha
In-Reply-To: <cover.1403894190.git.jsarha@ti.com>
The OMAP5 HDMI audio implementation needs HDMI_AUDIO_LAYOUT_6CH in
hdmi_core_audio_layout enum. I found the correct value from ti-linux
3.8 tree.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
drivers/video/fbdev/omap2/dss/hdmi.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
index 262771b..1f01068 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -160,7 +160,8 @@ enum hdmi_audio_blk_strt_end_sig {
enum hdmi_core_audio_layout {
HDMI_AUDIO_LAYOUT_2CH = 0,
- HDMI_AUDIO_LAYOUT_8CH = 1
+ HDMI_AUDIO_LAYOUT_8CH = 1,
+ HDMI_AUDIO_LAYOUT_6CH = 2
};
enum hdmi_core_cts_mode {
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 03/13] OMAPDSS: hdmi_wp: Add function for getting audio dma address
From: Jyri Sarha @ 2014-06-27 18:38 UTC (permalink / raw)
To: alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
detheridge, jyri.sarha, Jyri Sarha
In-Reply-To: <cover.1403894190.git.jsarha@ti.com>
The audio dma port is found in the hdmi_wp physical address space.
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..9e85b86 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_audio_dma_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..43bf93e 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_audio_dma_addr(struct hdmi_wp_data *wp)
+{
+ return wp->phys_base + HDMI_WP_AUDIO_DATA;
+}
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 04/13] OMAPDSS: hdmi: Make hdmi structure public
From: Jyri Sarha @ 2014-06-27 18:38 UTC (permalink / raw)
To: alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
detheridge, jyri.sarha, Jyri Sarha
In-Reply-To: <cover.1403894190.git.jsarha@ti.com>
Name the anonymous hdmi struct as omap_hdmi. Move the struct definition to
hdmi.h and turn core member into a pointer to deal with it's different
definitions for omap4 and omap5. Make associated changes to hdmi4.c
and hdmi5.c.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
drivers/video/fbdev/omap2/dss/hdmi.h | 24 +++++++++++++++++++
drivers/video/fbdev/omap2/dss/hdmi4.c | 41 +++++++++++----------------------
drivers/video/fbdev/omap2/dss/hdmi5.c | 30 +++++++-----------------
3 files changed, 46 insertions(+), 49 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
index 9e85b86..075357e 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -349,5 +349,29 @@ static inline bool hdmi_mode_has_audio(int mode)
{
return mode = HDMI_HDMI ? true : false;
}
+
+/* HDMI DRV data */
+struct omap_hdmi {
+ struct mutex lock;
+ struct platform_device *pdev;
+
+ struct hdmi_wp_data wp;
+ struct hdmi_pll_data pll;
+ struct hdmi_phy_data phy;
+ struct hdmi_core_data *core;
+
+ struct hdmi_config cfg;
+
+ struct clk *sys_clk;
+ struct regulator *vdda_reg;
+
+#if defined(CONFIG_OMAP_DSS_HDMI_AUDIO)
+ struct hdmi_audio_data audio;
+#endif
+ bool core_enabled;
+
+ struct omap_dss_device output;
+};
+
#endif
#endif
diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
index 6a8550c..58f1295 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -37,25 +37,10 @@
#include "hdmi4_core.h"
#include "dss.h"
#include "dss_features.h"
+#include "hdmi.h"
-static struct {
- struct mutex lock;
- struct platform_device *pdev;
-
- struct hdmi_wp_data wp;
- struct hdmi_pll_data pll;
- struct hdmi_phy_data phy;
- struct hdmi_core_data core;
-
- struct hdmi_config cfg;
-
- struct clk *sys_clk;
- struct regulator *vdda_hdmi_dac_reg;
-
- bool core_enabled;
-
- struct omap_dss_device output;
-} hdmi;
+static struct omap_hdmi hdmi;
+static struct hdmi_core_data hdmi4_core;
static int hdmi_runtime_get(void)
{
@@ -117,7 +102,7 @@ static int hdmi_init_regulator(void)
int r;
struct regulator *reg;
- if (hdmi.vdda_hdmi_dac_reg != NULL)
+ if (hdmi.vdda_reg != NULL)
return 0;
reg = devm_regulator_get(&hdmi.pdev->dev, "vdda");
@@ -137,7 +122,7 @@ static int hdmi_init_regulator(void)
}
}
- hdmi.vdda_hdmi_dac_reg = reg;
+ hdmi.vdda_reg = reg;
return 0;
}
@@ -146,7 +131,7 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev)
{
int r;
- r = regulator_enable(hdmi.vdda_hdmi_dac_reg);
+ r = regulator_enable(hdmi.vdda_reg);
if (r)
return r;
@@ -162,7 +147,7 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev)
return 0;
err_runtime_get:
- regulator_disable(hdmi.vdda_hdmi_dac_reg);
+ regulator_disable(hdmi.vdda_reg);
return r;
}
@@ -172,7 +157,7 @@ static void hdmi_power_off_core(struct omap_dss_device *dssdev)
hdmi.core_enabled = false;
hdmi_runtime_put();
- regulator_disable(hdmi.vdda_hdmi_dac_reg);
+ regulator_disable(hdmi.vdda_reg);
}
static int hdmi_power_on_full(struct omap_dss_device *dssdev)
@@ -217,7 +202,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
if (r)
goto err_phy_pwr;
- hdmi4_configure(&hdmi.core, &hdmi.wp, &hdmi.cfg);
+ hdmi4_configure(hdmi.core, &hdmi.wp, &hdmi.cfg);
/* bypass TV gamma table */
dispc_enable_gamma_table(0);
@@ -308,7 +293,7 @@ static void hdmi_dump_regs(struct seq_file *s)
hdmi_wp_dump(&hdmi.wp, s);
hdmi_pll_dump(&hdmi.pll, s);
hdmi_phy_dump(&hdmi.phy, s);
- hdmi4_core_dump(&hdmi.core, s);
+ hdmi4_core_dump(hdmi.core, s);
hdmi_runtime_put();
mutex_unlock(&hdmi.lock);
@@ -323,7 +308,7 @@ static int read_edid(u8 *buf, int len)
r = hdmi_runtime_get();
BUG_ON(r);
- r = hdmi4_read_edid(&hdmi.core, buf, len);
+ r = hdmi4_read_edid(hdmi.core, buf, len);
hdmi_runtime_put();
mutex_unlock(&hdmi.lock);
@@ -678,6 +663,8 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
int irq;
hdmi.pdev = pdev;
+ hdmi.core = &hdmi4_core;
+ dev_set_drvdata(&pdev->dev, &hdmi);
mutex_init(&hdmi.lock);
@@ -699,7 +686,7 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
if (r)
return r;
- r = hdmi4_core_init(pdev, &hdmi.core);
+ r = hdmi4_core_init(pdev, hdmi.core);
if (r)
return r;
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index 32d02ec..83925a9 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -43,24 +43,8 @@
#include "dss.h"
#include "dss_features.h"
-static struct {
- struct mutex lock;
- struct platform_device *pdev;
-
- struct hdmi_wp_data wp;
- struct hdmi_pll_data pll;
- struct hdmi_phy_data phy;
- struct hdmi_core_data core;
-
- struct hdmi_config cfg;
-
- struct clk *sys_clk;
- struct regulator *vdda_reg;
-
- bool core_enabled;
-
- struct omap_dss_device output;
-} hdmi;
+static struct omap_hdmi hdmi;
+static struct hdmi_core_data hdmi5_core;
static int hdmi_runtime_get(void)
{
@@ -235,7 +219,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
if (r)
goto err_phy_pwr;
- hdmi5_configure(&hdmi.core, &hdmi.wp, &hdmi.cfg);
+ hdmi5_configure(hdmi.core, &hdmi.wp, &hdmi.cfg);
/* bypass TV gamma table */
dispc_enable_gamma_table(0);
@@ -326,7 +310,7 @@ static void hdmi_dump_regs(struct seq_file *s)
hdmi_wp_dump(&hdmi.wp, s);
hdmi_pll_dump(&hdmi.pll, s);
hdmi_phy_dump(&hdmi.phy, s);
- hdmi5_core_dump(&hdmi.core, s);
+ hdmi5_core_dump(hdmi.core, s);
hdmi_runtime_put();
mutex_unlock(&hdmi.lock);
@@ -346,7 +330,7 @@ static int read_edid(u8 *buf, int len)
/* No-idle mode */
REG_FLD_MOD(hdmi.wp.base, HDMI_WP_SYSCONFIG, 1, 3, 2);
- r = hdmi5_read_edid(&hdmi.core, buf, len);
+ r = hdmi5_read_edid(hdmi.core, buf, len);
REG_FLD_MOD(hdmi.wp.base, HDMI_WP_SYSCONFIG, idlemode, 3, 2);
@@ -703,6 +687,8 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
int irq;
hdmi.pdev = pdev;
+ hdmi.core = &hdmi5_core;
+ dev_set_drvdata(&pdev->dev, &hdmi);
mutex_init(&hdmi.lock);
@@ -724,7 +710,7 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
if (r)
return r;
- r = hdmi5_core_init(pdev, &hdmi.core);
+ r = hdmi5_core_init(pdev, hdmi.core);
if (r)
return r;
--
1.7.9.5
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox