* simplefb: add clock handling
From: Luc Verhaegen @ 2014-08-13 7:17 UTC (permalink / raw)
To: linux-arm-kernel
This is needed for the sunxi platform, where the u-boot initialized display
engine gets disabled by the clocks framework if certain clocks are not
claimed. Once these clocks are disabled, register content is lost, and there
is no turning back unless a full display driver is loaded, which kind of
beats the purpose of having simplefb running.
The lack of clock handling should plague more hardware, but so far rpi is the
best known user of simplefb, and its stepmotherly handling of the arm core
has kept these sort of issues from the kernel.
The sunxi u-boot side code can be found here:
https://groups.google.com/forum/#!topic/linux-sunxi/dPs958sIXvY
Patch 3 might be controversial, as this does not achieve anything real today,
since the status property in dt is only really evaluated when dealing with a
nodes memory. It still seems like a good idea to at least flag this memory or
node as disabled, as we really have no way back when the clocks get disabled.
Luc Verhaegen.
^ permalink raw reply
* E-mail Account Warning !!!
From: Account Upgrade @ 2014-08-12 9:58 UTC (permalink / raw)
To: Recipients
In-Reply-To: <20140811234225.BF74B16095ED@zimbra.mimp.gob.pe>
E-mail Account Warning !!!
This mail is from Administrator; we wish to bring to your notice the Condition of your email account.
We have just noticed that you have exceeded your email Database limit of 500 MB quota and your email IP is causing conflict because it is been accessed in different server location. You need to Upgrade and expand your email quota limit before you can continue to use your email. Provide details or click the link below :
Update your email quota limit to 2.6 GB, use the below web link:
https://www.formlogix.com/Manager/UserConditionalSurvey248932.aspx?Param=VXNlcklkPTI0ODkzMi5Gb3JtSWQ9MQ%3d%3d
Failure to do this will result to email deactivation within 24hours
Thank you for your understanding.
Copyright 2014 Help Desk
Email Upgrade
^ permalink raw reply
* E-mail Account Warning !!!
From: Account Upgrade @ 2014-08-11 23:56 UTC (permalink / raw)
To: Recipients
E-mail Account Warning !!!
This mail is from Administrator; we wish to bring to your notice the Condition of your email account.
We have just noticed that you have exceeded your email Database limit of 500 MB quota and your email IP is causing conflict because it is been accessed in different server location. You need to Upgrade and expand your email quota limit before you can continue to use your email. Provide details or click the link below :
Update your email quota limit to 2.6 GB, use the below web link:
http://srvpt.webs.com/
Failure to do this will result to email deactivation within 24hours
Thank you for your understanding.
Copyright 2014 Help Desk
Email Upgrade
^ permalink raw reply
* Re: [PATCH 4/4] drivers: video: fbdev: atmel_lcdfb.c: fix error return code
From: Nicolas Ferre @ 2014-08-11 10:25 UTC (permalink / raw)
To: Julia Lawall
Cc: kernel-janitors, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
linux-fbdev, linux-kernel
In-Reply-To: <1407355938-10932-4-git-send-email-Julia.Lawall@lip6.fr>
On 06/08/2014 22:12, Julia Lawall :
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Convert a zero return value on error to a negative one, as returned
> elsewhere in the function.
>
> A simplified version of the semantic match that finds this problem is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> (
> if@p1 (\(ret < 0\|ret != 0\))
> { ... return ret; }
> |
> ret@p1 = 0
> )
> ... when != ret = e1
> when != &ret
> *if(...)
> {
> ... when != ret = e2
> when forall
> return ret;
> }
>
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Okay, seems good patch:
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Thanks, best regards,
> ---
> The error codes chosen are the ones that are commonly used elsewhere or
> these functions. Perhaps something else is wanted.
>
> drivers/video/fbdev/atmel_lcdfb.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c
> index 92640d4..1d8bdb9 100644
> --- a/drivers/video/fbdev/atmel_lcdfb.c
> +++ b/drivers/video/fbdev/atmel_lcdfb.c
> @@ -1102,12 +1102,14 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo)
> timings = of_get_display_timings(display_np);
> if (!timings) {
> dev_err(dev, "failed to get display timings\n");
> + ret = -EINVAL;
> goto put_display_node;
> }
>
> timings_np = of_find_node_by_name(display_np, "display-timings");
> if (!timings_np) {
> dev_err(dev, "failed to find display-timings node\n");
> + ret = -ENODEV;
> goto put_display_node;
> }
>
>
>
--
Nicolas Ferre
^ permalink raw reply
* [PATCH v3 14/14] OMAPDSS: Remove all references to obsolete HDMI audio callbacks
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.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
* [PATCH v3 13/14] OMAPDSS: hdmi5: Remove callbacks for an external ASoC DAI driver
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.git.jsarha@ti.com>
Removes the OMAP5 HDMI audio callbacks for an external audio driver and
the old external DAI driver does not work anymore after this patch.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
drivers/video/fbdev/omap2/dss/hdmi5.c | 113 ---------------------------------
1 file changed, 113 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index d796071..d91ea36 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -495,112 +495,6 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev,
return r;
}
-#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
-static int hdmi_audio_enable(struct omap_dss_device *dssdev)
-{
- int r;
-
- mutex_lock(&hdmi.lock);
-
- if (!hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode)) {
- r = -EPERM;
- goto err;
- }
-
- r = hdmi_wp_audio_enable(&hdmi.wp, true);
- if (r)
- goto err;
-
- mutex_unlock(&hdmi.lock);
- return 0;
-
-err:
- mutex_unlock(&hdmi.lock);
- return r;
-}
-
-static void hdmi_audio_disable(struct omap_dss_device *dssdev)
-{
- hdmi_wp_audio_enable(&hdmi.wp, false);
-}
-
-static int hdmi_audio_start(struct omap_dss_device *dssdev)
-{
- return hdmi_wp_audio_core_req_enable(&hdmi.wp, true);
-}
-
-static void hdmi_audio_stop(struct omap_dss_device *dssdev)
-{
- hdmi_wp_audio_core_req_enable(&hdmi.wp, false);
-}
-
-static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
-{
- bool r;
-
- mutex_lock(&hdmi.lock);
-
- r = hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode);
-
- mutex_unlock(&hdmi.lock);
- return r;
-}
-
-static int hdmi_audio_config(struct omap_dss_device *dssdev,
- struct omap_dss_audio *audio)
-{
- int r;
- u32 pclk = hdmi.cfg.timings.pixelclock;
-
- mutex_lock(&hdmi.lock);
-
- if (!hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode)) {
- r = -EPERM;
- goto err;
- }
-
- r = hdmi5_audio_config(&hdmi.core, &hdmi.wp, audio, pclk);
- if (r)
- goto err;
-
- mutex_unlock(&hdmi.lock);
- return 0;
-
-err:
- mutex_unlock(&hdmi.lock);
- return r;
-}
-#else
-static int hdmi_audio_enable(struct omap_dss_device *dssdev)
-{
- return -EPERM;
-}
-
-static void hdmi_audio_disable(struct omap_dss_device *dssdev)
-{
-}
-
-static int hdmi_audio_start(struct omap_dss_device *dssdev)
-{
- return -EPERM;
-}
-
-static void hdmi_audio_stop(struct omap_dss_device *dssdev)
-{
-}
-
-static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
-{
- return false;
-}
-
-static int hdmi_audio_config(struct omap_dss_device *dssdev,
- struct omap_dss_audio *audio)
-{
- return -EPERM;
-}
-#endif
-
static int hdmi_set_infoframe(struct omap_dss_device *dssdev,
const struct hdmi_avi_infoframe *avi)
{
@@ -629,13 +523,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = {
.read_edid = hdmi_read_edid,
.set_infoframe = hdmi_set_infoframe,
.set_hdmi_mode = hdmi_set_hdmi_mode,
-
- .audio_enable = hdmi_audio_enable,
- .audio_disable = hdmi_audio_disable,
- .audio_start = hdmi_audio_start,
- .audio_stop = hdmi_audio_stop,
- .audio_supported = hdmi_audio_supported,
- .audio_config = hdmi_audio_config,
};
static void hdmi_init_output(struct platform_device *pdev)
--
1.7.9.5
^ permalink raw reply related
* [PATCH v3 12/14] OMAPDSS: hdmi4: Remove callbacks for an external ASoC DAI driver
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.git.jsarha@ti.com>
Removes the OMAP4 HDMI audio callbacks for an external audio driver and
the old external DAI driver does not work anymore after this patch.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
drivers/video/fbdev/omap2/dss/hdmi4.c | 113 ---------------------------------
1 file changed, 113 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
index 707dcec..a7ee70d 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -471,112 +471,6 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev,
return r;
}
-#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
-static int hdmi_audio_enable(struct omap_dss_device *dssdev)
-{
- int r;
-
- mutex_lock(&hdmi.lock);
-
- if (!hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode)) {
- r = -EPERM;
- goto err;
- }
-
- r = hdmi_wp_audio_enable(&hdmi.wp, true);
- if (r)
- goto err;
-
- mutex_unlock(&hdmi.lock);
- return 0;
-
-err:
- mutex_unlock(&hdmi.lock);
- return r;
-}
-
-static void hdmi_audio_disable(struct omap_dss_device *dssdev)
-{
- hdmi_wp_audio_enable(&hdmi.wp, false);
-}
-
-static int hdmi_audio_start(struct omap_dss_device *dssdev)
-{
- return hdmi4_audio_start(&hdmi.core, &hdmi.wp);
-}
-
-static void hdmi_audio_stop(struct omap_dss_device *dssdev)
-{
- hdmi4_audio_stop(&hdmi.core, &hdmi.wp);
-}
-
-static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
-{
- bool r;
-
- mutex_lock(&hdmi.lock);
-
- r = hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode);
-
- mutex_unlock(&hdmi.lock);
- return r;
-}
-
-static int hdmi_audio_config(struct omap_dss_device *dssdev,
- struct omap_dss_audio *audio)
-{
- int r;
- u32 pclk = hdmi.cfg.timings.pixelclock;
-
- mutex_lock(&hdmi.lock);
-
- if (!hdmi_mode_has_audio(hdmi.cfg.hdmi_dvi_mode)) {
- r = -EPERM;
- goto err;
- }
-
- r = hdmi4_audio_config(&hdmi.core, &hdmi.wp, audio, pclk);
- if (r)
- goto err;
-
- mutex_unlock(&hdmi.lock);
- return 0;
-
-err:
- mutex_unlock(&hdmi.lock);
- return r;
-}
-#else
-static int hdmi_audio_enable(struct omap_dss_device *dssdev)
-{
- return -EPERM;
-}
-
-static void hdmi_audio_disable(struct omap_dss_device *dssdev)
-{
-}
-
-static int hdmi_audio_start(struct omap_dss_device *dssdev)
-{
- return -EPERM;
-}
-
-static void hdmi_audio_stop(struct omap_dss_device *dssdev)
-{
-}
-
-static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
-{
- return false;
-}
-
-static int hdmi_audio_config(struct omap_dss_device *dssdev,
- struct omap_dss_audio *audio)
-{
- return -EPERM;
-}
-#endif
-
static int hdmi_set_infoframe(struct omap_dss_device *dssdev,
const struct hdmi_avi_infoframe *avi)
{
@@ -605,13 +499,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = {
.read_edid = hdmi_read_edid,
.set_infoframe = hdmi_set_infoframe,
.set_hdmi_mode = hdmi_set_hdmi_mode,
-
- .audio_enable = hdmi_audio_enable,
- .audio_disable = hdmi_audio_disable,
- .audio_start = hdmi_audio_start,
- .audio_stop = hdmi_audio_stop,
- .audio_supported = hdmi_audio_supported,
- .audio_config = hdmi_audio_config,
};
static void hdmi_init_output(struct platform_device *pdev)
--
1.7.9.5
^ permalink raw reply related
* [PATCH v3 11/14] ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.git.jsarha@ti.com>
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.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
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 ----
5 files changed, 506 deletions(-)
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
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index d44463a..5c7b0aa 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -12,9 +12,6 @@ config SND_OMAP_SOC_MCBSP
config SND_OMAP_SOC_MCPDM
tristate
-config SND_OMAP_SOC_HDMI
- tristate
-
config SND_OMAP_SOC_N810
tristate "SoC Audio support for Nokia N810"
depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C
@@ -100,16 +97,6 @@ config SND_OMAP_SOC_OMAP_ABE_TWL6040
- PandaBoard (4430)
- PandaBoardES (4460)
-config SND_OMAP_SOC_OMAP_HDMI
- tristate "SoC Audio support for Texas Instruments OMAP HDMI"
- depends on SND_OMAP_SOC && OMAP4_DSS_HDMI && OMAP2_DSS
- select SND_OMAP_SOC_HDMI
- select SND_SOC_HDMI_CODEC
- select OMAP4_DSS_HDMI_AUDIO
- help
- Say Y if you want to add support for SoC HDMI audio on Texas Instruments
- OMAP4 chips
-
config SND_OMAP_SOC_OMAP3_PANDORA
tristate "SoC Audio support for OMAP3 Pandora"
depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_PANDORA
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index a725905..5832fe1 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -3,13 +3,11 @@ snd-soc-omap-objs := omap-pcm.o
snd-soc-omap-dmic-objs := omap-dmic.o
snd-soc-omap-mcbsp-objs := omap-mcbsp.o mcbsp.o
snd-soc-omap-mcpdm-objs := omap-mcpdm.o
-snd-soc-omap-hdmi-objs := omap-hdmi.o
obj-$(CONFIG_SND_OMAP_SOC) += snd-soc-omap.o
obj-$(CONFIG_SND_OMAP_SOC_DMIC) += snd-soc-omap-dmic.o
obj-$(CONFIG_SND_OMAP_SOC_MCBSP) += snd-soc-omap-mcbsp.o
obj-$(CONFIG_SND_OMAP_SOC_MCPDM) += snd-soc-omap-mcpdm.o
-obj-$(CONFIG_SND_OMAP_SOC_HDMI) += snd-soc-omap-hdmi.o
# OMAP Machine Support
snd-soc-n810-objs := n810.o
@@ -20,7 +18,6 @@ snd-soc-am3517evm-objs := am3517evm.o
snd-soc-omap-abe-twl6040-objs := omap-abe-twl6040.o
snd-soc-omap-twl4030-objs := omap-twl4030.o
snd-soc-omap3pandora-objs := omap3pandora.o
-snd-soc-omap-hdmi-card-objs := omap-hdmi-card.o
obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
obj-$(CONFIG_SND_OMAP_SOC_RX51) += snd-soc-rx51.o
@@ -30,4 +27,3 @@ obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040) += snd-soc-omap-abe-twl6040.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP_TWL4030) += snd-soc-omap-twl4030.o
obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
-obj-$(CONFIG_SND_OMAP_SOC_OMAP_HDMI) += snd-soc-omap-hdmi-card.o
diff --git a/sound/soc/omap/omap-hdmi-card.c b/sound/soc/omap/omap-hdmi-card.c
deleted file mode 100644
index f649fe8..0000000
--- a/sound/soc/omap/omap-hdmi-card.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * omap-hdmi-card.c
- *
- * OMAP ALSA SoC machine driver for TI OMAP HDMI
- * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
- * Author: Ricardo Neri <ricardo.neri@ti.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <linux/module.h>
-#include <sound/pcm.h>
-#include <sound/soc.h>
-#include <asm/mach-types.h>
-#include <video/omapdss.h>
-
-#define DRV_NAME "omap-hdmi-audio"
-
-static struct snd_soc_dai_link omap_hdmi_dai = {
- .name = "HDMI",
- .stream_name = "HDMI",
- .cpu_dai_name = "omap-hdmi-audio-dai",
- .platform_name = "omap-hdmi-audio-dai",
- .codec_name = "hdmi-audio-codec",
- .codec_dai_name = "hdmi-hifi",
-};
-
-static struct snd_soc_card snd_soc_omap_hdmi = {
- .name = "OMAPHDMI",
- .owner = THIS_MODULE,
- .dai_link = &omap_hdmi_dai,
- .num_links = 1,
-};
-
-static int omap_hdmi_probe(struct platform_device *pdev)
-{
- struct snd_soc_card *card = &snd_soc_omap_hdmi;
- int ret;
-
- card->dev = &pdev->dev;
-
- ret = snd_soc_register_card(card);
- if (ret) {
- dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
- card->dev = NULL;
- return ret;
- }
- return 0;
-}
-
-static int omap_hdmi_remove(struct platform_device *pdev)
-{
- struct snd_soc_card *card = platform_get_drvdata(pdev);
-
- snd_soc_unregister_card(card);
- card->dev = NULL;
- return 0;
-}
-
-static struct platform_driver omap_hdmi_driver = {
- .driver = {
- .name = DRV_NAME,
- .owner = THIS_MODULE,
- },
- .probe = omap_hdmi_probe,
- .remove = omap_hdmi_remove,
-};
-
-module_platform_driver(omap_hdmi_driver);
-
-MODULE_AUTHOR("Ricardo Neri <ricardo.neri@ti.com>");
-MODULE_DESCRIPTION("OMAP HDMI machine ASoC driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
diff --git a/sound/soc/omap/omap-hdmi.c b/sound/soc/omap/omap-hdmi.c
deleted file mode 100644
index eb9c392..0000000
--- a/sound/soc/omap/omap-hdmi.c
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * omap-hdmi.c
- *
- * OMAP ALSA SoC DAI driver for HDMI audio on OMAP4 processors.
- * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
- * Authors: Jorge Candelaria <jorge.candelaria@ti.com>
- * Ricardo Neri <ricardo.neri@ti.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/device.h>
-#include <sound/core.h>
-#include <sound/pcm.h>
-#include <sound/pcm_params.h>
-#include <sound/initval.h>
-#include <sound/soc.h>
-#include <sound/asound.h>
-#include <sound/asoundef.h>
-#include <sound/dmaengine_pcm.h>
-#include <video/omapdss.h>
-#include <sound/omap-pcm.h>
-
-#include "omap-hdmi.h"
-
-#define DRV_NAME "omap-hdmi-audio-dai"
-
-struct hdmi_priv {
- struct snd_dmaengine_dai_dma_data dma_data;
- unsigned int dma_req;
- struct omap_dss_audio dss_audio;
- struct snd_aes_iec958 iec;
- struct snd_cea_861_aud_if cea;
- struct omap_dss_device *dssdev;
-};
-
-static int omap_hdmi_dai_startup(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
-{
- struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
- int err;
- /*
- * Make sure that the period bytes are multiple of the DMA packet size.
- * Largest packet size we use is 32 32-bit words = 128 bytes
- */
- err = snd_pcm_hw_constraint_step(substream->runtime, 0,
- SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128);
- if (err < 0) {
- dev_err(dai->dev, "could not apply constraint\n");
- return err;
- }
-
- if (!priv->dssdev->driver->audio_supported(priv->dssdev)) {
- dev_err(dai->dev, "audio not supported\n");
- return -ENODEV;
- }
-
- snd_soc_dai_set_dma_data(dai, substream, &priv->dma_data);
-
- return 0;
-}
-
-static int omap_hdmi_dai_prepare(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
-{
- struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
-
- return priv->dssdev->driver->audio_enable(priv->dssdev);
-}
-
-static int omap_hdmi_dai_hw_params(struct snd_pcm_substream *substream,
- struct snd_pcm_hw_params *params,
- struct snd_soc_dai *dai)
-{
- struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
- struct snd_aes_iec958 *iec = &priv->iec;
- struct snd_cea_861_aud_if *cea = &priv->cea;
- int err = 0;
-
- switch (params_format(params)) {
- case SNDRV_PCM_FORMAT_S16_LE:
- priv->dma_data.maxburst = 16;
- break;
- case SNDRV_PCM_FORMAT_S24_LE:
- priv->dma_data.maxburst = 32;
- break;
- default:
- dev_err(dai->dev, "format not supported!\n");
- return -EINVAL;
- }
-
- /*
- * fill the IEC-60958 channel status word
- */
- /* initialize the word bytes */
- memset(iec->status, 0, sizeof(iec->status));
-
- /* specify IEC-60958-3 (commercial use) */
- iec->status[0] &= ~IEC958_AES0_PROFESSIONAL;
-
- /* specify that the audio is LPCM*/
- iec->status[0] &= ~IEC958_AES0_NONAUDIO;
-
- iec->status[0] |= IEC958_AES0_CON_NOT_COPYRIGHT;
-
- iec->status[0] |= IEC958_AES0_CON_EMPHASIS_NONE;
-
- iec->status[0] |= IEC958_AES1_PRO_MODE_NOTID;
-
- iec->status[1] = IEC958_AES1_CON_GENERAL;
-
- iec->status[2] |= IEC958_AES2_CON_SOURCE_UNSPEC;
-
- iec->status[2] |= IEC958_AES2_CON_CHANNEL_UNSPEC;
-
- switch (params_rate(params)) {
- case 32000:
- iec->status[3] |= IEC958_AES3_CON_FS_32000;
- break;
- case 44100:
- iec->status[3] |= IEC958_AES3_CON_FS_44100;
- break;
- case 48000:
- iec->status[3] |= IEC958_AES3_CON_FS_48000;
- break;
- case 88200:
- iec->status[3] |= IEC958_AES3_CON_FS_88200;
- break;
- case 96000:
- iec->status[3] |= IEC958_AES3_CON_FS_96000;
- break;
- case 176400:
- iec->status[3] |= IEC958_AES3_CON_FS_176400;
- break;
- case 192000:
- iec->status[3] |= IEC958_AES3_CON_FS_192000;
- break;
- default:
- dev_err(dai->dev, "rate not supported!\n");
- return -EINVAL;
- }
-
- /* specify the clock accuracy */
- iec->status[3] |= IEC958_AES3_CON_CLOCK_1000PPM;
-
- /*
- * specify the word length. The same word length value can mean
- * two different lengths. Hence, we need to specify the maximum
- * word length as well.
- */
- switch (params_format(params)) {
- case SNDRV_PCM_FORMAT_S16_LE:
- iec->status[4] |= IEC958_AES4_CON_WORDLEN_20_16;
- iec->status[4] &= ~IEC958_AES4_CON_MAX_WORDLEN_24;
- break;
- case SNDRV_PCM_FORMAT_S24_LE:
- iec->status[4] |= IEC958_AES4_CON_WORDLEN_24_20;
- iec->status[4] |= IEC958_AES4_CON_MAX_WORDLEN_24;
- break;
- default:
- dev_err(dai->dev, "format not supported!\n");
- return -EINVAL;
- }
-
- /*
- * Fill the CEA-861 audio infoframe (see spec for details)
- */
-
- cea->db1_ct_cc = (params_channels(params) - 1)
- & CEA861_AUDIO_INFOFRAME_DB1CC;
- cea->db1_ct_cc |= CEA861_AUDIO_INFOFRAME_DB1CT_FROM_STREAM;
-
- cea->db2_sf_ss = CEA861_AUDIO_INFOFRAME_DB2SF_FROM_STREAM;
- cea->db2_sf_ss |= CEA861_AUDIO_INFOFRAME_DB2SS_FROM_STREAM;
-
- cea->db3 = 0; /* not used, all zeros */
-
- /*
- * The OMAP HDMI IP requires to use the 8-channel channel code when
- * transmitting more than two channels.
- */
- if (params_channels(params) = 2)
- cea->db4_ca = 0x0;
- else
- cea->db4_ca = 0x13;
-
- cea->db5_dminh_lsv = CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PROHIBITED;
- /* the expression is trivial but makes clear what we are doing */
- cea->db5_dminh_lsv |= (0 & CEA861_AUDIO_INFOFRAME_DB5_LSV);
-
- priv->dss_audio.iec = iec;
- priv->dss_audio.cea = cea;
-
- err = priv->dssdev->driver->audio_config(priv->dssdev,
- &priv->dss_audio);
-
- return err;
-}
-
-static int omap_hdmi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
- struct snd_soc_dai *dai)
-{
- struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
- int err = 0;
-
- switch (cmd) {
- case SNDRV_PCM_TRIGGER_START:
- case SNDRV_PCM_TRIGGER_RESUME:
- case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- err = priv->dssdev->driver->audio_start(priv->dssdev);
- break;
- case SNDRV_PCM_TRIGGER_STOP:
- case SNDRV_PCM_TRIGGER_SUSPEND:
- case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
- priv->dssdev->driver->audio_stop(priv->dssdev);
- break;
- default:
- err = -EINVAL;
- }
- return err;
-}
-
-static void omap_hdmi_dai_shutdown(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
-{
- struct hdmi_priv *priv = snd_soc_dai_get_drvdata(dai);
-
- priv->dssdev->driver->audio_disable(priv->dssdev);
-}
-
-static const struct snd_soc_dai_ops omap_hdmi_dai_ops = {
- .startup = omap_hdmi_dai_startup,
- .hw_params = omap_hdmi_dai_hw_params,
- .prepare = omap_hdmi_dai_prepare,
- .trigger = omap_hdmi_dai_trigger,
- .shutdown = omap_hdmi_dai_shutdown,
-};
-
-static struct snd_soc_dai_driver omap_hdmi_dai = {
- .playback = {
- .channels_min = 2,
- .channels_max = 8,
- .rates = OMAP_HDMI_RATES,
- .formats = OMAP_HDMI_FORMATS,
- },
- .ops = &omap_hdmi_dai_ops,
-};
-
-static const struct snd_soc_component_driver omap_hdmi_component = {
- .name = DRV_NAME,
-};
-
-static int omap_hdmi_probe(struct platform_device *pdev)
-{
- int ret;
- struct resource *hdmi_rsrc;
- struct hdmi_priv *hdmi_data;
- bool hdmi_dev_found = false;
-
- hdmi_data = devm_kzalloc(&pdev->dev, sizeof(*hdmi_data), GFP_KERNEL);
- if (hdmi_data = NULL) {
- dev_err(&pdev->dev, "Cannot allocate memory for HDMI data\n");
- return -ENOMEM;
- }
-
- hdmi_rsrc = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!hdmi_rsrc) {
- dev_err(&pdev->dev, "Cannot obtain IORESOURCE_MEM HDMI\n");
- return -ENODEV;
- }
-
- hdmi_data->dma_data.addr = hdmi_rsrc->start + OMAP_HDMI_AUDIO_DMA_PORT;
-
- hdmi_rsrc = platform_get_resource(pdev, IORESOURCE_DMA, 0);
- if (!hdmi_rsrc) {
- dev_err(&pdev->dev, "Cannot obtain IORESOURCE_DMA HDMI\n");
- return -ENODEV;
- }
-
- hdmi_data->dma_req = hdmi_rsrc->start;
- hdmi_data->dma_data.filter_data = &hdmi_data->dma_req;
- hdmi_data->dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
-
- /*
- * TODO: We assume that there is only one DSS HDMI device. Future
- * OMAP implementations may support more than one HDMI devices and
- * we should provided separate audio support for all of them.
- */
- /* Find an HDMI device. */
- for_each_dss_dev(hdmi_data->dssdev) {
- omap_dss_get_device(hdmi_data->dssdev);
-
- if (!hdmi_data->dssdev->driver) {
- omap_dss_put_device(hdmi_data->dssdev);
- continue;
- }
-
- if (hdmi_data->dssdev->type = OMAP_DISPLAY_TYPE_HDMI) {
- hdmi_dev_found = true;
- break;
- }
- }
-
- if (!hdmi_dev_found) {
- dev_err(&pdev->dev, "no driver for HDMI display found\n");
- return -ENODEV;
- }
-
- dev_set_drvdata(&pdev->dev, hdmi_data);
- ret = snd_soc_register_component(&pdev->dev, &omap_hdmi_component,
- &omap_hdmi_dai, 1);
-
- if (ret)
- return ret;
-
- return omap_pcm_platform_register(&pdev->dev);
-}
-
-static int omap_hdmi_remove(struct platform_device *pdev)
-{
- struct hdmi_priv *hdmi_data = dev_get_drvdata(&pdev->dev);
-
- snd_soc_unregister_component(&pdev->dev);
-
- if (hdmi_data = NULL) {
- dev_err(&pdev->dev, "cannot obtain HDMi data\n");
- return -ENODEV;
- }
-
- omap_dss_put_device(hdmi_data->dssdev);
- return 0;
-}
-
-static struct platform_driver hdmi_dai_driver = {
- .driver = {
- .name = DRV_NAME,
- .owner = THIS_MODULE,
- },
- .probe = omap_hdmi_probe,
- .remove = omap_hdmi_remove,
-};
-
-module_platform_driver(hdmi_dai_driver);
-
-MODULE_AUTHOR("Jorge Candelaria <jorge.candelaria@ti.com>");
-MODULE_AUTHOR("Ricardo Neri <ricardo.neri@ti.com>");
-MODULE_DESCRIPTION("OMAP HDMI SoC Interface");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
diff --git a/sound/soc/omap/omap-hdmi.h b/sound/soc/omap/omap-hdmi.h
deleted file mode 100644
index 6ad2bf4..0000000
--- a/sound/soc/omap/omap-hdmi.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * omap-hdmi.h
- *
- * Definitions for OMAP ALSA SoC DAI driver for HDMI audio on OMAP4 processors.
- * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
- * Authors: Jorge Candelaria <jorge.candelaria@ti.com>
- * Ricardo Neri <ricardo.neri@ti.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef __OMAP_HDMI_H__
-#define __OMAP_HDMI_H__
-
-#define OMAP_HDMI_AUDIO_DMA_PORT 0x8c
-
-#define OMAP_HDMI_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)
-
-#define OMAP_HDMI_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
- SNDRV_PCM_FMTBIT_S24_LE)
-
-#endif
--
1.7.9.5
^ permalink raw reply related
* [PATCH v3 10/14] OMAPDSS: hdmi5: Register HDMI audio ASoC drivers from HDMI driver
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.git.jsarha@ti.com>
Initialize the callbacks in struct hdmi_audio_data 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/hdmi5.c | 80 +++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index 90410f5..d796071 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -39,6 +39,9 @@
#include <linux/regulator/consumer.h>
#include <video/omapdss.h>
+#include <sound/soc.h>
+#include <sound/soc-dai.h>
+
#include "hdmi5_core.h"
#include "dss.h"
#include "dss_features.h"
@@ -679,6 +682,66 @@ err:
return r;
}
+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+static int mode_has_audio(struct omap_hdmi *hd)
+{
+ int ret;
+
+ mutex_lock(&hd->lock);
+ ret = hdmi_mode_has_audio(&hd->cfg);
+ mutex_unlock(&hd->lock);
+
+ return ret;
+}
+
+static int audio_enable(struct omap_hdmi *hd, bool enable)
+{
+ int ret;
+
+ mutex_lock(&hd->lock);
+ if (!hdmi_mode_has_audio(&hd->cfg))
+ ret = -EPERM;
+ else
+ ret = hdmi_wp_audio_enable(&hd->wp, enable);
+ mutex_unlock(&hd->lock);
+
+ return ret;
+}
+
+static int audio_start(struct omap_hdmi *hd, bool enable)
+{
+ return hdmi_wp_audio_core_req_enable(&hd->wp, enable);
+}
+
+static int audio_config(struct omap_hdmi *hd, struct omap_dss_audio *dss_audio)
+{
+ int ret;
+
+ mutex_lock(&hd->lock);
+ if (!hdmi_mode_has_audio(&hd->cfg))
+ ret = -EPERM;
+ else
+ ret = hdmi5_audio_config(&hd->core, &hd->wp, dss_audio,
+ hd->cfg.timings.pixelclock);
+ mutex_unlock(&hd->lock);
+
+ return ret;
+}
+
+static struct snd_soc_dai_driver omap_hdmi_dai = {
+ .name = "omap5-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,
+ },
+};
+#endif
+
/* HDMI HW IP initialisation */
static int omapdss_hdmihw_probe(struct platform_device *pdev)
{
@@ -736,6 +799,20 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
hdmi_init_output(pdev);
+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+ hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
+ hdmi.audio.mode_has_audio = mode_has_audio;
+ hdmi.audio.audio_enable = audio_enable;
+ hdmi.audio.audio_start = audio_start;
+ hdmi.audio.audio_config = audio_config;
+ 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
dss_debugfs_create_file("hdmi", hdmi_dump_regs);
return 0;
@@ -743,6 +820,9 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
static int __exit omapdss_hdmihw_remove(struct platform_device *pdev)
{
+#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
+ hdmi_audio_unregister(pdev);
+#endif
hdmi_uninit_output(pdev);
pm_runtime_disable(&pdev->dev);
--
1.7.9.5
^ permalink raw reply related
* [PATCH v3 09/14] OMAPDSS: Kconfig: Update OMAP5_DSS_HDMI_AUDIO option
From: Jyri Sarha @ 2014-08-08 13:23 UTC (permalink / raw)
To: alsa-devel, linux-fbdev, linux-omap
Cc: liam.r.girdwood, detheridge, broonie, Jyri Sarha, peter.ujfalusi,
tomi.valkeinen
In-Reply-To: <cover.1407503813.git.jsarha@ti.com>
Add help section to OMAP5_DSS_HDMI_AUDIO with dependency to
OMAP5_DSS_HDMI and select for OMAP_DSS_HDMI_AUDIO.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
drivers/video/fbdev/omap2/dss/Kconfig | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig
index 701164a..abd2e92 100644
--- a/drivers/video/fbdev/omap2/dss/Kconfig
+++ b/drivers/video/fbdev/omap2/dss/Kconfig
@@ -103,8 +103,17 @@ 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
+ select OMAP_DSS_HDMI_AUDIO
+ default y
+ help
+ HDMI audio support for OMAP5 based SoCs. Adds integrated
+ ASoC Digital Audio Interface component driver into OMAPDSS
+ module. If enabled OMAP2_DSS selects SND_OMAP_SOC,
+ SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for full HDMI
+ audio support.
config OMAP2_DSS_SDI
bool "SDI support"
--
1.7.9.5
^ permalink raw reply related
* [PATCH v3 08/14] OMAPDSS: hdmi4: Register HDMI audio ASoC drivers from HDMI driver
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.git.jsarha@ti.com>
Initialize the callbacks in struct hdmi_audio_data 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 | 87 +++++++++++++++++++++++++++++++++
1 file changed, 87 insertions(+)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c b/drivers/video/fbdev/omap2/dss/hdmi4.c
index b98186e..707dcec 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -34,6 +34,9 @@
#include <linux/regulator/consumer.h>
#include <video/omapdss.h>
+#include <sound/soc.h>
+#include <sound/soc-dai.h>
+
#include "hdmi4_core.h"
#include "dss.h"
#include "dss_features.h"
@@ -655,6 +658,73 @@ err:
return r;
}
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+static int mode_has_audio(struct omap_hdmi *hd)
+{
+ int ret;
+
+ mutex_lock(&hd->lock);
+ ret = hdmi_mode_has_audio(&hd->cfg);
+ mutex_unlock(&hd->lock);
+
+ return ret;
+}
+
+static int audio_enable(struct omap_hdmi *hd, bool enable)
+{
+ int ret;
+
+ mutex_lock(&hd->lock);
+ if (!hdmi_mode_has_audio(&hd->cfg))
+ ret = -EPERM;
+ else
+ ret = hdmi_wp_audio_enable(&hd->wp, enable);
+ mutex_unlock(&hd->lock);
+
+ return ret;
+}
+
+static int audio_start(struct omap_hdmi *hd, bool enable)
+{
+ int ret = 0;
+
+ if (enable)
+ ret = hdmi4_audio_start(&hd->core, &hd->wp);
+ else
+ hdmi4_audio_stop(&hd->core, &hd->wp);
+
+ return ret;
+}
+
+static int audio_config(struct omap_hdmi *hd, struct omap_dss_audio *dss_audio)
+{
+ int ret;
+
+ mutex_lock(&hd->lock);
+ if (!hdmi_mode_has_audio(&hd->cfg))
+ ret = -EPERM;
+ else
+ ret = hdmi4_audio_config(&hd->core, &hd->wp, dss_audio,
+ hd->cfg.timings.pixelclock);
+ mutex_unlock(&hd->lock);
+
+ return ret;
+}
+
+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)
{
@@ -712,6 +782,20 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
hdmi_init_output(pdev);
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+ hdmi.audio.hdmi_dai_drv = &omap_hdmi_dai;
+ hdmi.audio.mode_has_audio = mode_has_audio;
+ hdmi.audio.audio_enable = audio_enable;
+ hdmi.audio.audio_start = audio_start;
+ hdmi.audio.audio_config = audio_config;
+ 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
dss_debugfs_create_file("hdmi", hdmi_dump_regs);
return 0;
@@ -719,6 +803,9 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
static int __exit omapdss_hdmihw_remove(struct platform_device *pdev)
{
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+ hdmi_audio_unregister(pdev);
+#endif
hdmi_uninit_output(pdev);
pm_runtime_disable(&pdev->dev);
--
1.7.9.5
^ permalink raw reply related
* [PATCH v3 07/14] OMAPDSS: Kconfig: Update OMAP4_DSS_HDMI_AUDIO option
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.git.jsarha@ti.com>
Add help section to OMAP4_DSS_HDMI_AUDIO with dependency to
OMAP4_DSS_HDMI and select for newly created OMAP_DSS_HDMI_AUDIO. The
OMAP_DSS_HDMI_AUDIO option is for common HDMI audio support and it is
is dependent on SND_SOC.
Also selects SND_OMAP_SOC, SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for
OMAP2_DSS if OMAP_DSS_HDMI_AUDIO is enabled.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
drivers/video/fbdev/omap2/dss/Kconfig | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig
index 41fb8ac..701164a 100644
--- a/drivers/video/fbdev/omap2/dss/Kconfig
+++ b/drivers/video/fbdev/omap2/dss/Kconfig
@@ -6,6 +6,9 @@ menuconfig OMAP2_DSS
select VIDEOMODE_HELPERS
select OMAP2_DSS_INIT
select HDMI
+ select SND_OMAP_SOC if OMAP_DSS_HDMI_AUDIO
+ select SND_SOC_HDMI_CODEC if OMAP_DSS_HDMI_AUDIO
+ select SND_SIMPLE_CARD if OMAP_DSS_HDMI_AUDIO
help
OMAP2+ Display Subsystem support.
@@ -78,7 +81,17 @@ config OMAP4_DSS_HDMI
HDMI support for OMAP4 based SoCs.
config OMAP4_DSS_HDMI_AUDIO
- bool
+ bool "HDMI audio support for OMAP4"
+ depends on OMAP4_DSS_HDMI
+ depends on SND_SOC=y || OMAP2_DSS = SND_SOC
+ select OMAP_DSS_HDMI_AUDIO
+ default y
+ help
+ HDMI audio support for OMAP4 based SoCs. Adds integrated
+ ASoC Digital Audio Interface component driver into OMAPDSS
+ module. If enabled OMAP2_DSS selects SND_OMAP_SOC,
+ SND_SOC_HDMI_CODEC, and SND_SIMPLE_CARD for full HDMI
+ audio support.
config OMAP5_DSS_HDMI
bool "HDMI support for OMAP5"
--
1.7.9.5
^ permalink raw reply related
* [PATCH v3 06/14] OMAPDSS: hdmi_audio: Integrated ASoC DAI component driver implementation
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.git.jsarha@ti.com>
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/Kconfig | 3 +
drivers/video/fbdev/omap2/dss/Makefile | 1 +
drivers/video/fbdev/omap2/dss/hdmi.h | 37 +++-
drivers/video/fbdev/omap2/dss/hdmi_audio.c | 298 ++++++++++++++++++++++++++++
4 files changed, 335 insertions(+), 4 deletions(-)
create mode 100644 drivers/video/fbdev/omap2/dss/hdmi_audio.c
diff --git a/drivers/video/fbdev/omap2/dss/Kconfig b/drivers/video/fbdev/omap2/dss/Kconfig
index 3d5eb6c..41fb8ac 100644
--- a/drivers/video/fbdev/omap2/dss/Kconfig
+++ b/drivers/video/fbdev/omap2/dss/Kconfig
@@ -67,6 +67,9 @@ config OMAP2_DSS_VENC
config OMAP2_DSS_HDMI_COMMON
bool
+config OMAP_DSS_HDMI_AUDIO
+ bool
+
config OMAP4_DSS_HDMI
bool "HDMI support for OMAP4"
default y
diff --git a/drivers/video/fbdev/omap2/dss/Makefile b/drivers/video/fbdev/omap2/dss/Makefile
index 245f933..a95d715 100644
--- a/drivers/video/fbdev/omap2/dss/Makefile
+++ b/drivers/video/fbdev/omap2/dss/Makefile
@@ -13,6 +13,7 @@ omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o
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_OMAP_DSS_HDMI_AUDIO) += hdmi_audio.o
omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o
omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.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 f5ae8ae..64544e1 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -25,6 +25,9 @@
#include <linux/hdmi.h>
#include <video/omapdss.h>
+#include <sound/dmaengine_pcm.h>
+#include <uapi/sound/asound.h>
+
#include "dss.h"
/* HDMI Wrapper */
@@ -337,7 +340,31 @@ int hdmi_phy_parse_lanes(struct hdmi_phy_data *phy, const u32 *lanes);
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)
+struct omap_hdmi;
+
+/* HDMI audio support */
+struct hdmi_audio_data {
+ /* These should be initialized when hdmi_audio_register() is called */
+ struct snd_soc_dai_driver *hdmi_dai_drv;
+
+ int (*mode_has_audio)(struct omap_hdmi *hd);
+ int (*audio_enable)(struct omap_hdmi *hd, bool enable);
+ int (*audio_start)(struct omap_hdmi *hd, bool enable);
+ int (*audio_config)(struct omap_hdmi *hd,
+ struct omap_dss_audio *dss_audio);
+
+ /* These are for 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;
+};
+
+int hdmi_audio_register(struct platform_device *pdev);
+void hdmi_audio_unregister(struct platform_device *pdev);
+
int hdmi_compute_acr(u32 pclk, u32 sample_freq, u32 *n, u32 *cts);
int hdmi_wp_audio_enable(struct hdmi_wp_data *wp, bool enable);
int hdmi_wp_audio_core_req_enable(struct hdmi_wp_data *wp, bool enable);
@@ -345,13 +372,16 @@ void hdmi_wp_audio_config_format(struct hdmi_wp_data *wp,
struct hdmi_audio_format *aud_fmt);
void hdmi_wp_audio_config_dma(struct hdmi_wp_data *wp,
struct hdmi_audio_dma *aud_dma);
-static inline bool hdmi_mode_has_audio(int mode)
+static inline bool hdmi_mode_has_audio(struct hdmi_config *cfg)
{
- return mode = HDMI_HDMI ? true : false;
+ return cfg->hdmi_dvi_mode = HDMI_HDMI ? true : false;
}
/* HDMI DRV data */
struct omap_hdmi {
+#if defined(CONFIG_OMAP_DSS_HDMI_AUDIO)
+ struct hdmi_audio_data audio;
+#endif
struct mutex lock;
struct platform_device *pdev;
@@ -371,4 +401,3 @@ struct omap_hdmi {
};
#endif
-#endif
diff --git a/drivers/video/fbdev/omap2/dss/hdmi_audio.c b/drivers/video/fbdev/omap2/dss/hdmi_audio.c
new file mode 100644
index 0000000..6795d93
--- /dev/null
+++ b/drivers/video/fbdev/omap2/dss/hdmi_audio.c
@@ -0,0 +1,298 @@
+/*
+ * OMAP4+ HDMI audio
+ *
+ * Copyright (C) 2014 Texas Instruments Incorporated
+ *
+ * Authors: Jyri Sarha <jsarha@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/string.h>
+#include <linux/platform_device.h>
+#include <sound/soc.h>
+#include <sound/pcm_params.h>
+#include <sound/dmaengine_pcm.h>
+#include <uapi/sound/asound.h>
+#include <sound/asoundef.h>
+#include <sound/omap-pcm.h>
+#include <sound/simple_card.h>
+
+#include "hdmi.h"
+
+static int hdmi_dai_startup(struct snd_pcm_substream *substream,
+ struct snd_soc_dai *dai)
+{
+ struct omap_hdmi *hd = snd_soc_dai_get_drvdata(dai);
+ struct hdmi_audio_data *ad = &hd->audio;
+ int ret;
+ /*
+ * Make sure that the period bytes are multiple of the DMA packet size.
+ * Largest packet size we use is 32 32-bit words = 128 bytes
+ */
+ ret = snd_pcm_hw_constraint_step(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128);
+ if (ret < 0) {
+ dev_err(dai->dev, "could not apply constraint\n");
+ return ret;
+ }
+
+ if (!ad->mode_has_audio(hd)) {
+ dev_err(dai->dev, "audio not supported\n");
+ return -ENODEV;
+ }
+
+ snd_soc_dai_set_dma_data(dai, substream, &ad->dma_data);
+
+ return 0;
+}
+
+static int hdmi_dai_prepare(struct snd_pcm_substream *substream,
+ struct snd_soc_dai *dai)
+{
+ struct omap_hdmi *hd = snd_soc_dai_get_drvdata(dai);
+ struct hdmi_audio_data *ad = &hd->audio;
+
+ return ad->audio_enable(hd, true);
+}
+
+static int hdmi_dai_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params,
+ struct snd_soc_dai *dai)
+{
+ struct omap_hdmi *hd = snd_soc_dai_get_drvdata(dai);
+ struct hdmi_audio_data *ad = &hd->audio;
+ struct snd_aes_iec958 *iec = &ad->iec;
+ struct snd_cea_861_aud_if *cea = &ad->cea;
+
+ switch (params_format(params)) {
+ case SNDRV_PCM_FORMAT_S16_LE:
+ ad->dma_data.maxburst = 16;
+ break;
+ case SNDRV_PCM_FORMAT_S24_LE:
+ ad->dma_data.maxburst = 32;
+ break;
+ default:
+ dev_err(dai->dev, "format not supported!\n");
+ return -EINVAL;
+ }
+
+ ad->dss_audio.iec = iec;
+ ad->dss_audio.cea = cea;
+ /*
+ * fill the IEC-60958 channel status word
+ */
+ /* initialize the word bytes */
+ memset(iec->status, 0, sizeof(iec->status));
+
+ /* specify IEC-60958-3 (commercial use) */
+ iec->status[0] &= ~IEC958_AES0_PROFESSIONAL;
+
+ /* specify that the audio is LPCM*/
+ iec->status[0] &= ~IEC958_AES0_NONAUDIO;
+
+ iec->status[0] |= IEC958_AES0_CON_NOT_COPYRIGHT;
+
+ iec->status[0] |= IEC958_AES0_CON_EMPHASIS_NONE;
+
+ iec->status[0] |= IEC958_AES1_PRO_MODE_NOTID;
+
+ iec->status[1] = IEC958_AES1_CON_GENERAL;
+
+ iec->status[2] |= IEC958_AES2_CON_SOURCE_UNSPEC;
+
+ iec->status[2] |= IEC958_AES2_CON_CHANNEL_UNSPEC;
+
+ switch (params_rate(params)) {
+ case 32000:
+ iec->status[3] |= IEC958_AES3_CON_FS_32000;
+ break;
+ case 44100:
+ iec->status[3] |= IEC958_AES3_CON_FS_44100;
+ break;
+ case 48000:
+ iec->status[3] |= IEC958_AES3_CON_FS_48000;
+ break;
+ case 88200:
+ iec->status[3] |= IEC958_AES3_CON_FS_88200;
+ break;
+ case 96000:
+ iec->status[3] |= IEC958_AES3_CON_FS_96000;
+ break;
+ case 176400:
+ iec->status[3] |= IEC958_AES3_CON_FS_176400;
+ break;
+ case 192000:
+ iec->status[3] |= IEC958_AES3_CON_FS_192000;
+ break;
+ default:
+ dev_err(dai->dev, "rate not supported!\n");
+ return -EINVAL;
+ }
+
+ /* specify the clock accuracy */
+ iec->status[3] |= IEC958_AES3_CON_CLOCK_1000PPM;
+
+ /*
+ * specify the word length. The same word length value can mean
+ * two different lengths. Hence, we need to specify the maximum
+ * word length as well.
+ */
+ switch (params_format(params)) {
+ case SNDRV_PCM_FORMAT_S16_LE:
+ iec->status[4] |= IEC958_AES4_CON_WORDLEN_20_16;
+ iec->status[4] &= ~IEC958_AES4_CON_MAX_WORDLEN_24;
+ break;
+ case SNDRV_PCM_FORMAT_S24_LE:
+ iec->status[4] |= IEC958_AES4_CON_WORDLEN_24_20;
+ iec->status[4] |= IEC958_AES4_CON_MAX_WORDLEN_24;
+ break;
+ default:
+ dev_err(dai->dev, "format not supported!\n");
+ return -EINVAL;
+ }
+
+ /*
+ * Fill the CEA-861 audio infoframe (see spec for details)
+ */
+
+ cea->db1_ct_cc = (params_channels(params) - 1)
+ & CEA861_AUDIO_INFOFRAME_DB1CC;
+ cea->db1_ct_cc |= CEA861_AUDIO_INFOFRAME_DB1CT_FROM_STREAM;
+
+ cea->db2_sf_ss = CEA861_AUDIO_INFOFRAME_DB2SF_FROM_STREAM;
+ cea->db2_sf_ss |= CEA861_AUDIO_INFOFRAME_DB2SS_FROM_STREAM;
+
+ cea->db3 = 0; /* not used, all zeros */
+
+ /*
+ * The OMAP HDMI IP requires to use the 8-channel channel code when
+ * transmitting more than two channels.
+ */
+ if (params_channels(params) = 2)
+ cea->db4_ca = 0x0;
+ else
+ cea->db4_ca = 0x13;
+
+ cea->db5_dminh_lsv = CEA861_AUDIO_INFOFRAME_DB5_DM_INH_PROHIBITED;
+ /* the expression is trivial but makes clear what we are doing */
+ cea->db5_dminh_lsv |= (0 & CEA861_AUDIO_INFOFRAME_DB5_LSV);
+
+ return ad->audio_config(hd, &ad->dss_audio);
+}
+
+static int hdmi_dai_trigger(struct snd_pcm_substream *substream, int cmd,
+ struct snd_soc_dai *dai)
+{
+ struct omap_hdmi *hd = snd_soc_dai_get_drvdata(dai);
+ struct hdmi_audio_data *ad = &hd->audio;
+ int err = 0;
+
+ switch (cmd) {
+ case SNDRV_PCM_TRIGGER_START:
+ case SNDRV_PCM_TRIGGER_RESUME:
+ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
+ err = ad->audio_start(hd, true);
+ break;
+ case SNDRV_PCM_TRIGGER_STOP:
+ case SNDRV_PCM_TRIGGER_SUSPEND:
+ case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
+ ad->audio_start(hd, false);
+ break;
+ default:
+ err = -EINVAL;
+ }
+ return err;
+}
+
+static void hdmi_dai_shutdown(struct snd_pcm_substream *substream,
+ struct snd_soc_dai *dai)
+{
+ struct omap_hdmi *hd = snd_soc_dai_get_drvdata(dai);
+ struct hdmi_audio_data *ad = &hd->audio;
+
+ ad->audio_enable(hd, false);
+}
+
+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",
+};
+
+int hdmi_audio_register(struct platform_device *pdev)
+{
+ struct omap_hdmi *hd = dev_get_drvdata(&pdev->dev);
+ struct hdmi_audio_data *ad = &hd->audio;
+ struct device *dev = &pdev->dev;
+ struct asoc_simple_card_info card_info = {
+ .codec_dai.name = "hdmi-hifi",
+ };
+ char nametmp[64];
+ int ret;
+
+ ad->dma_data.addr = hdmi_wp_get_audio_dma_addr(&hd->wp);
+ ad->dma_data.filter_data = "audio_tx";
+ ad->dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
+ ad->hdmi_dai_drv->ops = &hdmi_dai_ops,
+
+ ret = snd_soc_register_component(dev, &omap_hdmi_component,
+ ad->hdmi_dai_drv, 1);
+ if (ret)
+ return ret;
+
+ ret = omap_pcm_platform_register(dev);
+ if (ret)
+ return ret;
+
+ ad->codec_pdev = platform_device_register_data(dev, "hdmi-audio-codec",
+ 0, NULL, 0);
+ if (IS_ERR(ad->codec_pdev)) {
+ snd_soc_unregister_component(dev);
+ return PTR_ERR(ad->codec_pdev);
+ }
+
+ snprintf(nametmp, sizeof(nametmp), "HDMI %s", dev_name(dev));
+ card_info.name = devm_kstrdup(dev, nametmp, GFP_KERNEL);
+ card_info.card = card_info.name;
+ card_info.cpu_dai.name = dev_name(dev);
+ card_info.platform = dev_name(dev);
+ card_info.codec = dev_name(&ad->codec_pdev->dev);
+
+ ad->card_pdev + platform_device_register_data(dev, "asoc-simple-card", 0,
+ &card_info, sizeof(card_info));
+ if (IS_ERR(ad->card_pdev)) {
+ snd_soc_unregister_component(dev);
+ platform_device_unregister(ad->codec_pdev);
+ return PTR_ERR(ad->card_pdev);
+ }
+ return 0;
+}
+
+void hdmi_audio_unregister(struct platform_device *pdev)
+{
+ struct omap_hdmi *hd = dev_get_drvdata(&pdev->dev);
+ struct hdmi_audio_data *ad = &hd->audio;
+
+ platform_device_unregister(ad->card_pdev);
+ platform_device_unregister(ad->codec_pdev);
+ snd_soc_unregister_component(&pdev->dev);
+}
--
1.7.9.5
^ permalink raw reply related
* [PATCH v3 05/14] OMAPDSS: hdmi: Make hdmi structure public
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.git.jsarha@ti.com>
Unify the private anonymous struct in hdmi4.c and hdmi5.c, name it as
struct omap_hdmi, and make it public in hdmi.h.
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
drivers/video/fbdev/omap2/dss/hdmi.h | 21 +++++++++++++++++++++
drivers/video/fbdev/omap2/dss/hdmi4.c | 31 ++++++++-----------------------
drivers/video/fbdev/omap2/dss/hdmi5.c | 20 ++------------------
3 files changed, 31 insertions(+), 41 deletions(-)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h b/drivers/video/fbdev/omap2/dss/hdmi.h
index 9e85b86..f5ae8ae 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -349,5 +349,26 @@ 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;
+
+ 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..b98186e 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -37,25 +37,9 @@
#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 int hdmi_runtime_get(void)
{
@@ -117,7 +101,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 +121,7 @@ static int hdmi_init_regulator(void)
}
}
- hdmi.vdda_hdmi_dac_reg = reg;
+ hdmi.vdda_reg = reg;
return 0;
}
@@ -146,7 +130,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 +146,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 +156,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)
@@ -678,6 +662,7 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
int irq;
hdmi.pdev = pdev;
+ dev_set_drvdata(&pdev->dev, &hdmi);
mutex_init(&hdmi.lock);
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c b/drivers/video/fbdev/omap2/dss/hdmi5.c
index 32d02ec..90410f5 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -43,24 +43,7 @@
#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 int hdmi_runtime_get(void)
{
@@ -703,6 +686,7 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
int irq;
hdmi.pdev = pdev;
+ dev_set_drvdata(&pdev->dev, &hdmi);
mutex_init(&hdmi.lock);
--
1.7.9.5
^ permalink raw reply related
* [PATCH v3 04/14] OMAPDSS: hdmi_wp: Add function for getting audio dma address
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.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 v3 03/14] OMAPDSS: hdmi_common: hdmi_compute_acr is needed for OMAP5 HDMI audio too
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.git.jsarha@ti.com>
Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
drivers/video/fbdev/omap2/dss/hdmi_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/omap2/dss/hdmi_common.c b/drivers/video/fbdev/omap2/dss/hdmi_common.c
index 7d5f103..2e48d90 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi_common.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi_common.c
@@ -48,7 +48,7 @@ int hdmi_parse_lanes_of(struct platform_device *pdev, struct device_node *ep,
return 0;
}
-#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
+#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
int hdmi_compute_acr(u32 pclk, u32 sample_freq, u32 *n, u32 *cts)
{
u32 deep_color;
--
1.7.9.5
^ permalink raw reply related
* [PATCH v3 02/14] OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.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 v3 01/14] ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
From: Jyri Sarha @ 2014-08-08 13:23 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: <cover.1407503813.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 v3 00/14] Rework OMAP4+ HDMI audio support
From: Jyri Sarha @ 2014-08-08 13:23 UTC (permalink / raw)
To: alsa-devel, linux-fbdev, linux-omap
Cc: peter.ujfalusi, broonie, liam.r.girdwood, tomi.valkeinen,
detheridge, Jyri Sarha
Question to ASoC maintainers:
Do feel it is Ok to put ASoC code outside sound/soc the way I do
in these patches (in patch 0006 particularly)?
The patches are based on:
git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git for-next
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
Changes since v2 version of the patches:
- Add "OMAPDSS: hdmi_common: hdmi_compute_acr is needed for OMAP5 HDMI audio too"
- Fix "OMAPDSS: hdmi: Make hdmi structure public". There was no need to make
"core"-member a pointer.
- Make functional division between hdmi_audio.c and hdmi[45].c more clear.
hdmi_audio.c does not touch anything but "audio"-member in omap_hdmi struct
that is stored in drvdata.
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 (14):
ARM: OMAP2+: Remove non working OMAP HDMI audio initialization
OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
OMAPDSS: hdmi_common: hdmi_compute_acr is needed for OMAP5 HDMI audio
too
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 | 61 +++-
drivers/video/fbdev/omap2/dss/hdmi4.c | 231 +++++--------
drivers/video/fbdev/omap2/dss/hdmi5.c | 213 +++++-------
drivers/video/fbdev/omap2/dss/hdmi_audio.c | 298 ++++++++++++++++
drivers/video/fbdev/omap2/dss/hdmi_common.c | 2 +-
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 --
17 files changed, 567 insertions(+), 994 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
* [GIT PULL] fbdev changes for 3.17
From: Tomi Valkeinen @ 2014-08-08 11:36 UTC (permalink / raw)
To: Linus Torvalds; +Cc: LKML, Linux Fbdev development list
[-- Attachment #1: Type: text/plain, Size: 5789 bytes --]
Hi Linus,
Please pull the fbdev changes for 3.17.
Tomi
The following changes since commit a497c3ba1d97fc69c1e78e7b96435ba8c2cb42ee:
Linux 3.16-rc2 (2014-06-21 19:02:54 -1000)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git tags/fbdev-3.17
for you to fetch changes up to e4e42b8ad24cabf4d6d3c20a63f18dd6b954d9c2:
OMAPDSS: DSI: fix depopulating dsi peripherals (2014-08-08 14:26:36 +0300)
----------------------------------------------------------------
fbdev changes for 3.17
* Much better HDMI infoframe support for OMAP
* Cirrus Logic CLPS711X framebuffer driver
* DT support for PL11x CLCD driver
* Various small fixes
----------------------------------------------------------------
Alexander Shiyan (4):
video: clps711x: Add new Cirrus Logic CLPS711X framebuffer driver
video: clps711x: Add bindings documentation for CLPS711X framebuffer
video: clps711x: Fix driver build for CONFIG_FB=m
video: clps711x: Fix sparse warnings
Archit Taneja (1):
fbdev: arm has __raw I/O accessors, use them in fb.h
Dan Carpenter (1):
video/mbx: indent some if statements
Dexuan Cui (1):
video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
Emil Goode (1):
video: vt8500lcdfb: Remove kfree call since devm_kzalloc() is used
Fabian Frederick (1):
drivers/video/fbdev/sis/sis_main.c: remove unnecessary test on unsigned value
Himangi Saraogi (2):
video: msm: Introduce the use of the managed version of kzalloc
drivers/video/fbdev : dereference without an error test
Jingoo Han (1):
MAINTAINERS: Update Framebuffer file patterns
Joe Perches (1):
fbdev: da8xx-fb: Use dma_zalloc_coherent
Michael Welling (1):
drivers: video: fbdev: atmel_lcdfb.c: Add ability to inverted backlight PWM.
Paul Bolle (1):
video: 68328fb: remove check for CONFIG_FB_68328_INVERT
Pawel Moll (2):
video: ARM CLCD: Add DT support
video: ARM CLCD: Fix DT-related build problems
Rasmus Villemoes (1):
drivers/video/fbdev/sis: Add missing else
Tomi Valkeinen (17):
OMAPDSS: DISPC: fix debugfs reg dump
OMAPDSS: DISPC: reject interlace for lcd out
OMAPDSS: DISPC: clean up dispc_mgr_timings_ok
OMAPDSS: HDMI: fix name conflict
OMAPDSS: Kconfig: select HDMI
OMAPDSS: HDMI4: use common AVI infoframe support
OMAPDSS: HDMI5: use common AVI infoframe support
OMAPDSS: HDMI: remove custom avi infoframe
OMAPDSS: add hdmi ops to hdmi_ops and omap_dss_driver
OMAPDSS: add hdmi ops to hdmi-connector and tpd12s015
OMAPDSS: HDMI: add infoframe and hdmi_dvi_mode fields
OMAPDSS: HDMI4: add support to set infoframe & HDMI mode
OMAPDSS: HDMI5: add support to set infoframe & HDMI mode
OMAPDSS: HDMI: remove the unused code
drm/omap: Add infoframe & dvi/hdmi mode support
Merge branch '3.17/hdmi-infoframe' into for-next
OMAPDSS: DSI: fix depopulating dsi peripherals
Vasily Khoruzhick (1):
video: fbdev: s3c2410fb: Move to clk_prepare_enable/clk_disable_unprepare
.../devicetree/bindings/video/arm,pl11x.txt | 109 ++++++
.../devicetree/bindings/video/atmel,lcdc.txt | 1 +
.../bindings/video/cirrus,clps711x-fb.txt | 47 +++
MAINTAINERS | 74 ++--
drivers/gpu/drm/omapdrm/omap_connector.c | 12 +
drivers/gpu/drm/omapdrm/omap_drv.h | 1 +
drivers/gpu/drm/omapdrm/omap_encoder.c | 27 ++
drivers/video/fbdev/68328fb.c | 8 +-
drivers/video/fbdev/Kconfig | 23 +-
drivers/video/fbdev/Makefile | 3 +-
drivers/video/fbdev/amba-clcd.c | 263 ++++++++++++++
drivers/video/fbdev/atmel_lcdfb.c | 3 +-
drivers/video/fbdev/clps711x-fb.c | 397 +++++++++++++++++++++
drivers/video/fbdev/da8xx-fb.c | 9 +-
drivers/video/fbdev/hyperv_fb.c | 62 +++-
drivers/video/fbdev/mbx/mbxfb.c | 4 +-
drivers/video/fbdev/msm/mddi_client_dummy.c | 19 +-
.../fbdev/omap2/displays-new/connector-hdmi.c | 19 +
.../fbdev/omap2/displays-new/encoder-tpd12s015.c | 20 ++
.../omap2/displays-new/panel-sony-acx565akm.c | 5 +
drivers/video/fbdev/omap2/dss/Kconfig | 1 +
drivers/video/fbdev/omap2/dss/dispc.c | 22 +-
drivers/video/fbdev/omap2/dss/dsi.c | 9 +-
drivers/video/fbdev/omap2/dss/hdmi.h | 107 +-----
drivers/video/fbdev/omap2/dss/hdmi4.c | 53 ++-
drivers/video/fbdev/omap2/dss/hdmi4_core.c | 164 ++-------
drivers/video/fbdev/omap2/dss/hdmi4_core.h | 1 +
drivers/video/fbdev/omap2/dss/hdmi5.c | 53 ++-
drivers/video/fbdev/omap2/dss/hdmi5_core.c | 124 +++----
drivers/video/fbdev/omap2/dss/hdmi_common.c | 316 ----------------
drivers/video/fbdev/s3c2410fb.c | 10 +-
drivers/video/fbdev/sis/init.c | 2 +-
drivers/video/fbdev/sis/sis_main.c | 4 -
drivers/video/fbdev/vt8500lcdfb.c | 2 -
include/linux/fb.h | 2 +-
include/video/omapdss.h | 9 +
36 files changed, 1194 insertions(+), 791 deletions(-)
create mode 100644 Documentation/devicetree/bindings/video/arm,pl11x.txt
create mode 100644 Documentation/devicetree/bindings/video/cirrus,clps711x-fb.txt
create mode 100644 drivers/video/fbdev/clps711x-fb.c
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* =?UTF-8?q?=5BPATCH=2014/14=5D=20video=3A=20of=3A=20display=5Ftiming=3A=20delete=20unneeded=20test=20
From: Julia Lawall @ 2014-08-08 10:07 UTC (permalink / raw)
To: Jean-Christophe Plagniol-Villard
Cc: kernel-janitors, Tomi Valkeinen, linux-fbdev, linux-kernel,
Uwe Kleine-König
From: Julia Lawall <Julia.Lawall@lip6.fr>
Of_node_put supports NULL as its argument, so the initial test is not
necessary. Furthermore, native_mode cannot be NULL at this point.
Suggested by Uwe Kleine-König.
The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression e;
@@
-if (e)
of_node_put(e);
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/video/of_display_timing.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index 987edf1..339f831 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -233,8 +233,7 @@ struct display_timings *of_get_display_timings(struct device_node *np)
return disp;
timingfail:
- if (native_mode)
- of_node_put(native_mode);
+ of_node_put(native_mode);
display_timings_release(disp);
entryfail:
kfree(disp);
^ permalink raw reply related
* [PATCH 3/3] Adding Skyworks SKY81452 backlight driver
From: Gyungoh Yoo @ 2014-08-08 9:12 UTC (permalink / raw)
To: rdunlap, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
jg1.han, cooloney, lee.jones, plagnioj, tomi.valkeinen
Cc: jack.yoo, linux-doc, linux-kernel, devicetree, linux-fbdev
Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
---
Documentation/backlight/sky81452-backlight.txt | 26 ++
.../video/backlight/sky81452-backlight.txt | 20 ++
drivers/video/backlight/Kconfig | 10 +
drivers/video/backlight/Makefile | 1 +
drivers/video/backlight/sky81452-backlight.c | 334 +++++++++++++++++++++
include/linux/sky81452-backlight.h | 47 +++
6 files changed, 438 insertions(+)
create mode 100644 Documentation/backlight/sky81452-backlight.txt
create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
create mode 100644 drivers/video/backlight/sky81452-backlight.c
create mode 100644 include/linux/sky81452-backlight.h
diff --git a/Documentation/backlight/sky81452-backlight.txt b/Documentation/backlight/sky81452-backlight.txt
new file mode 100644
index 0000000..e5a18ee
--- /dev/null
+++ b/Documentation/backlight/sky81452-backlight.txt
@@ -0,0 +1,26 @@
+backlight driver for sky81452
+=============
+
+* Skyworks Solutions SKY81452 :
+ High-Efficiency, Six-Channel White LED Driver with Touch Panel Bias Supply
+
+Description
+-----------
+The SKY81452 is a highly integrated, high-efficiency LED backlight solution for
+tablets, notebook computers, monitors, and other portable devices.
+
+The SKY81452 supports Direct Pulse Width Modulation(DPWM) dimming and Analog
+Pulse Width Modulation (APWM). In the DPWM dimming mode, the output waveform
+follows the Pulse Width Modulation Input(PWMI) signal and the current level is
+set by I2C control and an external RSET resistor. In the APWM mode, the PWMI
+signal duty and the I2C brightness control signal are multiplied to control
+the output current level.
+
+The driver exports some additional attributes for SKY81452.
+- enable : Current sink channels. Bit0 is for channel 1, Bit1 is for channel 2
+ and Bit2 is for channel 3. In same way, Bit5 is for channel 6.
+ For example, if 5 is written to this attribute, channel 1 and
+ channel 3 are enabled.
+- open : Shows an open LED fault.
+- short : Shows an short LED fault.
+- fault : Shows information about over-current and over-temperature.
diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
new file mode 100644
index 0000000..ebedc33
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
@@ -0,0 +1,20 @@
+SKY81452-backlight bindings
+
+Optional properties:
+- name : Name of backlight device. Default is 'lcd-backlight'.
+- gpio-enable : GPIO to use to EN pin.
+- enable : Enable mask for current sink channel 1 to 6.
+- ignore-pwm : Ignore both PWM input
+- dpwm-mode : Enable DPWM dimming mode, otherwise Analog dimming mode
+- phase-shift : Enable phase shift mode
+- ovp-level : Over-voltage protection level. Should be between 14 or 28V.
+- short-detection-threshold : It should be one of 4, 5, 6 and 7V.
+- boost-current-limit : It should be one of 800, 1100 and 1500mA.
+
+Example:
+
+ backlight {
+ name = "pwm-backlight";
+ enable = <0x3F>;
+ ignore-pwm;
+ };
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index cc153f5..7b92a1b 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -420,6 +420,16 @@ config BACKLIGHT_PANDORA
If you have a Pandora console, say Y to enable the
backlight driver.
+config BACKLIGHT_SKY81452
+ tristate "Backlight driver for SKY81452"
+ depends on BACKLIGHT_CLASS_DEVICE && SKY81452
+ help
+ If you have a Skyworks SKY81452, say Y to enable the
+ backlight driver.
+
+ To compile this driver as a module, choose M here: the module will
+ be called sky81452-backlight
+
config BACKLIGHT_TPS65217
tristate "TPS65217 Backlight"
depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index a9ea34a..7e8136f 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -51,6 +51,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o
obj-$(CONFIG_BACKLIGHT_PCF50633) += pcf50633-backlight.o
obj-$(CONFIG_BACKLIGHT_PWM) += pwm_bl.o
obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o
+obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o
obj-$(CONFIG_BACKLIGHT_TOSA) += tosa_bl.o
obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o
obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o
diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c
new file mode 100644
index 0000000..d14179d
--- /dev/null
+++ b/drivers/video/backlight/sky81452-backlight.c
@@ -0,0 +1,334 @@
+/*
+ * sky81452-backlight.c SKY81452 backlight driver
+ *
+ * Copyright 2014 Skyworks Solutions Inc.
+ * Author : Gyungoh Yoo <jack.yoo@skyworksinc.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/of.h>
+#include <linux/err.h>
+#include <linux/gpio.h>
+#include <linux/of_gpio.h>
+#include <linux/regmap.h>
+#include <linux/backlight.h>
+#include <linux/sky81452-backlight.h>
+
+/* registers */
+#define SKY81452_REG0 0x00
+#define SKY81452_REG1 0x01
+#define SKY81452_REG2 0x02
+#define SKY81452_REG4 0x04
+#define SKY81452_REG5 0x05
+
+/* bit mask */
+#define SKY81452_CS 0xFF
+#define SKY81452_EN 0x3F
+#define SKY81452_IGPW 0x20
+#define SKY81452_PWMMD 0x10
+#define SKY81452_PHASE 0x08
+#define SKY81452_ILIM 0x04
+#define SKY81452_VSHRT 0x03
+#define SKY81452_OCP 0x80
+#define SKY81452_OTMP 0x40
+#define SKY81452_SHRT 0x3F
+#define SKY81452_OPN 0x3F
+
+#define SKY81452_DEFAULT_NAME "lcd-backlight"
+#define SKY81452_MAX_BRIGHTNESS (SKY81452_CS + 1)
+
+/* count trailing zeros */
+#define CTZ(b) ((b) & 0x0F ? \
+ ((b) & 0x03 ? ((b) & 0x01 ? 0 : 1) : ((b) & 0x04 ? 2 : 3)) : \
+ ((b) & 0x30 ? ((b) & 0x10 ? 4 : 5) : ((b) & 0x40 ? 6 : 7)))
+
+static int sky81452_bl_update_status(struct backlight_device *bd)
+{
+ const struct sky81452_bl_platform_data *pdata + dev_get_platdata(bd->dev.parent);
+ const unsigned int brightness = (unsigned int)bd->props.brightness;
+ struct regmap *map = bl_get_data(bd);
+ int ret;
+
+ if (brightness = 0)
+ return regmap_update_bits(map, SKY81452_REG1, SKY81452_EN, 0);
+ else {
+ ret = regmap_write(map, SKY81452_REG0, brightness - 1);
+ if (IS_ERR_VALUE(ret))
+ return ret;
+
+ return regmap_update_bits(map, SKY81452_REG1, SKY81452_EN,
+ pdata->enable << CTZ(SKY81452_EN));
+ }
+}
+
+static int sky81452_bl_get_brightness(struct backlight_device *bd)
+{
+ return bd->props.brightness;
+}
+
+static const struct backlight_ops sky81452_bl_ops = {
+ .update_status = sky81452_bl_update_status,
+ .get_brightness = sky81452_bl_get_brightness,
+};
+
+static ssize_t sky81452_bl_store_enable(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t count)
+{
+ struct regmap *map = bl_get_data(to_backlight_device(dev));
+ unsigned long value;
+ int ret;
+
+ ret = kstrtoul(buf, 16, &value);
+ if (IS_ERR_VALUE(ret))
+ return ret;
+
+ ret = regmap_update_bits(map, SKY81452_REG1,
+ SKY81452_EN, value << CTZ(SKY81452_EN));
+ if (IS_ERR_VALUE(ret))
+ return ret;
+
+ return count;
+}
+
+static ssize_t sky81452_bl_show_open_short(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct regmap *map = bl_get_data(to_backlight_device(dev));
+ unsigned int reg, value = 0;
+ char tmp[3];
+ int i, ret;
+
+ reg = !strcmp(attr->attr.name, "open") ? SKY81452_REG5 : SKY81452_REG4;
+ ret = regmap_read(map, reg, &value);
+ if (IS_ERR_VALUE(ret))
+ return ret;
+
+ if (value & SKY81452_SHRT) {
+ *buf = 0;
+ for (i = 0; i < 6; i++) {
+ if (value & 0x01) {
+ sprintf(tmp, "%d ", i + 1);
+ strcat(buf, tmp);
+ }
+ value >>= 1;
+ }
+ strcat(buf, "\n");
+ } else
+ strcpy(buf, "none\n");
+
+ return strlen(buf);
+}
+
+static ssize_t sky81452_bl_show_fault(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct regmap *map = bl_get_data(to_backlight_device(dev));
+ unsigned int value = 0;
+ int ret;
+
+ ret = regmap_read(map, SKY81452_REG4, &value);
+ if (IS_ERR_VALUE(ret))
+ return ret;
+
+ *buf = 0;
+
+ if (value & SKY81452_OCP)
+ strcat(buf, "over-current ");
+
+ if (value & SKY81452_OTMP)
+ strcat(buf, "over-temperature");
+
+ strcat(buf, "\n");
+ return strlen(buf);
+}
+
+static DEVICE_ATTR(enable, S_IWGRP | S_IWUSR, NULL, sky81452_bl_store_enable);
+static DEVICE_ATTR(open, S_IRUGO, sky81452_bl_show_open_short, NULL);
+static DEVICE_ATTR(short, S_IRUGO, sky81452_bl_show_open_short, NULL);
+static DEVICE_ATTR(fault, S_IRUGO, sky81452_bl_show_fault, NULL);
+
+static struct attribute *sky81452_bl_attribute[] = {
+ &dev_attr_enable.attr,
+ &dev_attr_open.attr,
+ &dev_attr_short.attr,
+ &dev_attr_fault.attr,
+ NULL
+};
+
+static const struct attribute_group sky81452_bl_attr_group = {
+ .attrs = sky81452_bl_attribute,
+};
+
+#ifdef CONFIG_OF
+static struct sky81452_bl_platform_data *sky81452_bl_parse_dt
+ (struct device *dev)
+{
+ struct device_node *np = dev->parent->of_node;
+ struct sky81452_bl_platform_data *pdata;
+ int ret;
+
+ np = of_get_child_by_name(dev->parent->of_node, "backlight");
+ if (unlikely(!np)) {
+ dev_err(dev, "backlight node not found");
+ return ERR_PTR(-EINVAL);
+ }
+
+ pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+ if (unlikely(!pdata)) {
+ of_node_put(np);
+ return ERR_PTR(-ENOMEM);
+ }
+
+ of_property_read_string(np, "name", &pdata->name);
+ pdata->ignore_pwm = of_property_read_bool(np, "ignore-pwm");
+ pdata->dpwm_mode = of_property_read_bool(np, "dpwm-mode");
+ pdata->phase_shift = of_property_read_bool(np, "phase-shift");
+
+ pdata->gpio_enable = of_get_named_gpio(np, "gpio-enable", 0);
+ if (IS_ERR_VALUE(pdata->gpio_enable))
+ pdata->gpio_enable = -1;
+
+ ret = of_property_read_u32(np, "enable", &pdata->enable);
+ if (IS_ERR_VALUE(ret))
+ pdata->enable = SKY81452_EN >> CTZ(SKY81452_EN);
+
+ ret = of_property_read_u32(np, "short-detection-threshold",
+ &pdata->short_detection_threshold);
+ if (IS_ERR_VALUE(ret))
+ pdata->short_detection_threshold = 7;
+
+ ret = of_property_read_u32(np, "boost-current-limit",
+ &pdata->boost_current_limit);
+ if (IS_ERR_VALUE(ret))
+ pdata->boost_current_limit = 2750;
+
+ of_node_put(np);
+ return pdata;
+}
+#else
+static struct sky81452_bl_platform_data *sky81452_bl_parse_dt
+ (struct device *dev)
+{
+ return ERR_PTR(-EINVAL);
+}
+#endif
+
+static int sky81452_bl_init_device(struct regmap *map,
+ struct sky81452_bl_platform_data *pdata)
+{
+ unsigned int value;
+
+ value = pdata->ignore_pwm ? SKY81452_IGPW : 0;
+ value |= pdata->dpwm_mode ? SKY81452_PWMMD : 0;
+ value |= pdata->phase_shift ? 0 : SKY81452_PHASE;
+
+ if (pdata->boost_current_limit = 2300)
+ value |= SKY81452_ILIM;
+ else if (pdata->boost_current_limit != 2720)
+ return -EINVAL;
+
+ if (pdata->short_detection_threshold < 4 ||
+ pdata->short_detection_threshold > 7)
+ return -EINVAL;
+ value |= (7 - pdata->short_detection_threshold) << CTZ(SKY81452_VSHRT);
+
+ return regmap_write(map, SKY81452_REG2, value);
+}
+
+static int sky81452_bl_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct regmap *map = dev_get_drvdata(dev->parent);
+ struct sky81452_bl_platform_data *pdata = dev_get_platdata(dev);
+ struct backlight_device *bd;
+ struct backlight_properties props;
+ const char *name;
+ int ret;
+
+ if (!pdata) {
+ pdata = sky81452_bl_parse_dt(dev);
+ if (IS_ERR(pdata))
+ return PTR_ERR(pdata);
+ }
+
+ if (pdata->gpio_enable >= 0) {
+ ret = devm_gpio_request_one(dev, pdata->gpio_enable,
+ GPIOF_OUT_INIT_HIGH, "sky81452-en");
+ if (IS_ERR_VALUE(ret))
+ return ret;
+ }
+
+ ret = sky81452_bl_init_device(map, pdata);
+ if (IS_ERR_VALUE(ret))
+ return ret;
+
+ memset(&props, 0, sizeof(props));
+ props.max_brightness = SKY81452_MAX_BRIGHTNESS,
+ name = pdata->name ? pdata->name : SKY81452_DEFAULT_NAME;
+ bd = devm_backlight_device_register(dev, name,
+ dev, map, &sky81452_bl_ops, &props);
+ if (IS_ERR(bd))
+ return PTR_ERR(bd);
+
+ platform_set_drvdata(pdev, bd);
+
+ ret = sysfs_create_group(&bd->dev.kobj, &sky81452_bl_attr_group);
+ if (IS_ERR_VALUE(ret))
+ goto err;
+
+ return ret;
+err:
+ backlight_device_unregister(bd);
+ return ret;
+}
+
+static int sky81452_bl_remove(struct platform_device *pdev)
+{
+ const struct sky81452_bl_platform_data *pdata + dev_get_platdata(&pdev->dev);
+ struct backlight_device *bd = platform_get_drvdata(pdev);
+
+ sysfs_remove_group(&bd->dev.kobj, &sky81452_bl_attr_group);
+
+ bd->props.power = FB_BLANK_UNBLANK;
+ bd->props.brightness = 0;
+ backlight_update_status(bd);
+
+ if (pdata->gpio_enable >= 0)
+ gpio_set_value_cansleep(pdata->gpio_enable, 0);
+
+ return 0;
+}
+
+static struct platform_driver sky81452_bl_driver = {
+ .driver = {
+ .name = "sky81452-bl",
+ },
+ .probe = sky81452_bl_probe,
+ .remove = sky81452_bl_remove,
+};
+
+module_platform_driver(sky81452_bl_driver);
+
+MODULE_DESCRIPTION("Skyworks SKY81452 backlight driver");
+MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@skyworksinc.com>");
+MODULE_LICENSE("GPL");
+MODULE_VERSION("1.0");
diff --git a/include/linux/sky81452-backlight.h b/include/linux/sky81452-backlight.h
new file mode 100644
index 0000000..b3635f9
--- /dev/null
+++ b/include/linux/sky81452-backlight.h
@@ -0,0 +1,47 @@
+/*
+ * sky81452.h SKY81452 backlight driver
+ *
+ * Copyright 2014 Skyworks Solutions Inc.
+ * Author : Gyungoh Yoo <jack.yoo@skyworksinc.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _SKY81452_BACKLIGHT_H
+#define _SKY81452_BACKLIGHT_H
+
+/**
+ * struct sky81452_platform_data
+ * @name: backlight driver name.
+ If it is not defined, default name is lcd-backlight.
+ * @gpio_enable:GPIO number which control EN pin
+ * @enable: Enable mask for current sink channel 1, 2, 3, 4, 5 and 6.
+ * @ignore_pwm: true if DPWMI should be ignored.
+ * @dpwm_mode: true is DPWM dimming mode, otherwise Analog dimming mode.
+ * @phase_shift:true is phase shift mode.
+ * @short_detecion_threshold: It should be one of 4, 5, 6 and 7V.
+ * @boost_current_limit: It should be one of 2300, 2750mA.
+ */
+struct sky81452_bl_platform_data {
+ const char *name;
+ int gpio_enable;
+ unsigned int enable;
+ bool ignore_pwm;
+ bool dpwm_mode;
+ bool phase_shift;
+ unsigned int short_detection_threshold;
+ unsigned int boost_current_limit;
+};
+
+#endif
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] Adding a support for Skyworks SKY81452
From: Tobias Klauser @ 2014-08-08 7:20 UTC (permalink / raw)
To: Thierry Reding
Cc: Gyungoh Yoo, rdunlap, robh+dt, pawel.moll, mark.rutland,
ijc+devicetree, galak, jg1.han, cooloney, plagnioj,
tomi.valkeinen, grant.likely, sameo, lee.jones, lgirdwood,
broonie, jack.yoo, florian.vaussard, jason, andrew, silvio.fricke,
linux-doc, linux-kernel, devicetree, linux-fbdev
In-Reply-To: <20140808070913.GB5387@ulmo>
On 2014-08-08 at 09:09:19 +0200, Thierry Reding <thierry.reding@gmail.com> wrote:
> On Thu, Aug 07, 2014 at 02:34:39PM +0200, Tobias Klauser wrote:
> > On 2014-08-07 at 10:05:38 +0200, Gyungoh Yoo <gyungoh@gmail.com> wrote:
> [...]
> > > +#ifdef CONFIG_OF
> > > +static const struct of_device_id sky81452_of_match[] = {
> > > + {.compatible = "sky,sky81452",},
> > > + { }
> > > +};
> > > +MODULE_DEVICE_TABLE(of, sky81452_of_match);
> > > +#endif
> >
> > The #ifdefery here is not needed since you use of_match_ptr below, whcih
> > will expand to NULL of CONFIG_OF is not set.
>
> On the contrary, that's exactly why the #ifdef is needed here. If you
> don't guard the OF match table here, then of_match_ptr() evaluating to
> NULL will cause the table to become unused and the compiler warning
> about it.
Oops, yes of course. Sorry about that and thanks for your correction.
Tobias
^ permalink raw reply
* Re: [PATCH] Adding a support for Skyworks SKY81452
From: Thierry Reding @ 2014-08-08 7:09 UTC (permalink / raw)
To: Tobias Klauser
Cc: Gyungoh Yoo, rdunlap, robh+dt, pawel.moll, mark.rutland,
ijc+devicetree, galak, jg1.han, cooloney, plagnioj,
tomi.valkeinen, grant.likely, sameo, lee.jones, lgirdwood,
broonie, jack.yoo, florian.vaussard, jason, andrew, silvio.fricke,
linux-doc, linux-kernel, devicetree, linux-fbdev
In-Reply-To: <20140807123439.GC29832@distanz.ch>
[-- Attachment #1: Type: text/plain, Size: 720 bytes --]
On Thu, Aug 07, 2014 at 02:34:39PM +0200, Tobias Klauser wrote:
> On 2014-08-07 at 10:05:38 +0200, Gyungoh Yoo <gyungoh@gmail.com> wrote:
[...]
> > +#ifdef CONFIG_OF
> > +static const struct of_device_id sky81452_of_match[] = {
> > + {.compatible = "sky,sky81452",},
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(of, sky81452_of_match);
> > +#endif
>
> The #ifdefery here is not needed since you use of_match_ptr below, whcih
> will expand to NULL of CONFIG_OF is not set.
On the contrary, that's exactly why the #ifdef is needed here. If you
don't guard the OF match table here, then of_match_ptr() evaluating to
NULL will cause the table to become unused and the compiler warning
about it.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply
* Re: [PATCH] Adding a support for Skyworks SKY81452
From: Gyungoh Yoo @ 2014-08-08 6:24 UTC (permalink / raw)
To: Tobias Klauser
Cc: rdunlap, robh+dt, pawel.moll, mark.rutland, ijc+devicetree, galak,
jg1.han, cooloney, plagnioj, tomi.valkeinen, grant.likely, sameo,
lee.jones, lgirdwood, broonie, jack.yoo, florian.vaussard,
thierry.reding, jason, andrew, silvio.fricke, linux-doc,
linux-kernel, devicetree, linux-fbdev
In-Reply-To: <20140807123439.GC29832@distanz.ch>
Thank you for your comments.
I will fix them and resubmit.
On Thu, Aug 07, 2014 at 02:34:39PM +0200, Tobias Klauser wrote:
> On 2014-08-07 at 10:05:38 +0200, Gyungoh Yoo <gyungoh@gmail.com> wrote:
> > Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> > ---
> > Documentation/backlight/sky81452.txt | 25 ++
> > Documentation/devicetree/bindings/mfd/sky81452.txt | 24 ++
> > .../bindings/regulator/sky81452-regulator.txt | 16 +
> > .../devicetree/bindings/vendor-prefixes.txt | 1 +
> > .../video/backlight/sky81452-backlight.txt | 20 ++
> > drivers/mfd/Kconfig | 12 +
> > drivers/mfd/Makefile | 1 +
> > drivers/mfd/sky81452.c | 115 +++++++
> > drivers/regulator/Kconfig | 11 +
> > drivers/regulator/Makefile | 1 +
> > drivers/regulator/sky81452-regulator.c | 127 ++++++++
> > drivers/video/backlight/Kconfig | 10 +
> > drivers/video/backlight/Makefile | 1 +
> > drivers/video/backlight/sky81452-backlight.c | 333 +++++++++++++++++++++
> > include/linux/mfd/sky81452.h | 31 ++
> > include/linux/sky81452-backlight.h | 46 +++
> > 16 files changed, 774 insertions(+)
> > create mode 100644 Documentation/backlight/sky81452.txt
> > create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt
> > create mode 100644 Documentation/devicetree/bindings/regulator/sky81452-regulator.txt
> > create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
> > create mode 100644 drivers/mfd/sky81452.c
> > create mode 100644 drivers/regulator/sky81452-regulator.c
> > create mode 100644 drivers/video/backlight/sky81452-backlight.c
> > create mode 100644 include/linux/mfd/sky81452.h
> > create mode 100644 include/linux/sky81452-backlight.h
>
> [...]
>
> > diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt
> > new file mode 100644
> > index 0000000..18dd6ac
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt
> > @@ -0,0 +1,24 @@
> > +SKY81452 bindings
> > +
> > +Required properties:
> > +- compatible : Must be "sky,sky81452"
> > +
> > +Required child nodes:
> > +- backlight : container node for backlight following the binding
> > + in video/backlight/sky81452-backlight.txt
> > +- regulator : container node for regulators following the binding
> > + in regulator/sky81452-regulator.txt
> > +
> > +Example:
> > +
> > + sky81452@2C {
> > + compatible = "sky,sky81452";
> > +
> > + backlight {
> > + ...
> > + };
> > +
> > + regulator {
> > + ...
> > + };
> > + };
>
> Mixture of tabs and spaces in the example, please use tabs only. Same
> for the example in sky81452-backlight.txt
>
> [...]
>
> > diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c
> > new file mode 100644
> > index 0000000..e09552f
> > --- /dev/null
> > +++ b/drivers/mfd/sky81452.c
> > @@ -0,0 +1,115 @@
>
> [...]
>
> > +static int sky81452_probe(struct i2c_client *client,
> > + const struct i2c_device_id *id)
> > +{
> > + const struct sky81452_platform_data *pdata;
> > + struct device *dev = &client->dev;
> > + struct regmap *map;
> > +
> > +#ifdef CONFIG_OF
> > + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
>
> You still should check the return value in this case.
>
> > +#else
> > + pdata = dev_get_platdata(dev);
> > + if (unlikely(!pdata))
>
> There's usually no need to use unlikely() in driver code, especially not
> in non-critical functions like probe()
>
> > + return -EINVAL;
> > +#endif
> > +
> > + map = devm_regmap_init_i2c(client, &sky81452_config);
> > + if (IS_ERR(map))
> > + return PTR_ERR(map);
> > +
> > + i2c_set_clientdata(client, map);
> > +
> > + return sky81452_register_devices(dev, pdata);
> > +}
> > +
> > +static int sky81452_remove(struct i2c_client *client)
> > +{
> > + mfd_remove_devices(&client->dev);
> > + return 0;
> > +}
> > +
> > +static const struct i2c_device_id sky81452_ids[] = {
> > + {"sky81452", 0},
>
> Space between braces and content please.
>
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(i2c, sky81452_ids);
> > +
> > +#ifdef CONFIG_OF
> > +static const struct of_device_id sky81452_of_match[] = {
> > + {.compatible = "sky,sky81452",},
>
> Space between braces and content.
>
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(of, sky81452_of_match);
> > +#endif
>
> The #ifdefery here is not needed since you use of_match_ptr below, whcih
> will expand to NULL of CONFIG_OF is not set.
>
> > +
> > +static struct i2c_driver sky81452_driver = {
> > + .driver = {
> > + .name = "sky81452",
> > + .owner = THIS_MODULE,
>
> No need to set this here, module_i2c_driver/i2c_register_driver will
> take care of it.
>
> > + .of_match_table = of_match_ptr(sky81452_of_match),
> > + },
> > + .probe = sky81452_probe,
> > + .remove = sky81452_remove,
> > + .id_table = sky81452_ids,
> > +};
> > +
> > +module_i2c_driver(sky81452_driver);
> > +
> > +MODULE_DESCRIPTION("Skyworks SKY81452 MFD driver");
> > +MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@skyworksinc.com>");
> > +MODULE_LICENSE("GPL");
> > +MODULE_VERSION("1.0");
>
> [...]
>
> > diff --git a/drivers/regulator/sky81452-regulator.c b/drivers/regulator/sky81452-regulator.c
> > new file mode 100644
> > index 0000000..15a7c0a
> > --- /dev/null
> > +++ b/drivers/regulator/sky81452-regulator.c
> > @@ -0,0 +1,127 @@
>
> [...]
>
> > +#ifdef CONFIG_OF
> > +static struct regulator_init_data *sky81452_reg_parse_dt(struct device *dev)
> > +{
> > + struct regulator_init_data *init_data;
> > + struct device_node *np;
> > +
> > + np = of_get_child_by_name(dev->parent->of_node, "regulator");
> > + if (unlikely(!np)) {
> > + dev_err(dev, "regulator node not found");
> > + return NULL;
> > + }
> > +
> > + init_data = of_get_regulator_init_data(dev, np);
> > +
> > + of_node_put(np);
> > + return init_data;
> > +}
> > +#endif
> > +
> > +static int sky81452_reg_probe(struct platform_device *pdev)
> > +{
> > + const struct regulator_init_data *init_data;
> > + struct device *dev = &pdev->dev;
> > + struct regulator_config config = { };
> > + struct regulator_dev *rdev;
> > +
> > +#ifdef CONFIG_OF
> > + init_data = sky81452_reg_parse_dt(dev);
> > +#else
> > + init_data = dev_get_platdata(dev);
> > +#endif
>
> Better make the implementation of sky81452_reg_parse_dt dependent on
> CONFIG_OF and just return dev_get_platdata(dev) in case of !CONFIG_OF.
> You could then also rename sky81452_reg_parse_dt to something like
> sky81452_reg_get_init_data.
>
> > + if (unlikely(!init_data))
> > + return -EINVAL;
> > +
> > + config.dev = dev;
> > + config.init_data = init_data;
> > + config.of_node = dev->of_node;
> > + config.regmap = dev_get_drvdata(dev->parent);
> > +
> > + rdev = devm_regulator_register(dev, &sky81452_reg, &config);
> > + if (IS_ERR(rdev))
> > + return PTR_ERR(rdev);
> > +
> > + platform_set_drvdata(pdev, rdev);
> > +
> > + return 0;
> > +}
> > +
> > +static struct platform_driver sky81452_reg_driver = {
> > + .driver = {
> > + .name = "sky81452-regulator",
> > + .owner = THIS_MODULE,
>
> Not needed, this will be set by
> module_platform_driver/platform_driver_register
>
> > + },
> > + .probe = sky81452_reg_probe,
> > +};
> > +
> > +module_platform_driver(sky81452_reg_driver);
> > +
> > +MODULE_DESCRIPTION("Skyworks SKY81452 Regulator driver");
> > +MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@skyworksinc.com>");
> > +MODULE_LICENSE("GPL");
> > +MODULE_VERSION("1.0");
>
> [...]
>
> > diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c
> > new file mode 100644
> > index 0000000..1eb5706
> > --- /dev/null
> > +++ b/drivers/video/backlight/sky81452-backlight.c
> > @@ -0,0 +1,333 @@
>
> [...]
>
> > +#ifdef CONFIG_OF
> > +static struct sky81452_bl_platform_data *sky81452_bl_parse_dt
> > + (struct device *dev)
> > +{
> > + struct device_node *np = dev->parent->of_node;
> > + struct sky81452_bl_platform_data *pdata;
> > + int ret;
> > +
> > + np = of_get_child_by_name(dev->parent->of_node, "backlight");
> > + if (unlikely(!np)) {
> > + dev_err(dev, "backlight node not found");
> > + return ERR_PTR(-EINVAL);
> > + }
> > +
> > + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> > + if (unlikely(!pdata)) {
> > + of_node_put(np);
> > + return ERR_PTR(-ENOMEM);
> > + }
> > +
> > + of_property_read_string(np, "name", &pdata->name);
> > + pdata->ignore_pwm = of_property_read_bool(np, "ignore-pwm");
> > + pdata->dpwm_mode = of_property_read_bool(np, "dpwm-mode");
> > + pdata->phase_shift = of_property_read_bool(np, "phase-shift");
> > +
> > + pdata->gpio_enable = of_get_named_gpio(np, "gpio-enable", 0);
> > + if (IS_ERR_VALUE(pdata->gpio_enable))
> > + pdata->gpio_enable = -1;
> > +
> > + ret = of_property_read_u32(np, "enable", &pdata->enable);
> > + if (IS_ERR_VALUE(ret))
> > + pdata->enable = SKY81452_EN >> CTZ(SKY81452_EN);
> > +
> > + ret = of_property_read_u32(np, "short-detection-threshold",
> > + &pdata->short_detection_threshold);
> > + if (IS_ERR_VALUE(ret))
> > + pdata->short_detection_threshold = 7;
> > +
> > + ret = of_property_read_u32(np, "boost-current-limit",
> > + &pdata->boost_current_limit);
> > + if (IS_ERR_VALUE(ret))
> > + pdata->boost_current_limit = 2750;
> > +
> > + of_node_put(np);
> > + return pdata;
> > +}
> > +#endif
> > +
> > +static int sky81452_bl_init_device(struct regmap *map,
> > + struct sky81452_bl_platform_data *pdata)
> > +{
> > + unsigned int value;
> > +
> > + value = pdata->ignore_pwm ? SKY81452_IGPW : 0;
> > + value |= pdata->dpwm_mode ? SKY81452_PWMMD : 0;
> > + value |= pdata->phase_shift ? 0 : SKY81452_PHASE;
> > +
> > + if (pdata->boost_current_limit = 2300)
> > + value |= SKY81452_ILIM;
> > + else if (pdata->boost_current_limit != 2720)
> > + return -EINVAL;
> > +
> > + if (pdata->short_detection_threshold < 4 ||
> > + pdata->short_detection_threshold > 7)
> > + return -EINVAL;
> > + value |= (7 - pdata->short_detection_threshold) << CTZ(SKY81452_VSHRT);
> > +
> > + return regmap_write(map, SKY81452_REG2, value);
> > +}
> > +
> > +static int sky81452_bl_probe(struct platform_device *pdev)
> > +{
> > + struct device *dev = &pdev->dev;
> > + struct regmap *map = dev_get_drvdata(dev->parent);
> > + struct sky81452_bl_platform_data *pdata;
> > + struct backlight_device *bd;
> > + struct backlight_properties props;
> > + const char *name;
> > + int ret;
> > +
> > +#ifdef CONFIG_OF
> > + pdata = sky81452_bl_parse_dt(dev);
> > + if (IS_ERR(pdata))
> > + return PTR_ERR(pdata);
> > + dev->platform_data = pdata;
> > +#else
> > + pdata = dev_get_platdata(dev);
> > + if (unlikely(!pdata))
>
> No need to use unlikely() here.
>
> > + return -EINVAL;
> > +#endif
>
> Instead of the #ifdefery here, better define a function
> sky81452_get_pdata() dependent on CONFIG_OF which will return the right
> thing (i.e. what sky81452_bl_parse_dt currently does if CONFIG_OF is
> defined and dev_get_platdata or ERR_PTR(-EINVAL) if it is not
> defined). Then you could just do:
>
> pdata = skysky81452_get_pdata(dev);
> if (IS_ERR(pdata))
> return PTR_ERR(pdata);
>
> > +
> > + if (pdata->gpio_enable >= 0) {
> > + ret = devm_gpio_request_one(dev, pdata->gpio_enable,
> > + GPIOF_OUT_INIT_HIGH, "sky81452-en");
> > + if (IS_ERR_VALUE(ret))
> > + return ret;
> > + }
> > +
> > + ret = sky81452_bl_init_device(map, pdata);
> > + if (IS_ERR_VALUE(ret))
> > + return ret;
> > +
> > + memset(&props, 0, sizeof(props));
> > + props.max_brightness = SKY81452_MAX_BRIGHTNESS,
> > + name = pdata->name ? pdata->name : SKY81452_DEFAULT_NAME;
> > + bd = devm_backlight_device_register(dev, name,
> > + dev, map, &sky81452_bl_ops, &props);
> > + if (IS_ERR(bd))
> > + return PTR_ERR(bd);
> > +
> > + platform_set_drvdata(pdev, bd);
> > +
> > + ret = sysfs_create_group(&bd->dev.kobj, &sky81452_bl_attr_group);
> > + if (IS_ERR_VALUE(ret))
> > + goto err;
> > +
> > + return ret;
> > +err:
> > + backlight_device_unregister(bd);
> > + return ret;
> > +}
> > +
> > +static int sky81452_bl_remove(struct platform_device *pdev)
> > +{
> > + const struct sky81452_bl_platform_data *pdata > > + dev_get_platdata(&pdev->dev);
> > + struct backlight_device *bd = platform_get_drvdata(pdev);
> > +
> > + sysfs_remove_group(&bd->dev.kobj, &sky81452_bl_attr_group);
> > +
> > + bd->props.power = FB_BLANK_UNBLANK;
> > + bd->props.brightness = 0;
> > + backlight_update_status(bd);
> > +
> > + if (pdata->gpio_enable >= 0)
> > + gpio_set_value_cansleep(pdata->gpio_enable, 0);
> > +
> > + return 0;
> > +}
> > +
> > +static struct platform_driver sky81452_bl_driver = {
> > + .driver = {
> > + .name = "sky81452-bl",
> > + .owner = THIS_MODULE,
>
> module_platform_driver/platform_driver_register take care of this.
>
> > + },
> > + .probe = sky81452_bl_probe,
> > + .remove = sky81452_bl_remove,
> > +};
> > +
> > +module_platform_driver(sky81452_bl_driver);
> > +
> > +MODULE_DESCRIPTION("Skyworks SKY81452 backlight driver");
> > +MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@skyworksinc.com>");
> > +MODULE_LICENSE("GPL");
> > +MODULE_VERSION("1.0");
^ permalink raw reply
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