1
0
Fork 0
Commit Graph

105 Commits (8e8e69d67e5fad1a1edf97acebd649a6c8f1febd)

Author SHA1 Message Date
Jeeja KP a9ce96bcd9 ASoC: hdac_hdmi: Handle MST pin jack detection at boot/resume
The ELD notification can be received asynchronously from the graphics
side and this may happen just at the moment the sound driver is
initializing and notification will be missed. Similarly at system
resume, the notification is ignored as the  ELD and connection states
are updated in anyway at the end of the resume.
So check the jack status in boot/resume by querying the port presence
based on pin caps and report the jack status.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:55:32 +00:00
Jeeja KP fc181b04f2 ASoC: hdac_hdmi: Add MST verb support
To support DP MST audio, new pin verbs/params are added. This patch
adds helper functions to do following:
o To set a specific port
o To get the currently selected port
o To get the length of port.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-16 18:55:14 +00:00
Jeeja KP 2acd8309a3 ASoC: hdac_hdmi: Add support to handle MST capable pin
To handle jack event and configuration of the pin widget for MST
capable pin, this patch adds:
o Flag to identify the pin is MST capable.
o In notify callback(), based on the pipe and port information marks if
the port is mst_capable. In case of non MST, port is defaulted to zero.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-08 18:24:01 +00:00
Jeeja KP 754695f996 ASoC: hdac_hdmi: Begin to add support for DP Multi-stream audio
With MST each pin contains several ports to which device can be
connected.

As a preparatory work to support DP MST this patch adds below changes:
1. Defines the port structure and moves all stream related information
   like ELD, converter list, chmap to port.
2. Creates ports for each pin based on the max_ports support.
3. Based on Pin-Port combination creates DAPM Mux widget instead of Pin
   to allow user to select a converter.
4. Port zero is the default port when pin does not support MST.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-08 18:23:35 +00:00
Jeeja KP ab1eea19d0 ASoC: hdac_hdmi: Move channel info from pin to PCM structure
Channel info is part of the pcm parameter and channel map control is
created for each pcm. So move channel info to pcm instead of pin
structure and the mutex lock to pcm.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-02-04 13:07:03 +01:00
Jeeja KP c9bfb5d74d ASoC: hdac_hdmi: Register widget event handlers
In case of hdmi connect/disconnect or when stream need to be route to
multiple monitors, corresponding port and audio infoframe needs to be
reconfigured. Currently all the configuration are done in DAI ops which
results in silence playback.

So use dapm widget event handlers to program audio infoframe and enable
/disable port configuration when widget is power on/off.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-24 17:55:11 +00:00
Mark Brown dbbc21bbf2 Linux 4.10-rc1
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJYYGCgAAoJEHm+PkMAQRiGjVMH/R1WKLSCVyU2QboSTZVyBGqU
 6E42pMalPNaY72uxf29ZmUzds1uV5KyFn7OntsyD4qc+sQb2wxG5PvMSYAsL7HKN
 lTFiW738zC9Hfx8MzC/fHLGm/7HTHpPFndZJkDOJjIPnS0MeTHAmOFM+RwCRq+px
 5uvRHV4Z8yibHtijET6GqCywV0gw/uyXCi6xJfJNAspnj3hsm3ZXKJ0JPvP2ja+V
 yhdnWYHDEQwRs6FyNtIWnfjH92XilVn4KcOtwnb1pFahALiTmmVqJVMiGartagqJ
 fPRw98B3YHwmZpEc2SDbXaZi36WLu4hcWvvDa22SN/srXwYIzzblEwuNq1+fiBw=
 =X7z+
 -----END PGP SIGNATURE-----

Merge tag 'v4.10-rc1' into asoc-intel

Linux 4.10-rc1
2017-01-24 16:24:18 +00:00
Sandeep Tayal f6fa11a35c ASoC: hdac_hdmi: use audio component framework to read ELD
With codec read sometimes the pin_sense shows invalid monitor present
and eld_valid. Currently driver polls for few times to get the valid
eld data.

To avoid the latency, Instead of reading ELD from codec, read it
directly from the display driver using audio component framework.
and removed the unused direct codec helper functions.

Signed-off-by: Sandeep Tayal <sandeepx.tayal@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-20 13:36:38 +00:00
Jeeja KP 1de777fed5 ASoC: hdac_hdmi: Enable pin and converter in prepare
Instead of enabling pin and cvt in pcm_open(), need to restore pin and
cvt state after system resume to restart the playback which is
paused/stopped before system suspend.
So enable pin and cvt in playback_prepare and call prepare when trigger
cmd is paused/started and resume to reconfigure pin and cvt.

Signed-off-by: Sachin Mokashi <sachinx.mokashi@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2017-01-19 15:43:04 +00:00
Dave Airlie 5481e27f6f Merge tag 'drm-intel-next-2016-10-24' of git://anongit.freedesktop.org/drm-intel into drm-next
- first slice of the gvt device model (Zhenyu et al)
- compression support for gpu error states (Chris)
- sunset clause on gpu errors resulting in dmesg noise telling users
  how to report them
- .rodata diet from Tvrtko
- switch over lots of macros to only take dev_priv (Tvrtko)
- underrun suppression for dp link training (Ville)
- lspcon (hmdi 2.0 on skl/bxt) support from Shashank Sharma, polish
  from Jani
- gen9 wm fixes from Paulo&Lyude
- updated ddi programming for kbl (Rodrigo)
- respect alternate aux/ddc pins (from vbt) for all ddi ports (Ville)

* tag 'drm-intel-next-2016-10-24' of git://anongit.freedesktop.org/drm-intel: (227 commits)
  drm/i915: Update DRIVER_DATE to 20161024
  drm/i915: Stop setting SNB min-freq-table 0 on powersave setup
  drm/i915/dp: add lane_count check in intel_dp_check_link_status
  drm/i915: Fix whitespace issues
  drm/i915: Clean up DDI DDC/AUX CH sanitation
  drm/i915: Respect alternate_ddc_pin for all DDI ports
  drm/i915: Respect alternate_aux_channel for all DDI ports
  drm/i915/gen9: Remove WaEnableYV12BugFixInHalfSliceChicken7
  drm/i915: KBL - Recommended buffer translation programming for DisplayPort
  drm/i915: Move down skl/kbl ddi iboost and n_edp_entires fixup
  drm/i915: Add a sunset clause to GPU hang logging
  drm/i915: Stop reporting error details in dmesg as well as the error-state
  drm/i915/gvt: do not ignore return value of create_scratch_page
  drm/i915/gvt: fix spare warnings on odd constant _Bool cast
  drm/i915/gvt: mark symbols static where possible
  drm/i915/gvt: fix sparse warnings on different address spaces
  drm/i915/gvt: properly access enabled intel_engine_cs
  drm/i915/gvt: Remove defunct vmap_batch()
  drm/i915/gvt: Use common mapping routines for shadow_bb object
  drm/i915/gvt: Use common mapping routines for indirect_ctx object
  ...
2016-10-25 16:39:43 +10:00
Pandiyan, Dhinakaran f931894194 drm/i915/dp: DP audio API changes for MST
DP MST provides the capability to send multiple video and audio streams
through a single port. This requires the API's between i915 and audio
drivers to distinguish between multiple audio capable displays that can be
connected to a port. Currently only the port identity is shared in the
APIs. This patch adds support for MST with an additional parameter
'int pipe'. The existing parameter 'port' does not change it's meaning.

pipe =
	MST	: display pipe that the stream originates from
	Non-MST	: -1

Affected APIs:
struct i915_audio_component_ops
-       int (*sync_audio_rate)(struct device *, int port, int rate);
+	int (*sync_audio_rate)(struct device *, int port, int pipe,
+	     int rate);

-       int (*get_eld)(struct device *, int port, bool *enabled,
-                       unsigned char *buf, int max_bytes);
+       int (*get_eld)(struct device *, int port, int pipe,
+		       bool *enabled, unsigned char *buf, int max_bytes);

struct i915_audio_component_audio_ops
-       void (*pin_eld_notify)(void *audio_ptr, int port);
+       void (*pin_eld_notify)(void *audio_ptr, int port, int pipe);

This patch makes dummy changes in the audio drivers (thanks Libin) for
build to succeed. The audio side drivers will send the right 'pipe' values
for MST in patches that will follow.

v2:
Renamed the new API parameter from 'dev_id' to 'pipe'. (Jim, Ville)
Included Asoc driver API compatibility changes from Jeeja.
Added WARN_ON() for invalid pipe in get_saved_encoder(). (Takashi)
Added comment for av_enc_map[] definition. (Takashi)

v3:
Fixed logic error introduced while renaming 'dev_id' as 'pipe' (Ville)
Renamed get_saved_encoder() to get_saved_enc() to reduce line length

v4:
Rebased.
Parameter check for pipe < -1 values in get_saved_enc() (Ville)
Switched to for_each_pipe() in get_saved_enc() (Ville)
Renamed 'pipe' to 'dev_id' in audio side code (Takashi)

v5:
Included a comment for the dev_id arg. (Libin)

Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1474488168-2343-1-git-send-email-dhinakaran.pandiyan@intel.com
2016-09-22 09:01:55 -07:00
Colin Ian King 3fb7b4e488 ASoC: hdac_hdmi: fix spelling mistake "montior" -> "monitor"
Trivial fix to spelling mistake in dev_warn message.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-09-01 21:02:19 +01:00
Mark Brown 44d624622e Merge remote-tracking branch 'asoc/topic/intel' into asoc-next 2016-07-24 22:07:22 +01:00
Shreyas NC cc21688703 ASoC: hdac_hdmi: Add device id for Kabylake
Kabylake platform is similar to Skylake. So, add the device id.

Signed-off-by: Shreyas NC <shreyas.nc@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-07-11 22:20:15 +01:00
Vedang Patel 3cb7cec144 ASoC: hdac_hdmi: Increase loglevel of hex dump printed
The hdac_hdmi codec driver prints the ELD information everytime an
external monitor is connected. Make it so that the information is only
printed when someone trying to debug the driver explicitly enables it.

print_hex_dump_bytes (which just calls print_hex_dump) uses
printk(KERN_DEBUG,... which is different from dev_dbg used elsewhere in
the driver: it's always enabled at compile-time. Change it to
print_hex_dump_debug for logging consistency.

Signed-off-by: Vedang Patel <vedang.patel@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-06-27 15:51:29 +01:00
Vinod Koul 500e06b9a3 ASoC: hdac_hdmi: Fix potential NULL dereference
Static checker warns:
Pointer 'hlink' returned from call to function 'snd_hdac_ext_bus_get_link'
at line may be NULL and will be dereferenced"

So we should always check the return of snd_hdac_ext_bus_get_link() before
referencing the link pointer

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-31 14:36:30 +01:00
Fabio Estevam 29cf67b995 ASoC: hdac_hdmi: Remove the unused 'timeout' variable
Commit b2047e996c ("ASoC: hdac_hdmi: add link management")
introuduced the following build warning:

sound/soc/codecs/hdac_hdmi.c:1721:16: warning: unused variable 'timeout' [-Wunused-variable]

Remove the unused 'timeout' variable.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-17 11:31:55 +01:00
Mark Brown 515511a792 Merge remote-tracking branch 'asoc/topic/hdmi' into asoc-next 2016-05-13 14:27:16 +01:00
Vinod Koul b2047e996c ASoC: hdac_hdmi: add link management
Manage the hda idisp link using shiny new link APIs.  We need to
keep link On while we probe and also hold the reference in runtime
resume and drop in suspend

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-13 11:43:12 +01:00
Dan Carpenter 8f658815da ASoC: hdac_hdmi: Potential NULL deref in hdac_hdmi_get_spk_alloc()
We intended || here instead of &&.  The original code potentially leads
to a NULL dereference.

Fixes: 2889099eb8 ('ASoC: hdac_hdmi: Register chmap controls and ops')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewd-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Tested-by: Sachin Mokashi <sachinx.mokashi@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-05-03 17:30:13 +01:00
Subhransu S. Prusty 2889099eb8 ASoC: hdac_hdmi: Register chmap controls and ops
With this patch, chmap controls are created and user space can
set the channel map.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-28 18:49:24 +01:00
Subhransu S. Prusty bcced70478 ASoC: hdac_hdmi: Add multichannel support
To support multichannel hdac hdmi driver registers with HDA
channel map framework. Channel count and channel slot verbs are
programmed by using the chmap helpers/ops.  The channel
allocation is then programmed in the audio infoframe as per CEA
spec.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-28 18:49:24 +01:00
Subhransu S. Prusty b7756edeb7 ASoC: hdac_hdmi: parse eld for channel map capability
This patch parses ELD speaker allocation data block to find
sink's chmap capability.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-28 18:49:24 +01:00
Subhransu S. Prusty 1b377ccddd ASoC: hdac_hdmi: Fix codec power state in S3 during playback
If the system enters S3 during a playback, codec power needs to
be turned OFF during suspend and restored during resume. With
this patch the AFG node is set to D3 and codec power is turned
OFF during controller suspend call.

During resume, the codec power is left in ON state if the
playback was in progress while suspending.

Also setting power state for AFG node is optimized. With this the
loop with timeout is removed and codec_read is used instead.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-02 09:28:02 -07:00
Subhransu S. Prusty 0fee1798af ASoC: hdac_hdmi: Fix to use dev_pm ops instead soc pm
Use dev_pm ops feature instead of soc pm as core assumes system
is capable of direct complete. Register with complete callback
instead of resume to synchronize with Jack notification from
display driver. This ensures correct Jack notification to user
space.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-02 09:28:02 -07:00
Mark Brown ab96d9d603 Merge remote-tracking branches 'asoc/topic/fsl-sai', 'asoc/topic/fsl-ssl', 'asoc/topic/hdac' and 'asoc/topic/max9867' into asoc-next 2016-03-13 15:17:09 +07:00
Jeeja KP e2304803fd ASoC: hdac_hdmi: Add broxton device ID
Broxton HDMI codec is similar to Skylake so add the device ID

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: GuruprasadX Pawse <guruprasadx.pawse@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-12 13:02:54 +07:00
Subhransu S. Prusty 391005e8e3 ASoC: hdac_hdmi: Fix infoframe programming
Audio infoframe used incorrect buffer, so fix it.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-10 10:37:14 +07:00
Jeeja KP 571d507809 ASoC: hdac_hdmi: Add PM support
The codec registers are reset during S3. So need to reconfigure
all pins and DP1.2 feature again after resume from S3. Also
reprogram the required registers if the S3 was triggered during
playback.

In suspended state ELD notify callback is not processed, So add
ELD check for all pins as well.

Also turn the codec power domain OFF which is kept ON during
controller resequencing and codec reenumeration.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-23 06:25:49 +09:00
Subhransu S. Prusty 7ed49700c4 ASoC: hdac_hdmi: Fix to wait for D3 before powering off codec
Powering off codec immediately after sending D3 verb may not set
the node to D3 state. So wait for a confirmation response before
shutting down codec.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-23 06:25:49 +09:00
Subhransu S. Prusty ab85f5b36e ASoC: hdac_hdmi: Fix to reconfigure registers in runtime resume
The register are reset during the D3 to D0 transition. So
reconfigure them.

Also as all DAIs are now supported, remove the dai id check in prepare.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:56:53 +09:00
Ramesh Babu aeaccef0bc ASoC: hdac_hdmi: Fix to keep codec power active during enumeration.
The codec power is turned OFF in the first explicit call to
pm_runtime_suspend to keep the i915 refcount balanced. During regular
operation, the power is turned ON/OFF in runtime PM handlers.

Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:56:53 +09:00
Subhransu S. Prusty 54dfa1eaf4 ASoC: hdac_hdmi: Don't fail in dai startup to make userland happy
In dai startup, driver was checking for ELD and would fail if no
monitor is connected. This causes userland like PA, CRAS to be
unhappy as they scan the device list at bootup.

So move the ELD check to hw_params and fail if valid ELD is not
found.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:56:53 +09:00
Subhransu S. Prusty 6793a3d706 ASoC: hdac_hdmi: Fix possible memory leak in hw_params
It's possible for hw_params to be called two times. So add NULL
check to prevent memory leak.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 00:56:53 +09:00
Fabio Estevam cd890ade49 ASoC: hdac_hdmi: Remove 'edev' NULL check
Commit 4a3478debf ("ASoC: hdac_hdmi: Add jack reporting")
leads to the following Smatch complaint:

sound/soc/codecs/hdac_hdmi.c:971 hdac_hdmi_present_sense()
         warn: variable dereferenced before check 'edev' (see line 967)

As explained by Subhransu S. Prusty:

"This NULL check is not required, can be removed.

edev object is expected to be present when the present_sense is
called. This is called from places where this edev object is
already available."

So remove the evdev NULL check.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Acked-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-17 13:10:38 +00:00
Subhransu S. Prusty 478f544e5b ASoC: hdac_hdmi: Add infoframe support for dp audio
For DP audio support, infoframe needs to be different. Based on
get_conn_type result we pack either HDMI or DP infoframe.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-15 20:55:57 +00:00
Subhransu S. Prusty 148569fddb ASoC: hdac_hdmi: Enable playback on all enumerated ports
Last patch added infrastructure to render over all the ports,
PCM<->cvt<- pin mapping and user selection of controls. But we
still have restriction of playback on the default port alone, so
remove that.

This patch removes the hardcoding of cvt<->pin map from the dai.
Cvt and pin for a dai are now derived from the already stored pcm
list of device opened.  We query connection list of a pin from
codec to validate the cvt<->pin map.

If connection list returns zero, then monitor is not connected so
fail playback.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-15 20:55:57 +00:00
Jeeja KP 4a3478debf ASoC: hdac_hdmi: Add jack reporting
Jack is created based on pcm devices enumerated, so we will
create Jack as "HDMI/DP, pcm=x Jack". This style is expected by
current usermode like PulseAudio and CRAS.

This patch exports an API which can be used to register Jack
based on PCM. This API also establishes the map between PCM and
cvt. Further cvt to pin mapping is established with the help of
usermode selection based on the board topology.

During device probe as the PCMs may not be registered, initial
pin sense don't report jack events. So, first time jack reporting
is done during user selection of mux control.

Signed-off-by: Jeeja KP <jeeja.kp@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-15 20:54:03 +00:00
Subhransu S. Prusty 79f4e922b5 ASoC: hdac_hdmi: Create widget/route based on nodes enumerated
In skylake, HDMI codec enumerates 3 pins and 3 cvts. Stream can
be routed from any cvt to any pin based on the connection list
queried from the pin.

This patch removes the static modelling of widget/route and
creates it dynamically based on the codec widgets enumerated.

Mux widgets are added to represent the map between a cvt and pin.
Ideally the mux widgets should be created based on the connection
list queried from the pin widget. But due to HW behavior, if an
external display is not connected on a port, querying the
connection list returns zero. So create mux widgets to map all
the cvt to all pins. At runtime, playback support on a pin can be
verified based on the connection list query.

Few function in driver have additional arguments now to support
this.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-15 20:54:03 +00:00
Subhransu S. Prusty 17a42c4500 ASoC: hdac_hdmi: create dais based on number of cvts
After enabling all pins/cvts, Skylake HDMI codec enumerates 3
converters.  Three independent streams can be supported with 3
cvts. This patch removes the static dai creation and creates dais
based on the number of cvts queried.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-15 20:54:03 +00:00
Subhransu S. Prusty 211caab73b ASoC: hdac_hdmi: Enable DP1.2 and all converters/pins
Skylake supports 3 pin and 3 converter widgets. But by default
only one converter and pin widget are enabled. In skylake
platform the DP port is on a different port which is not enabled
by default. To enable playback on DP port, enable all pin and
converter widget by sending a vendor VERB for a vendor widget to
set required bits.

As we are enabling the DP support enable the DP1.2 feature as well.

Enabling DP1.2 and all widget changes are copied from patch_hdmi.c.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-15 20:54:03 +00:00
Subhransu S. Prusty 2428bca305 ASoC: hdac_hdmi: Apply constraints based on ELD
Uses the drm ELD core framework to apply rate and channel

Also compute the format to be set based on ELD.

Even though the channel constraint is based on ELD, infoframe
is set with stereo only. Multichannel support will be added
later.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-15 20:11:09 +00:00
Subhransu S. Prusty b8a54545b0 ASoC: hdac_hdmi: Add hotplug notification and read ELD
This patch uses i915 component framework to register for hotplug
notification.

In the hotplug notification, driver reads pin sense and ELD by
sending PIN_SENSE and ELD verbs over HDA bus. Once it identifies
valid pin sense and valid ELD, store the ELD into the
corresponding pin map buffer.

Also read the monitor present sense during resume and ignore the
ELD notify from graphics during PM as is done in legacy hda,
commit 8ae743e82f ("ALSA: hda - Skip ELD notification during
system suspend")

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-15 20:11:09 +00:00
Arnd Bergmann fe09dd8eb2 ASoC: hdac_hdmi: remove unused hdac_hdmi_query_pin_connlist
A recent rework removed the only user of the hdac_hdmi_query_pin_connlist
function, so we now get a warning when building the hdac_hdmi driver:

hdac_hdmi.c:313:12: warning: 'hdac_hdmi_query_pin_connlist' defined but not used [-Wunused-function]

This removes the function, which makes the file build cleanly again.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 15b914476b ("ASoC: hdac_hdmi: Use list to add pins and converters")
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-11 13:04:52 +00:00
Subhransu S. Prusty 15b914476b ASoC: hdac_hdmi: Use list to add pins and converters
Future platforms may have a different set of pins/converters.
So use lists to add pins and converters based on enumeration.

Also it may be required to connect any converter to any pin
dynamically as per different use cases (for example DP is
connected to pin 6 on skylake board). So this will help in
dynamically select and route.

Fix the dai map as well to use the pin/cvt from list. Not
enabling all dai maps for now.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-08 13:34:05 +00:00
Subhransu S. Prusty 5307246015 ASoC: hdac_hdmi: Fix to warn instead of err for no connected nids
It is possible that some pin widget may return with no converter
connected. So don't throw error if none are found to be connected.
Instead print a warning and continue.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-08 13:02:31 +00:00
Subhransu S. Prusty 541140d430 ASoC: hdac_hdmi: Fix to check num nodes correctly
commit 3c83ac2325 ("ASoC: hdac_hdmi: check error return") fixes
the static checker warning reported by Dan Carpenter:

	sound/soc/codecs/hdac_hdmi.c:416 hdac_hdmi_parse_and_map_nid()
	warn: unsigned 'hdac->num_nodes' is never less than zero.

But it doesn't fix the issue completely.

It's also a failure if no sub nodes found for an afg node. So modify
the return condition appropriately.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-05 19:18:34 +00:00
Geliang Tang 51b2c4258f ASoC: hdac_hdmi: use dev_to_hdac_dev and to_ehdac_device
Use dev_to_hdac_dev() and to_ehdac_device() instead of open-coding.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Reviewed-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-04 11:21:47 +00:00
Sudip Mukherjee 3c83ac2325 ASoC: hdac_hdmi: check error return
As hdac->num_nodes is unsigned we can not check if
snd_hdac_get_sub_nodes() has returned error or success. Lets have a
temporary int to check the error value.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-01 18:44:26 +00:00
Sudip Mukherjee 8d33ab2424 ASoC: hdac_hdmi: fix possible NULL dereference
kzalloc() can return NULL if it fails, and then we will be dereferencing
a NULL pointer.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-23 14:38:08 +00:00
Subhransu S. Prusty 07f083aba9 ASoC: hdac_hdmi: Use i915 component framework for PM
Use the component framework to keep the display on till the
playback in progress.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-21 13:58:19 +00:00
Subhransu S. Prusty a657f1d05f ASoC: hdac_hdmi: Setup and start infoframe
This patch uses hdmi framework in video to fill audio infoframe.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-21 13:58:19 +00:00
Subhransu S. Prusty b0362adbeb ASoC: hdac_hdmi: Add hdac hdmi dai ops
The DAI ops are used for triggering HDMI streams and configuring
the parameters

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-21 13:58:19 +00:00
Subhransu S. Prusty e342ac08d0 ASoC: hdac_hdmi: Add PM support for HDMI
Power up/down the AFG node during runtime resume/suspend.

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-21 13:58:19 +00:00
Subhransu S. Prusty 18382ead36 ASoC: hdac-hdmi: Add hdmi driver
This adds HDA based HDMI driver to be used in platforms like SKL
and onwards

Register the hdmi driver with hda bus and register dais.

Also parse the widget and initialize identified pin and converter
widgets.

For simplification, currently only one pin and one converter
widget are enabled on board, as well as limit the rates supported
to simples ones and not based on ELD.  This things will come
eventually once basic support for this is merged

Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-11-21 13:58:19 +00:00