nand gpmc - overriden values in kernel

2014-10-14 Thread Ran Shalit
Hello,

In omap2_nand_gpmc_retime() the kernel override the gpmc cs
configuration with other values. It resulted in failure of nand
detection in some boards.
Is there any reason for the override of gpmc cs values ?

Thanks,
Ran
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: RCU bug with v3.17-rc3 ?

2014-10-14 Thread Peter Hurley
On 10/13/2014 10:06 PM, Greg KH wrote:
 On Mon, Oct 13, 2014 at 12:43:07PM +0100, Russell King - ARM Linux wrote:
 On Mon, Oct 13, 2014 at 09:11:34AM +, David Laight wrote:
 From: Nathan Lynch
 On 10/10/2014 11:25 AM, Russell King - ARM Linux wrote:

 Right, so GCC 4.8.{1,2} are totally unsuitable for kernel building (and
 it seems that this has been known about for some time.)

 Looking at http://gcc.gnu.org/PR58854 it seems that all 4.8.x for x  3
 are affected, as well as 4.9.0.

 We can blacklist these GCC versions quite easily.  We already have GCC
 3.3 blacklisted, and it's trivial to add others.  I would want to include
 some proper details about the bug, just like the other existing entries
 we already have in asm-offsets.c, where we name the functions that the
 compiler is known to break where appropriate.

 Before blacklisting anything, it's worth considering that simple version
 checks would break existing pre-4.8.3 compilers that have been patched
 for PR58854.  It looks like Yocto and Buildroot issued releases with
 patched 4.8.2 compilers well before the (fixed) 4.8.3 release.  I think
 the most we can reasonably do without breaking some correctly-behaving
 toolchains is to emit a warning.

 Is it possible to compile a small code fragment and check the generated
 code for the bug?
 Possibly predicated on the broken version number to avoid false positives.

 I don't see how - it looks like it requires an interrupt to occur at an
 opportune moment to provoke the function to fail.  The alternative would
 be to parse the assembly generated by the compiler to determine how it
 is dealing with the stack.

 I think the only viable solution here is that:

 1. We blacklist the bad compiler versions outright in the kernel.
 
 Yes, please do this, it's what we have done for other buggy compiler
 versions, no need to do something different here.
 
 Remember, it's the distro's choice to fix these buggy compilers, so the
 onus is on _them_ to deal with the mess they've created by doing so.
 
 I totally agree.
 
 Is someone going to send this patch, or do I have to write it myself?

I did on Friday (arm: Blacklist gcc 4.8.[012] ...) but Russell said he
was doing it himself.

Regards,
Peter Hurley

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


omap USB_DPLL not configured as per manual

2014-10-14 Thread Roger Quadros
Hi Tero,

The USB_DPLL doesn't have recommended M/N settings as per the TRM [1]
Thus the omapconf audit fails.

Any ideas of how we can fix this up? Should we add a new clock.ops structure for
USB_DPLL to make sure that we don't violate the TRM recommended settings?
or should we just add some flags in dpll_data? We would need a new compatible 
id for sure.

[1] - OMAP4460_ES1.x_NDA_TRM_vP.pdf - 3.6.3.9.5 DPLL_USB Preferred Settings

panda4460 omapconf audit dpll -d usb
|-|
| DPLL_USB AUDIT (@OPP OPP100, sysclk=38.4MHz) | Current Setting | Expected  | 
STATUS |
|-|
| Status   | Locked  | Locked| 
Pass   |
| Mode | Lock| Lock  | 
Pass   |
| Autoidle Mode| Auto LPST   | Auto LPST | 
Pass   |
| Low-Power Mode   | Disabled| Disabled  | 
Pass   |
| REGM4XEN Mode| Disabled| Disabled  | 
Pass   |
| DCC Mode | Disabled| Disabled  | 
Pass   |
| M Divider| 25  | 400   | 
FAIL   |
| N Divider| 0   | 15| 
FAIL   |
| Lock Frequency   | 960.0MHz| 960.0MHz  | 
Pass   |
| M2 Divider   | 2   | 2 | 
Pass   |
| CLKOUT Output Rate   | 480.0MHz| 480.0MHz  | 
Pass   |
| CLKDCOLDO Output Rate| 960.0MHz| 960.0MHz  | 
Pass   |
|-|

cheers,
-roger
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2] CLK: TI: Remove unused includes of linux/clk-private.h

2014-10-14 Thread Tomeu Vizoso
Because they are unused, and there's plans to remove that header in the near
future.

Signed-off-by: Tomeu Vizoso tomeu.viz...@collabora.com

---

v2: * Add rationale to commit message
* Include clk-provider.h in each file that uses it, instead of in
  clk/ti.h
---
 drivers/clk/ti/clk-44xx.c | 2 +-
 drivers/clk/ti/clk-54xx.c | 2 +-
 drivers/clk/ti/clk-7xx.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/ti/clk-44xx.c b/drivers/clk/ti/clk-44xx.c
index 02517a8..3694615 100644
--- a/drivers/clk/ti/clk-44xx.c
+++ b/drivers/clk/ti/clk-44xx.c
@@ -12,7 +12,7 @@
 
 #include linux/kernel.h
 #include linux/list.h
-#include linux/clk-private.h
+#include linux/clk-provider.h
 #include linux/clkdev.h
 #include linux/clk/ti.h
 
diff --git a/drivers/clk/ti/clk-54xx.c b/drivers/clk/ti/clk-54xx.c
index 5e18399..19c4fac 100644
--- a/drivers/clk/ti/clk-54xx.c
+++ b/drivers/clk/ti/clk-54xx.c
@@ -12,7 +12,7 @@
 
 #include linux/kernel.h
 #include linux/list.h
-#include linux/clk-private.h
+#include linux/clk-provider.h
 #include linux/clkdev.h
 #include linux/io.h
 #include linux/clk/ti.h
diff --git a/drivers/clk/ti/clk-7xx.c b/drivers/clk/ti/clk-7xx.c
index 62ac8f6..853d9ae 100644
--- a/drivers/clk/ti/clk-7xx.c
+++ b/drivers/clk/ti/clk-7xx.c
@@ -12,7 +12,7 @@
 
 #include linux/kernel.h
 #include linux/list.h
-#include linux/clk-private.h
+#include linux/clk-provider.h
 #include linux/clkdev.h
 #include linux/clk/ti.h
 
-- 
1.9.3

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


cpuidle vs suspend/resume

2014-10-14 Thread Ran Shalit
Hello,

I am trying to understand the relation between HW PWM, and the linux
mechanism (cpuidle and suspend/resume). If you are familiar with the
relations between the 2 I wil appreciate your comments.

For example, are the wakeup source relevant for changing the cpu state
or do they trigger change only if suspend/resume mechanism is used ?
Is the c-state (which is changed by the cpuidle mechanism) relevant
for the state of the cpu only (without the peripheral devices) ?

Thanks,
Ran
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v6 01/18] OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value

2014-10-14 Thread Jyri Sarha
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 jsa...@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

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


[PATCH v6 00/18] Rework OMAP4+ HDMI audio support

2014-10-14 Thread Jyri Sarha
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:
https://github.com/jsarha/linux.git

It would make the most sense to get these in trough fbdev tree. So it
would be nice to get acked-bys (if the patches are Ok) for ASoC side
changes from appropriate maintainers.

Changes since v5:
Still lot of changes, most of them were suggested by Tomi
Valkeinen. The most significant changes:
- Fix HDMI unplugging crashes when playing audio etc.
- Don't use simple-card but implement bare minimum ASoC card under pdev
- Register cpu-dai under OMAPDSS HDMI device and get dai drvdata
  trough card drvdata via snd_pcm_substream
- Some more cleaning up

Changes since v4:
- Turn ASoC parts into a platform device driver
- Some cleaning up
- reorder the patches to keep bisect working

Changes since v3:
- Move ASoC parts into library module under sound/soc/omap
- Come up with API for the library 
- Some cleaning up

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, these patches implement a platform device driver under
sound/soc/omap for ASoC side implementation. This driver should only
be registered from OMAPDSS HDMI code. 

The ASoC side driver implements cpu-dai component using the callbacks
provided by OMAPDSS and registers the component under DSS HDMI
device. Omap-pcm is registered for platform component, dummy
hdmi-audio-codec is registered for codec component, and ASoC driver
implements also a bare minimum card driver and registeres it under
itself.

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

  OMAPDSS: hdmi.h: Add HDMI_AUDIO_LAYOUT_6CH enum value
  OMAPDSS: hdmi: Remove most of OMAP[45]_DSS_HDMI_AUDIO ifdefs
  OMAPDSS: hdmi4_core: Remove unused hdmi4_audio_get_dma_port()
  OMAPDSS: hdmi_wp: Add function for getting audio dma address
  OMAPDSS: hdmi: Make hdmi structure public
  OMAPDSS: hdmi: Add pdev pointer for audio_pdev in HDMI DRV data
  ASoC: codecs/hdmi: Mark the maximum significant bits to HDMI codec
  ASoC: codecs/hdmi: HDMI codec doesn't benefit from pmdown delay
  ASoC: omap-hdmi-audio: Add platfrom device for OMAP HDMI audio
support
  OMAPDSS: Kconfig: Remove HDMI audio booleans from Kconfig
  OMAPDSS: hdmi: Make hdmi_mode_has_audio() more user friedly
  OMAPDSS: hdmi.h: Add members to hdmi drvdata for audio implementation
  OMAPDSS: hdmi4: Remove callbacks for the old ASoC DAI driver
  OMAPDSS: hdmi4: Register ASoC platfrom device for omap hdmi audio
  OMAPDSS: hdmi5: Remove callbacks for the old ASoC DAI driver
  OMAPDSS: hdmi5: Register ASoC platfrom device for omap hdmi audio
  ASoC: omap: Remove obsolete HDMI audio code and Kconfig options
  OMAPDSS: Remove all references to obsolete HDMI audio callbacks

 .../fbdev/omap2/displays-new/connector-hdmi.c  |   99 -
 .../fbdev/omap2/displays-new/encoder-tpd12s015.c   |   56 ---
 drivers/video/fbdev/omap2/dss/Kconfig  |7 -
 drivers/video/fbdev/omap2/dss/hdmi.h   |   37 +-
 drivers/video/fbdev/omap2/dss/hdmi4.c  |  268 ++---
 drivers/video/fbdev/omap2/dss/hdmi4_core.c |   14 -
 drivers/video/fbdev/omap2/dss/hdmi4_core.h |4 -
 drivers/video/fbdev/omap2/dss/hdmi5.c  |  257 ++--
 drivers/video/fbdev/omap2/dss/hdmi5_core.c |6 -
 drivers/video/fbdev/omap2/dss/hdmi5_core.h |2 -
 drivers/video/fbdev/omap2/dss/hdmi_common.c|2 -
 drivers/video/fbdev/omap2/dss/hdmi_wp.c|8 +-
 include/sound/omap-hdmi-audio.h|   43 ++
 include/video/omapdss.h|   31 --
 sound/soc/codecs/hdmi.c|2 +
 sound/soc/omap/Kconfig |   21 +-
 sound/soc/omap/Makefile|6 +-
 sound/soc/omap/omap-hdmi-audio.c   |  420 
 sound/soc/omap/omap-hdmi-card.c|   87 
 sound/soc/omap/omap-hdmi.c |  364 -
 sound/soc/omap/omap-hdmi.h |   38 --
 21 files changed, 772 insertions(+), 1000 deletions(-)
 create mode 100644 include/sound/omap-hdmi-audio.h
 create mode 100644 sound/soc/omap/omap-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

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More 

[PATCH v6 10/18] OMAPDSS: Kconfig: Remove HDMI audio booleans from Kconfig

2014-10-14 Thread Jyri Sarha
The booleans are not used anymore. Just select SND_OMAP_SOC_HDMI_AUDIO
to enable OMAP HDMI audio support.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 drivers/video/fbdev/omap2/dss/Kconfig |7 ---
 1 file changed, 7 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/Kconfig 
b/drivers/video/fbdev/omap2/dss/Kconfig
index 3d5eb6c..d1fa730 100644
--- a/drivers/video/fbdev/omap2/dss/Kconfig
+++ b/drivers/video/fbdev/omap2/dss/Kconfig
@@ -74,9 +74,6 @@ config OMAP4_DSS_HDMI
help
  HDMI support for OMAP4 based SoCs.
 
-config OMAP4_DSS_HDMI_AUDIO
-   bool
-
 config OMAP5_DSS_HDMI
bool HDMI support for OMAP5
default n
@@ -86,10 +83,6 @@ config OMAP5_DSS_HDMI
  Definition Multimedia Interface. See http://www.hdmi.org/ for HDMI
  specification.
 
-config OMAP5_DSS_HDMI_AUDIO
-   depends on OMAP5_DSS_HDMI
-   bool
-
 config OMAP2_DSS_SDI
bool SDI support
 default n
-- 
1.7.9.5

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


[PATCH v6 13/18] OMAPDSS: hdmi4: Remove callbacks for the old ASoC DAI driver

2014-10-14 Thread Jyri Sarha
Removes the OMAP4 HDMI audio callbacks for the old external DAI driver.

Signed-off-by: Jyri Sarha jsa...@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 b98186e..4c671ee 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -468,112 +468,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)
 {
@@ -602,13 +496,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

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


[PATCH v6 09/18] ASoC: omap-hdmi-audio: Add platfrom device for OMAP HDMI audio support

2014-10-14 Thread Jyri Sarha
The platform device should only be registered from OMAPDSS HDMI
driver. The platfrom driver registers and unregisters all ASoC
components needed for OMAP HDMI audio.

The hdmi audio driver implements cpu-dai component using the callbacks
provided by OMAPDSS and registers the component under DSS HDMI
device. Omap-pcm is registered for platform component also under DSS
HDMI device. Dummy hdmi-audio-codec is registered for codec component.
The hdmi audio driver implement also the card component and registers
it under its own platform device.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 include/sound/omap-hdmi-audio.h  |   43 
 sound/soc/omap/Kconfig   |   10 +
 sound/soc/omap/Makefile  |2 +
 sound/soc/omap/omap-hdmi-audio.c |  420 ++
 4 files changed, 475 insertions(+)
 create mode 100644 include/sound/omap-hdmi-audio.h
 create mode 100644 sound/soc/omap/omap-hdmi-audio.c

diff --git a/include/sound/omap-hdmi-audio.h b/include/sound/omap-hdmi-audio.h
new file mode 100644
index 000..afdb416
--- /dev/null
+++ b/include/sound/omap-hdmi-audio.h
@@ -0,0 +1,43 @@
+/*
+ * hdmi-audio.c -- OMAP4+ DSS HDMI audio support library
+ *
+ * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * Author: Jyri Sarha jsa...@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 video/omapdss.h
+
+#ifndef __OMAP_HDMI_AUDIO_H__
+#define __OMAP_HDMI_AUDIO_H__
+
+struct omap_hdmi_audio_ops {
+   int (*audio_startup)(struct device *dev,
+void (*abort_cb)(struct device *dev));
+   int (*audio_shutdown)(struct device *dev);
+   int (*audio_start)(struct device *dev);
+   void (*audio_stop)(struct device *dev);
+   int (*audio_config)(struct device *dev,
+   struct omap_dss_audio *dss_audio);
+};
+
+/* HDMI audio initalization data */
+struct omap_hdmi_audio_pdata {
+   struct device *dev;
+   enum omapdss_version dss_version;
+   phys_addr_t audio_dma_addr;
+
+   const struct omap_hdmi_audio_ops *ops;
+};
+
+#endif /* __OMAP_HDMI_AUDIO_H__ */
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
index d44463a..511fa1a 100644
--- a/sound/soc/omap/Kconfig
+++ b/sound/soc/omap/Kconfig
@@ -15,6 +15,16 @@ config SND_OMAP_SOC_MCPDM
 config SND_OMAP_SOC_HDMI
tristate
 
+config SND_OMAP_SOC_HDMI_AUDIO
+   tristate HDMI audio support for OMAP4+ based SoCs
+   depends on SND_OMAP_SOC
+   select SND_SOC_HDMI_CODEC
+   help
+ The driver implements an integrated ASoC Digital Audio
+ Interface component driver and registers a dummy HDMI codec
+ and asoc-simple-card for full HDMI audio support. OMAPDSS
+ HDMI video needs to be enabled too for working HDMI audio.
+
 config SND_OMAP_SOC_N810
tristate SoC Audio support for Nokia N810
depends on SND_OMAP_SOC  MACH_NOKIA_N810  I2C
diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
index a725905..40688a6 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -4,12 +4,14 @@ 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
+snd-soc-omap-hdmi-audio-objs := omap-hdmi-audio.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
+obj-$(CONFIG_SND_OMAP_SOC_HDMI_AUDIO) += snd-soc-omap-hdmi-audio.o
 
 # OMAP Machine Support
 snd-soc-n810-objs := n810.o
diff --git a/sound/soc/omap/omap-hdmi-audio.c b/sound/soc/omap/omap-hdmi-audio.c
new file mode 100644
index 000..5a2abd8
--- /dev/null
+++ b/sound/soc/omap/omap-hdmi-audio.c
@@ -0,0 +1,420 @@
+/*
+ * omap-hdmi-audio.c -- OMAP4+ DSS HDMI audio support library
+ *
+ * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com
+ *
+ * Author: Jyri Sarha jsa...@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 

[PATCH v6 14/18] OMAPDSS: hdmi4: Register ASoC platfrom device for omap hdmi audio

2014-10-14 Thread Jyri Sarha
Implements callbacks for OMAP HDMI audio platform driver and registers
it in probe function. Unregistering is done in remove function.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 drivers/video/fbdev/omap2/dss/hdmi4.c |  124 +
 1 file changed, 124 insertions(+)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi4.c 
b/drivers/video/fbdev/omap2/dss/hdmi4.c
index 4c671ee..fbb17b3 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4.c
@@ -33,6 +33,7 @@
 #include linux/gpio.h
 #include linux/regulator/consumer.h
 #include video/omapdss.h
+#include sound/omap-hdmi-audio.h
 
 #include hdmi4_core.h
 #include dss.h
@@ -336,6 +337,8 @@ static int hdmi_display_enable(struct omap_dss_device 
*dssdev)
goto err0;
}
 
+   hdmi.display_enabled = true;
+
mutex_unlock(hdmi.lock);
return 0;
 
@@ -350,8 +353,13 @@ static void hdmi_display_disable(struct omap_dss_device 
*dssdev)
 
mutex_lock(hdmi.lock);
 
+   if (hdmi.audio_pdev  hdmi.audio_abort_cb)
+   hdmi.audio_abort_cb(hdmi.audio_pdev-dev);
+
hdmi_power_off_full(dssdev);
 
+   hdmi.display_enabled = false;
+
mutex_unlock(hdmi.lock);
 }
 
@@ -542,6 +550,111 @@ err:
return r;
 }
 
+/* Audio callbacks */
+static int hdmi_audio_startup(struct device *dev,
+ void (*abort_cb)(struct device *dev))
+{
+   struct omap_hdmi *hd = dev_get_drvdata(dev);
+   int ret = 0;
+
+   mutex_lock(hd-lock);
+
+   if (!hdmi_mode_has_audio(hd-cfg) || !hd-display_enabled) {
+   ret = -EPERM;
+   goto out;
+   }
+
+   hd-audio_abort_cb = abort_cb;
+
+out:
+   mutex_unlock(hd-lock);
+
+   return ret;
+}
+
+static int hdmi_audio_shutdown(struct device *dev)
+{
+   struct omap_hdmi *hd = dev_get_drvdata(dev);
+
+   mutex_lock(hd-lock);
+   hd-audio_abort_cb = NULL;
+   mutex_unlock(hd-lock);
+
+   return 0;
+}
+
+static int hdmi_audio_start(struct device *dev)
+{
+   struct omap_hdmi *hd = dev_get_drvdata(dev);
+
+   WARN_ON(!hdmi_mode_has_audio(hd-cfg));
+   WARN_ON(!hd-display_enabled);
+
+   hdmi_wp_audio_enable(hd-wp, true);
+   hdmi4_audio_start(hd-core, hd-wp);
+
+   return 0;
+}
+
+static void hdmi_audio_stop(struct device *dev)
+{
+   struct omap_hdmi *hd = dev_get_drvdata(dev);
+
+   WARN_ON(!hdmi_mode_has_audio(hd-cfg));
+   WARN_ON(!hd-display_enabled);
+
+   hdmi4_audio_stop(hd-core, hd-wp);
+   hdmi_wp_audio_enable(hd-wp, false);
+}
+
+static int hdmi_audio_config(struct device *dev,
+struct omap_dss_audio *dss_audio)
+{
+   struct omap_hdmi *hd = dev_get_drvdata(dev);
+   int ret;
+
+   mutex_lock(hd-lock);
+
+   if (!hdmi_mode_has_audio(hd-cfg) || !hd-display_enabled) {
+   ret = -EPERM;
+   goto out;
+   }
+
+   ret = hdmi4_audio_config(hd-core, hd-wp, dss_audio,
+hd-cfg.timings.pixelclock);
+
+out:
+   mutex_unlock(hd-lock);
+
+   return ret;
+}
+
+static const struct omap_hdmi_audio_ops hdmi_audio_ops = {
+   .audio_startup = hdmi_audio_startup,
+   .audio_shutdown = hdmi_audio_shutdown,
+   .audio_start = hdmi_audio_start,
+   .audio_stop = hdmi_audio_stop,
+   .audio_config = hdmi_audio_config,
+};
+
+static int hdmi_audio_register(struct device *dev)
+{
+   struct omap_hdmi_audio_pdata pdata = {
+   .dev = dev,
+   .dss_version = omapdss_get_version(),
+   .audio_dma_addr = hdmi_wp_get_audio_dma_addr(hdmi.wp),
+   .ops = hdmi_audio_ops,
+   };
+
+   hdmi.audio_pdev =
+   platform_device_register_data(dev, omap-hdmi-audio, 0,
+ pdata, sizeof(pdata));
+   if (IS_ERR(hdmi.audio_pdev))
+   return PTR_ERR(hdmi.audio_pdev);
+
+   return 0;
+}
+
 /* HDMI HW IP initialisation */
 static int omapdss_hdmihw_probe(struct platform_device *pdev)
 {
@@ -599,6 +712,14 @@ static int omapdss_hdmihw_probe(struct platform_device 
*pdev)
 
hdmi_init_output(pdev);
 
+   r = hdmi_audio_register(pdev-dev);
+   if (r) {
+   DSSERR(Registering HDMI audio failed\n);
+   hdmi_uninit_output(pdev);
+   pm_runtime_disable(pdev-dev);
+   return r;
+   }
+
dss_debugfs_create_file(hdmi, hdmi_dump_regs);
 
return 0;
@@ -606,6 +727,9 @@ static int omapdss_hdmihw_probe(struct platform_device 
*pdev)
 
 static int __exit omapdss_hdmihw_remove(struct platform_device *pdev)
 {
+   if (hdmi.audio_pdev)
+   platform_device_unregister(hdmi.audio_pdev);
+
hdmi_uninit_output(pdev);
 
pm_runtime_disable(pdev-dev);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to 

[PATCH v6 07/18] ASoC: codecs/hdmi: Mark the maximum significant bits to HDMI codec

2014-10-14 Thread Jyri Sarha
HDMI audio can not have more than 24 bits even if on i2s bus there
would be 32 bit samples. Mark this by adding .sig_bits = 24 to
playback stream definition.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 sound/soc/codecs/hdmi.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/hdmi.c b/sound/soc/codecs/hdmi.c
index 1087fd5..2a52b90 100644
--- a/sound/soc/codecs/hdmi.c
+++ b/sound/soc/codecs/hdmi.c
@@ -47,6 +47,7 @@ static struct snd_soc_dai_driver hdmi_codec_dai = {
SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,
.formats = SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE,
+   .sig_bits = 24,
},
.capture = {
.stream_name = Capture,
-- 
1.7.9.5

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


[PATCH v6 05/18] OMAPDSS: hdmi: Make hdmi structure public

2014-10-14 Thread Jyri Sarha
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 jsa...@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 9ba7c1a..6bf077b 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -349,4 +349,25 @@ 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_datapll;
+   struct hdmi_phy_dataphy;
+   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
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_datapll;
-   struct hdmi_phy_dataphy;
-   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_datapll;
-   struct hdmi_phy_dataphy;
-   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

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


[PATCH v6 06/18] OMAPDSS: hdmi: Add pdev pointer for audio_pdev in HDMI DRV data

2014-10-14 Thread Jyri Sarha
This is used to store omap-hdmi-audio pdev for unregistering it.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 drivers/video/fbdev/omap2/dss/hdmi.h |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h 
b/drivers/video/fbdev/omap2/dss/hdmi.h
index 6bf077b..a6e08ff 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -368,6 +368,8 @@ struct omap_hdmi {
bool core_enabled;
 
struct omap_dss_device output;
+
+   struct platform_device *audio_pdev;
 };
 
 #endif
-- 
1.7.9.5

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


[PATCH v6 15/18] OMAPDSS: hdmi5: Remove callbacks for the old ASoC DAI driver

2014-10-14 Thread Jyri Sarha
Removes the OMAP5 HDMI audio callbacks for the old external DAI driver.

Signed-off-by: Jyri Sarha jsa...@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 90410f5..97363b7 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -492,112 +492,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)
 {
@@ -626,13 +520,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

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


[PATCH v6 17/18] ASoC: omap: Remove obsolete HDMI audio code and Kconfig options

2014-10-14 Thread Jyri Sarha
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 jsa...@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 511fa1a..887da2b 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_HDMI_AUDIO
tristate HDMI audio support for OMAP4+ based SoCs
depends on SND_OMAP_SOC
@@ -110,16 +107,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 40688a6..db36fbd 100644
--- a/sound/soc/omap/Makefile
+++ b/sound/soc/omap/Makefile
@@ -3,14 +3,12 @@ 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
 snd-soc-omap-hdmi-audio-objs := omap-hdmi-audio.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
 obj-$(CONFIG_SND_OMAP_SOC_HDMI_AUDIO) += snd-soc-omap-hdmi-audio.o
 
 # OMAP Machine Support
@@ -22,7 +20,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
@@ -32,4 +29,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..000
--- 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.n...@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 

[PATCH v6 11/18] OMAPDSS: hdmi: Make hdmi_mode_has_audio() more user friedly

2014-10-14 Thread Jyri Sarha
Signed-off-by: Jyri Sarha jsa...@ti.com
---
 drivers/video/fbdev/omap2/dss/hdmi.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h 
b/drivers/video/fbdev/omap2/dss/hdmi.h
index a6e08ff..6d129f2 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -345,9 +345,9 @@ 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 */
-- 
1.7.9.5

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


[PATCH v6 18/18] OMAPDSS: Remove all references to obsolete HDMI audio callbacks

2014-10-14 Thread Jyri Sarha
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 jsa...@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 

[PATCH v6 12/18] OMAPDSS: hdmi.h: Add members to hdmi drvdata for audio implementation

2014-10-14 Thread Jyri Sarha
Adds display_enabled flag and audio_abort_cb callback to struct hdmi.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 drivers/video/fbdev/omap2/dss/hdmi.h |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h 
b/drivers/video/fbdev/omap2/dss/hdmi.h
index 6d129f2..bfaaf2f 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -366,10 +366,12 @@ struct omap_hdmi {
struct regulator *vdda_reg;
 
bool core_enabled;
+   bool display_enabled;
 
struct omap_dss_device output;
 
struct platform_device *audio_pdev;
+   void (*audio_abort_cb)(struct device *dev);
 };
 
 #endif
-- 
1.7.9.5

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


[PATCH v6 02/18] OMAPDSS: hdmi: Remove most of OMAP[45]_DSS_HDMI_AUDIO ifdefs

2014-10-14 Thread Jyri Sarha
It does not waste too many bytes to compile all audio related core
functions always in with HDMI support. It should help readability and
in keeping the audio code in working shape. Leave the options just for
disabling and enabling the functionality in hdmi[45].c.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 drivers/video/fbdev/omap2/dss/hdmi.h|3 +--
 drivers/video/fbdev/omap2/dss/hdmi4_core.c  |5 -
 drivers/video/fbdev/omap2/dss/hdmi4_core.h  |2 --
 drivers/video/fbdev/omap2/dss/hdmi5_core.c  |6 --
 drivers/video/fbdev/omap2/dss/hdmi5_core.h  |2 --
 drivers/video/fbdev/omap2/dss/hdmi_common.c |2 --
 drivers/video/fbdev/omap2/dss/hdmi_wp.c |2 --
 7 files changed, 1 insertion(+), 21 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi.h 
b/drivers/video/fbdev/omap2/dss/hdmi.h
index 1f01068..03726b5 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi.h
@@ -335,7 +335,7 @@ 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)
+/* Audio funcs */
 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);
@@ -348,4 +348,3 @@ static inline bool hdmi_mode_has_audio(int mode)
return mode == HDMI_HDMI ? true : false;
 }
 #endif
-#endif
diff --git a/drivers/video/fbdev/omap2/dss/hdmi4_core.c 
b/drivers/video/fbdev/omap2/dss/hdmi4_core.c
index 4ad39cf..3b448d9 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4_core.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4_core.c
@@ -31,10 +31,8 @@
 #include linux/platform_device.h
 #include linux/string.h
 #include linux/seq_file.h
-#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
 #include sound/asound.h
 #include sound/asoundef.h
-#endif
 
 #include hdmi4_core.h
 #include dss_features.h
@@ -530,7 +528,6 @@ void hdmi4_core_dump(struct hdmi_core_data *core, struct 
seq_file *s)
DUMPCOREAV(HDMI_CORE_AV_CEC_ADDR_ID);
 }
 
-#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
 static void hdmi_core_audio_config(struct hdmi_core_data *core,
struct hdmi_core_audio_config *cfg)
 {
@@ -886,8 +883,6 @@ int hdmi4_audio_get_dma_port(u32 *offset, u32 *size)
return 0;
 }
 
-#endif
-
 int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core)
 {
struct resource *res;
diff --git a/drivers/video/fbdev/omap2/dss/hdmi4_core.h 
b/drivers/video/fbdev/omap2/dss/hdmi4_core.h
index 827909e..c1959f7 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4_core.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi4_core.h
@@ -266,12 +266,10 @@ void hdmi4_configure(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
 void hdmi4_core_dump(struct hdmi_core_data *core, struct seq_file *s);
 int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core);
 
-#if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO)
 int hdmi4_audio_start(struct hdmi_core_data *core, struct hdmi_wp_data *wp);
 void hdmi4_audio_stop(struct hdmi_core_data *core, struct hdmi_wp_data *wp);
 int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
struct omap_dss_audio *audio, u32 pclk);
 int hdmi4_audio_get_dma_port(u32 *offset, u32 *size);
-#endif
 
 #endif
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5_core.c 
b/drivers/video/fbdev/omap2/dss/hdmi5_core.c
index 83acbf7..8eab25b 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5_core.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5_core.c
@@ -30,10 +30,8 @@
 #include linux/string.h
 #include linux/seq_file.h
 #include drm/drm_edid.h
-#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
 #include sound/asound.h
 #include sound/asoundef.h
-#endif
 
 #include hdmi5_core.h
 
@@ -644,9 +642,6 @@ void hdmi5_configure(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
hdmi_core_enable_interrupts(core);
 }
 
-
-#if defined(CONFIG_OMAP5_DSS_HDMI_AUDIO)
-
 static void hdmi5_core_audio_config(struct hdmi_core_data *core,
struct hdmi_core_audio_config *cfg)
 {
@@ -894,7 +889,6 @@ int hdmi5_audio_config(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
 
return 0;
 }
-#endif
 
 int hdmi5_core_init(struct platform_device *pdev, struct hdmi_core_data *core)
 {
diff --git a/drivers/video/fbdev/omap2/dss/hdmi5_core.h 
b/drivers/video/fbdev/omap2/dss/hdmi5_core.h
index ce7e9f3..f2f1022 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5_core.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi5_core.h
@@ -299,8 +299,6 @@ void hdmi5_configure(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp,
struct hdmi_config *cfg);
 int hdmi5_core_init(struct platform_device *pdev, struct hdmi_core_data *core);
 
-#if 

[PATCH v6 04/18] OMAPDSS: hdmi_wp: Add function for getting audio dma address

2014-10-14 Thread Jyri Sarha
The audio dma port is found in the hdmi_wp physical address space.

Signed-off-by: Jyri Sarha jsa...@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 03726b5..9ba7c1a 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 f1b53de..5154120 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi_wp.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi_wp.c
@@ -245,6 +245,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)) {
@@ -254,3 +255,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

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


[PATCH v6 08/18] ASoC: codecs/hdmi: HDMI codec doesn't benefit from pmdown delay

2014-10-14 Thread Jyri Sarha
Adds .ignore_pmdown_time = true to codec driver struct.

HDMI codec is currently a dummy codec and doesn't benefit from pmdown
delay. Even if in the future the codec would controll HDMI encoder, it
would still be a digital to digital interface that should have no need
for pmdown delay.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 sound/soc/codecs/hdmi.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/codecs/hdmi.c b/sound/soc/codecs/hdmi.c
index 2a52b90..1391ad5 100644
--- a/sound/soc/codecs/hdmi.c
+++ b/sound/soc/codecs/hdmi.c
@@ -76,6 +76,7 @@ static struct snd_soc_codec_driver hdmi_codec = {
.num_dapm_widgets = ARRAY_SIZE(hdmi_widgets),
.dapm_routes = hdmi_routes,
.num_dapm_routes = ARRAY_SIZE(hdmi_routes),
+   .ignore_pmdown_time = true,
 };
 
 static int hdmi_codec_probe(struct platform_device *pdev)
-- 
1.7.9.5

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


[PATCH v6 16/18] OMAPDSS: hdmi5: Register ASoC platfrom device for omap hdmi audio

2014-10-14 Thread Jyri Sarha
Implements callbacks for OMAP HDMI audio platform driver and registers
it in probe function. Unregistering is done in remove function.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 drivers/video/fbdev/omap2/dss/hdmi5.c |  124 +
 1 file changed, 124 insertions(+)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi5.c 
b/drivers/video/fbdev/omap2/dss/hdmi5.c
index 97363b7..042a8c4 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi5.c
@@ -38,6 +38,7 @@
 #include linux/gpio.h
 #include linux/regulator/consumer.h
 #include video/omapdss.h
+#include sound/omap-hdmi-audio.h
 
 #include hdmi5_core.h
 #include dss.h
@@ -360,6 +361,8 @@ static int hdmi_display_enable(struct omap_dss_device 
*dssdev)
goto err0;
}
 
+   hdmi.display_enabled = true;
+
mutex_unlock(hdmi.lock);
return 0;
 
@@ -374,8 +377,13 @@ static void hdmi_display_disable(struct omap_dss_device 
*dssdev)
 
mutex_lock(hdmi.lock);
 
+   if (hdmi.audio_pdev  hdmi.audio_abort_cb)
+   hdmi.audio_abort_cb(hdmi.audio_pdev-dev);
+
hdmi_power_off_full(dssdev);
 
+   hdmi.display_enabled = false;
+
mutex_unlock(hdmi.lock);
 }
 
@@ -566,6 +574,111 @@ err:
return r;
 }
 
+/* Audio callbacks */
+static int hdmi_audio_startup(struct device *dev,
+ void (*abort_cb)(struct device *dev))
+{
+   struct omap_hdmi *hd = dev_get_drvdata(dev);
+   int ret = 0;
+
+   mutex_lock(hd-lock);
+
+   if (!hdmi_mode_has_audio(hd-cfg) || !hd-display_enabled) {
+   ret = -EPERM;
+   goto out;
+   }
+
+   hd-audio_abort_cb = abort_cb;
+
+out:
+   mutex_unlock(hd-lock);
+
+   return ret;
+}
+
+static int hdmi_audio_shutdown(struct device *dev)
+{
+   struct omap_hdmi *hd = dev_get_drvdata(dev);
+
+   mutex_lock(hd-lock);
+   hd-audio_abort_cb = NULL;
+   mutex_unlock(hd-lock);
+
+   return 0;
+}
+
+static int hdmi_audio_start(struct device *dev)
+{
+   struct omap_hdmi *hd = dev_get_drvdata(dev);
+
+   WARN_ON(!hdmi_mode_has_audio(hd-cfg));
+   WARN_ON(!hd-display_enabled);
+
+   hdmi_wp_audio_enable(hd-wp, true);
+   hdmi_wp_audio_core_req_enable(hd-wp, true);
+
+   return 0;
+}
+
+static void hdmi_audio_stop(struct device *dev)
+{
+   struct omap_hdmi *hd = dev_get_drvdata(dev);
+
+   WARN_ON(!hdmi_mode_has_audio(hd-cfg));
+   WARN_ON(!hd-display_enabled);
+
+   hdmi_wp_audio_core_req_enable(hd-wp, false);
+   hdmi_wp_audio_enable(hd-wp, false);
+}
+
+static int hdmi_audio_config(struct device *dev,
+struct omap_dss_audio *dss_audio)
+{
+   struct omap_hdmi *hd = dev_get_drvdata(dev);
+   int ret;
+
+   mutex_lock(hd-lock);
+
+   if (!hdmi_mode_has_audio(hd-cfg) || !hd-display_enabled) {
+   ret = -EPERM;
+   goto out;
+   }
+
+   ret = hdmi5_audio_config(hd-core, hd-wp, dss_audio,
+hd-cfg.timings.pixelclock);
+
+out:
+   mutex_unlock(hd-lock);
+
+   return ret;
+}
+
+static const struct omap_hdmi_audio_ops hdmi_audio_ops = {
+   .audio_startup = hdmi_audio_startup,
+   .audio_shutdown = hdmi_audio_shutdown,
+   .audio_start = hdmi_audio_start,
+   .audio_stop = hdmi_audio_stop,
+   .audio_config = hdmi_audio_config,
+};
+
+static int hdmi_audio_register(struct device *dev)
+{
+   struct omap_hdmi_audio_pdata pdata = {
+   .dev = dev,
+   .dss_version = omapdss_get_version(),
+   .audio_dma_addr = hdmi_wp_get_audio_dma_addr(hdmi.wp),
+   .ops = hdmi_audio_ops,
+   };
+
+   hdmi.audio_pdev =
+   platform_device_register_data(dev, omap-hdmi-audio, 0,
+ pdata, sizeof(pdata));
+   if (IS_ERR(hdmi.audio_pdev))
+   return PTR_ERR(hdmi.audio_pdev);
+
+   return 0;
+}
+
 /* HDMI HW IP initialisation */
 static int omapdss_hdmihw_probe(struct platform_device *pdev)
 {
@@ -623,6 +736,14 @@ static int omapdss_hdmihw_probe(struct platform_device 
*pdev)
 
hdmi_init_output(pdev);
 
+   r = hdmi_audio_register(pdev-dev);
+   if (r) {
+   DSSERR(Registering HDMI audio failed %d\n, r);
+   hdmi_uninit_output(pdev);
+   pm_runtime_disable(pdev-dev);
+   return r;
+   }
+
dss_debugfs_create_file(hdmi, hdmi_dump_regs);
 
return 0;
@@ -630,6 +751,9 @@ static int omapdss_hdmihw_probe(struct platform_device 
*pdev)
 
 static int __exit omapdss_hdmihw_remove(struct platform_device *pdev)
 {
+   if (hdmi.audio_pdev)
+   platform_device_unregister(hdmi.audio_pdev);
+
hdmi_uninit_output(pdev);
 
pm_runtime_disable(pdev-dev);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body 

[PATCH v6 03/18] OMAPDSS: hdmi4_core: Remove unused hdmi4_audio_get_dma_port()

2014-10-14 Thread Jyri Sarha
hdmi4_audio_get_dma_port() is unused and and broken.

Signed-off-by: Jyri Sarha jsa...@ti.com
---
 drivers/video/fbdev/omap2/dss/hdmi4_core.c |9 -
 drivers/video/fbdev/omap2/dss/hdmi4_core.h |2 --
 2 files changed, 11 deletions(-)

diff --git a/drivers/video/fbdev/omap2/dss/hdmi4_core.c 
b/drivers/video/fbdev/omap2/dss/hdmi4_core.c
index 3b448d9..7eafea5 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4_core.c
+++ b/drivers/video/fbdev/omap2/dss/hdmi4_core.c
@@ -874,15 +874,6 @@ void hdmi4_audio_stop(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp)
hdmi_wp_audio_core_req_enable(wp, false);
 }
 
-int hdmi4_audio_get_dma_port(u32 *offset, u32 *size)
-{
-   if (!offset || !size)
-   return -EINVAL;
-   *offset = HDMI_WP_AUDIO_DATA;
-   *size = 4;
-   return 0;
-}
-
 int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core)
 {
struct resource *res;
diff --git a/drivers/video/fbdev/omap2/dss/hdmi4_core.h 
b/drivers/video/fbdev/omap2/dss/hdmi4_core.h
index c1959f7..a069f96 100644
--- a/drivers/video/fbdev/omap2/dss/hdmi4_core.h
+++ b/drivers/video/fbdev/omap2/dss/hdmi4_core.h
@@ -270,6 +270,4 @@ int hdmi4_audio_start(struct hdmi_core_data *core, struct 
hdmi_wp_data *wp);
 void hdmi4_audio_stop(struct hdmi_core_data *core, struct hdmi_wp_data *wp);
 int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
struct omap_dss_audio *audio, u32 pclk);
-int hdmi4_audio_get_dma_port(u32 *offset, u32 *size);
-
 #endif
-- 
1.7.9.5

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


[PATCH 3/3] arm: boot: dts: am437x-sk: fix lcd enable pin mux data

2014-10-14 Thread Felipe Balbi
Caused by a copy  paste error. Note that even with
this bug AM437x SK display still works because GPIO
mux mode is always enabled. It's still wrong to mux
somebody else's pin.

Luckily ball D25 (offset 0x238 - gpio5_8) on AM437x
isn't used for anything.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 arch/arm/boot/dts/am437x-sk-evm.dts | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/am437x-sk-evm.dts 
b/arch/arm/boot/dts/am437x-sk-evm.dts
index 859ff3d..681be00 100644
--- a/arch/arm/boot/dts/am437x-sk-evm.dts
+++ b/arch/arm/boot/dts/am437x-sk-evm.dts
@@ -320,8 +320,7 @@
 
lcd_pins: lcd_pins {
pinctrl-single,pins = 
-   /* GPIO 5_8 to select LCD / HDMI */
-   0x238 (PIN_OUTPUT_PULLUP | MUX_MODE7)
+   0x1c (PIN_OUTPUT_PULLUP | MUX_MODE7) /* 
gpcm_ad7.gpio1_7 */
;
};
 };
-- 
2.1.0.GIT

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


[PATCH 2/3] video: fbdev: omap2: omapfb: add missing MODULE_ALIAS()

2014-10-14 Thread Felipe Balbi
without MODULE_ALIAS(), omapfb won't get loaded
automatically.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c 
b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
index 9cbf1ce..b4b9244 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
@@ -2651,6 +2651,7 @@ module_param_named(mirror, def_mirror, bool, 0);
 
 module_platform_driver(omapfb_driver);
 
+MODULE_ALIAS(platform:omapfb);
 MODULE_AUTHOR(Tomi Valkeinen tomi.valkei...@nokia.com);
 MODULE_DESCRIPTION(OMAP2/3 Framebuffer);
 MODULE_LICENSE(GPL v2);
-- 
2.1.0.GIT

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


[PATCH 1/3] video: fbdev: omap2: omapfb: remove __exit annotation

2014-10-14 Thread Felipe Balbi
if we leave __exit annotation, driver can't be unbound
through sysfs.

Signed-off-by: Felipe Balbi ba...@ti.com
---
 drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c 
b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
index ec2d132..9cbf1ce 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
@@ -2619,7 +2619,7 @@ err0:
return r;
 }
 
