Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e5e15d6 authored by Shashi Kant Maurya's avatar Shashi Kant Maurya Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: sdm660-cdc: Fix for adie-rtac register set/get error



ADIE-RTC is failing on MSM8953 with internal codec targets due to
mismatch in the codec version created on device and what is returned
from analog and digital codec drivers.Fix this by updating the digital
codec name as SDM660-CDC_1_0 and analog codec name as DRAX-CDC_1_0 for
all supported codec versions of MSM8953.By default analog codec entry is
created with spmi0-03. Since MSM8953 uses spmi0-01, read this property
from dtsi and create the codec entry accordingly.

Change-Id: I539cfad1df2db0d219ebf1de75688079893d5b88
Signed-off-by: default avatarShashi Kant Maurya <smaury@codeaurora.org>
parent 31f6ddb0
Loading
Loading
Loading
Loading
+15 −4
Original line number Diff line number Diff line
@@ -3985,6 +3985,12 @@ static ssize_t msm_anlg_codec_version_read(struct snd_info_entry *entry,

	switch (get_codec_version(sdm660_cdc_priv)) {
	case DRAX_CDC:
	case DIANGU:
	case CAJON_2_0:
	case CAJON:
	case CONGA:
	case TOMBAK_2_0:
	case TOMBAK_1_0:
		len = snprintf(buffer, sizeof(buffer), "DRAX-CDC_1_0\n");
		break;
	default:
@@ -4022,7 +4028,7 @@ int msm_anlg_codec_info_create_codec_entry(struct snd_info_entry *codec_root,
	sdm660_cdc_priv = snd_soc_codec_get_drvdata(codec);
	card = codec->component.card;
	sdm660_cdc_priv->entry = snd_info_create_subdir(codec_root->module,
							     "spmi0-03",
							    sdm660_cdc_priv->pmic_analog,
							    codec_root);
	if (!sdm660_cdc_priv->entry) {
		dev_dbg(codec->dev, "%s: failed to create pmic_analog entry\n",
@@ -4571,7 +4577,7 @@ static int msm_anlg_cdc_probe(struct platform_device *pdev)
	struct sdm660_cdc_priv *sdm660_cdc = NULL;
	struct sdm660_cdc_pdata *pdata;
	int adsp_state;

	const char *parent_dev = NULL;
	adsp_state = apr_get_subsys_state();
	if (adsp_state == APR_SUBSYS_DOWN ||
		!q6core_is_adsp_ready()) {
@@ -4653,7 +4659,12 @@ static int msm_anlg_cdc_probe(struct platform_device *pdev)
	INIT_WORK(&sdm660_cdc->msm_anlg_add_child_devices_work,
		  msm_anlg_add_child_devices);
	schedule_work(&sdm660_cdc->msm_anlg_add_child_devices_work);

	parent_dev = pdev->dev.parent->of_node->full_name;
	if (parent_dev) {
		snprintf(sdm660_cdc->pmic_analog, PMIC_ANOLOG_SIZE, "spmi0-0%s",
			 parent_dev + strlen(parent_dev)-1);
		parent_dev = NULL;
	}
	return ret;
err_supplies:
	msm_anlg_cdc_disable_supplies(sdm660_cdc, pdata);
+3 −2
Original line number Diff line number Diff line
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -33,7 +33,7 @@
#define DEFAULT_MULTIPLIER 800
#define DEFAULT_GAIN 9
#define DEFAULT_OFFSET 100

#define PMIC_ANOLOG_SIZE 9
extern const u8 msm89xx_pmic_cdc_reg_readable[MSM89XX_PMIC_CDC_CACHE_SIZE];
extern const u8 msm89xx_cdc_core_reg_readable[MSM89XX_CDC_CORE_CACHE_SIZE];
extern struct regmap_config msm89xx_cdc_core_regmap_config;
@@ -223,6 +223,7 @@ struct sdm660_cdc_priv {
		[ANLG_CDC_CHILD_DEVICES_MAX];
	int child_count;
	struct msm_cap_mode cap_mode;
	char pmic_analog[PMIC_ANOLOG_SIZE];
};

struct sdm660_cdc_pdata {
+6 −0
Original line number Diff line number Diff line
@@ -1206,6 +1206,12 @@ static ssize_t msm_dig_codec_version_read(struct snd_info_entry *entry,

	switch (msm_dig->version) {
	case DRAX_CDC:
	case DIANGU:
	case CAJON_2_0:
	case CAJON:
	case CONGA:
	case TOMBAK_2_0:
	case TOMBAK_1_0:
		len = snprintf(buffer, sizeof(buffer), "SDM660-CDC_1_0\n");
		break;
	default: