summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/hdac_hdmi.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: hdac_hdmi: Remove the unused 'timeout' variableFabio Estevam2016-05-171-1/+0
| | | | | | | | | | | | Commit b2047e996cd88d3 ("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>
* Merge remote-tracking branch 'asoc/topic/hdmi' into asoc-nextMark Brown2016-05-131-9/+154
|\
| * ASoC: hdac_hdmi: Potential NULL deref in hdac_hdmi_get_spk_alloc()Dan Carpenter2016-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We intended || here instead of &&. The original code potentially leads to a NULL dereference. Fixes: 2889099eb8cd ('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>
| * ASoC: hdac_hdmi: Register chmap controls and opsSubhransu S. Prusty2016-04-281-0/+100
| | | | | | | | | | | | | | | | | | 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>
| * ASoC: hdac_hdmi: Add multichannel supportSubhransu S. Prusty2016-04-281-9/+41
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: hdac_hdmi: parse eld for channel map capabilitySubhransu S. Prusty2016-04-281-0/+13
| | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: add link managementVinod Koul2016-05-131-2/+30
| | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Fix codec power state in S3 during playbackSubhransu S. Prusty2016-04-021-45/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Fix to use dev_pm ops instead soc pmSubhransu S. Prusty2016-04-021-7/+4
|/ | | | | | | | | | | | 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>
*-. Merge remote-tracking branches 'asoc/topic/fsl-sai', 'asoc/topic/fsl-ssl', ↵Mark Brown2016-03-131-3/+2
|\ \ | | | | | | | | | 'asoc/topic/hdac' and 'asoc/topic/max9867' into asoc-next
| | * ASoC: hdac_hdmi: Fix infoframe programmingSubhransu S. Prusty2016-03-101-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | ASoC: hdac_hdmi: Add broxton device IDJeeja KP2016-03-121-0/+1
| |/ |/| | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Add PM supportJeeja KP2016-02-231-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Fix to wait for D3 before powering off codecSubhransu S. Prusty2016-02-231-1/+11
| | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Fix to reconfigure registers in runtime resumeSubhransu S. Prusty2016-02-201-13/+16
| | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Fix to keep codec power active during enumeration.Ramesh Babu2016-02-201-0/+12
| | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Don't fail in dai startup to make userland happySubhransu S. Prusty2016-02-201-13/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Fix possible memory leak in hw_paramsSubhransu S. Prusty2016-02-201-5/+11
| | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Remove 'edev' NULL checkFabio Estevam2016-02-171-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 4a3478debf36 ("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>
* | ASoC: hdac_hdmi: Add infoframe support for dp audioSubhransu S. Prusty2016-02-151-10/+64
| | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Enable playback on all enumerated portsSubhransu S. Prusty2016-02-151-42/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Add jack reportingJeeja KP2016-02-151-3/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Create widget/route based on nodes enumeratedSubhransu S. Prusty2016-02-151-22/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: create dais based on number of cvtsSubhransu S. Prusty2016-02-151-32/+91
| | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Enable DP1.2 and all converters/pinsSubhransu S. Prusty2016-02-151-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Apply constraints based on ELDSubhransu S. Prusty2016-02-151-3/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: hdac_hdmi: Add hotplug notification and read ELDSubhransu S. Prusty2016-02-151-6/+211
|/ | | | | | | | | | | | | | | | | | | 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 8ae743e82f0b ("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>
* ASoC: hdac_hdmi: remove unused hdac_hdmi_query_pin_connlistArnd Bergmann2016-01-111-22/+0
| | | | | | | | | | | | | 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: 15b914476bf2 ("ASoC: hdac_hdmi: Use list to add pins and converters") Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: hdac_hdmi: Use list to add pins and convertersSubhransu S. Prusty2016-01-081-48/+106
| | | | | | | | | | | | | | | | | 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>
* ASoC: hdac_hdmi: Fix to warn instead of err for no connected nidsSubhransu S. Prusty2016-01-081-4/+6
| | | | | | | | | | 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>
* ASoC: hdac_hdmi: Fix to check num nodes correctlySubhransu S. Prusty2016-01-051-1/+1
| | | | | | | | | | | | | | | | | commit 3c83ac23253c ("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>
* ASoC: hdac_hdmi: use dev_to_hdac_dev and to_ehdac_deviceGeliang Tang2016-01-041-2/+2
| | | | | | | | 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>
* ASoC: hdac_hdmi: check error returnSudip Mukherjee2015-12-011-3/+4
| | | | | | | | | 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>
* ASoC: hdac_hdmi: fix possible NULL dereferenceSudip Mukherjee2015-11-231-0/+2
| | | | | | | | 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>
* ASoC: hdac_hdmi: Use i915 component framework for PMSubhransu S. Prusty2015-11-211-0/+25
| | | | | | | | | 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>
* ASoC: hdac_hdmi: Setup and start infoframeSubhransu S. Prusty2015-11-211-0/+61
| | | | | | | | 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>
* ASoC: hdac_hdmi: Add hdac hdmi dai opsSubhransu S. Prusty2015-11-211-0/+162
| | | | | | | | | 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>
* ASoC: hdac_hdmi: Add PM support for HDMISubhransu S. Prusty2015-11-211-0/+64
| | | | | | | | 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>
* ASoC: hdac-hdmi: Add hdmi driverSubhransu S. Prusty2015-11-211-0/+344
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>