-static int __exit omapfb_remove(struct platform_device *pdev)
+static int omapfb_remove(struct platform_device *pdev)
 {
struct omapfb2_device *fbdev = platform_get_drvdata(pdev);
 
@@ -2636,7 +2636,7 @@ static int __exit omapfb_remove(struct platform_device 
*pdev)
 
 static struct platform_driver omapfb_driver = {
.probe  = omapfb_probe,
-   .remove = __exit_p(omapfb_remove),
+   .remove = omapfb_remove,
.driver = {
.name   = omapfb,
.owner  = THIS_MODULE,
-- 
2.1.0.GIT

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


Re: [PATCH 2/3] video: fbdev: omap2: omapfb: add missing MODULE_ALIAS()

2014-10-14 Thread Felipe Balbi
On Tue, Oct 14, 2014 at 01:28:54PM -0500, Felipe Balbi wrote:
 without MODULE_ALIAS(), omapfb won't get loaded
 automatically.
 
 Signed-off-by: Felipe Balbi ba...@ti.com

little note here. This makes omapfb load automatically, but display
still doesn't work with DSS as modules. Backlight is working and pixel
clock is running just fine. Still, nothing on display.

I thought I'd leave that for Tomi to deal with.

-- 
balbi


signature.asc
Description: Digital signature


[PATCH] watchdog: Fix omap watchdogs to enable the magic close bit

2014-10-14 Thread Tony Lindgren
This allows testing the watchdog easily with distros just by
doing pkill -9 watchdog.

Reported-by: Thomas Dziedzic gos...@gmail.com
Signed-off-by: Tony Lindgren t...@atomide.com

--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -189,7 +189,7 @@ static int omap_wdt_set_timeout(struct watchdog_device 
*wdog,
 }
 
 static const struct watchdog_info omap_wdt_info = {
-   .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+   .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
.identity = OMAP Watchdog,
 };
 
--- a/drivers/watchdog/retu_wdt.c
+++ b/drivers/watchdog/retu_wdt.c
@@ -94,7 +94,7 @@ static int retu_wdt_set_timeout(struct watchdog_device *wdog,
 }
 
 static const struct watchdog_info retu_wdt_info = {
-   .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+   .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
.identity = Retu watchdog,
 };
 
--- a/drivers/watchdog/twl4030_wdt.c
+++ b/drivers/watchdog/twl4030_wdt.c
@@ -57,7 +57,7 @@ static int twl4030_wdt_set_timeout(struct watchdog_device 
*wdt,
 }
 
 static const struct watchdog_info twl4030_wdt_info = {
-   .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
+   .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
.identity = TWL4030 Watchdog,
 };
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: omap USB_DPLL not configured as per manual

2014-10-14 Thread Tero Kristo

On 10/14/2014 01:47 PM, Roger Quadros wrote:

Hi Tero,

The USB_DPLL doesn't have recommended M/N settings as per the TRM [1]
Thus the omapconf audit fails.

Any ideas of how we can fix this up? Should we add a new clock.ops structure for
USB_DPLL to make sure that we don't violate the TRM recommended settings?
or should we just add some flags in dpll_data? We would need a new compatible 
id for sure.

[1] - OMAP4460_ES1.x_NDA_TRM_vP.pdf - 3.6.3.9.5 DPLL_USB Preferred Settings


The version of TRM I have doesn't have the recommended settings chapter, 
I need to download the doc.


I guess we probably should introduce new fields to the dpll_data for 
this, does the TRM list an expected minimum divider / multiplier or just 
a single pair of recommended values? Do the other DPLLs have similar 
values? Looking at the DM I have here I see a recommended internal 
reference clock values for the DPLLs (min/max) and is calculated based 
on the refclk + N value.


-Tero



panda4460 omapconf audit dpll -d usb
|-|
| DPLL_USB AUDIT (@OPP OPP100, sysclk=38.4MHz) | Current Setting | Expected  | 
STATUS |
|-|
| Status   | Locked  | Locked| 
Pass   |
| Mode | Lock| Lock  | 
Pass   |
| Autoidle Mode| Auto LPST   | Auto LPST | 
Pass   |
| Low-Power Mode   | Disabled| Disabled  | 
Pass   |
| REGM4XEN Mode| Disabled| Disabled  | 
Pass   |
| DCC Mode | Disabled| Disabled  | 
Pass   |
| M Divider| 25  | 400   | 
FAIL   |
| N Divider| 0   | 15| 
FAIL   |
| Lock Frequency   | 960.0MHz| 960.0MHz  | 
Pass   |
| M2 Divider   | 2   | 2 | 
Pass   |
| CLKOUT Output Rate   | 480.0MHz| 480.0MHz  | 
Pass   |
| CLKDCOLDO Output Rate| 960.0MHz| 960.0MHz  | 
Pass   |
|-|

cheers,
-roger



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


Re: [PATCH] watchdog: Fix omap watchdogs to enable the magic close bit

2014-10-14 Thread Guenter Roeck
On Tue, Oct 14, 2014 at 12:25:19PM -0700, Tony Lindgren wrote:
 This allows testing the watchdog easily with distros just by
 doing pkill -9 watchdog.
 
 Reported-by: Thomas Dziedzic gos...@gmail.com
 Signed-off-by: Tony Lindgren t...@atomide.com
 
Good catch.

Reviewed-by: Guenter Roeck li...@roeck-us.net

 --- a/drivers/watchdog/omap_wdt.c
 +++ b/drivers/watchdog/omap_wdt.c
 @@ -189,7 +189,7 @@ static int omap_wdt_set_timeout(struct watchdog_device 
 *wdog,
  }
  
  static const struct watchdog_info omap_wdt_info = {
 - .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
 + .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
   .identity = OMAP Watchdog,
  };
  
 --- a/drivers/watchdog/retu_wdt.c
 +++ b/drivers/watchdog/retu_wdt.c
 @@ -94,7 +94,7 @@ static int retu_wdt_set_timeout(struct watchdog_device 
 *wdog,
  }
  
  static const struct watchdog_info retu_wdt_info = {
 - .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
 + .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
   .identity = Retu watchdog,
  };
  
 --- a/drivers/watchdog/twl4030_wdt.c
 +++ b/drivers/watchdog/twl4030_wdt.c
 @@ -57,7 +57,7 @@ static int twl4030_wdt_set_timeout(struct watchdog_device 
 *wdt,
  }
  
  static const struct watchdog_info twl4030_wdt_info = {
 - .options = WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING,
 + .options = WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE | WDIOF_KEEPALIVEPING,
   .identity = TWL4030 Watchdog,
  };
  
 --
 To unsubscribe from this list: send the line unsubscribe linux-watchdog in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] watchdog: Fix omap watchdogs to enable the magic close bit

2014-10-14 Thread Aaro Koskinen
Hi,

On Tue, Oct 14, 2014 at 12:25:19PM -0700, Tony Lindgren wrote:
 This allows testing the watchdog easily with distros just by
 doing pkill -9 watchdog.
 
 Reported-by: Thomas Dziedzic gos...@gmail.com
 Signed-off-by: Tony Lindgren t...@atomide.com

Acked-by: Aaro Koskinen aaro.koski...@iki.fi

A.
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cpuidle and SW sleep

2014-10-14 Thread Ran Shalit
Hello,

Is there anyone who can please explain the relation between SW sleep
(such as udelay), to change of C-state as done by cpuidle ?
How is wakeup done ? As far as I understand udelay is sw delay not HW.

Thanks for you comments,
Ran
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html