summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeeyush Gupta2020-01-27 20:43:02 -0600
committerPeeyush Gupta2020-01-27 20:43:02 -0600
commit05f0e1f9f47b4b21c259b9128e0614a7b1e4a806 (patch)
treef50fbab89c65f52b889009de80db8be10a36b39a
parent8f465c5e2bf1e1422346600cce3d3d65ca7fea2f (diff)
downloadtas2562-stereo-android-driver-05f0e1f9f47b4b21c259b9128e0614a7b1e4a806.tar.gz
tas2562-stereo-android-driver-05f0e1f9f47b4b21c259b9128e0614a7b1e4a806.tar.xz
tas2562-stereo-android-driver-05f0e1f9f47b4b21c259b9128e0614a7b1e4a806.zip
Added support for Samsung LSI Platform
-rw-r--r--tas25xx-algo.c28
-rw-r--r--tas25xx-calib.c4
2 files changed, 26 insertions, 6 deletions
diff --git a/tas25xx-algo.c b/tas25xx-algo.c
index eb09d0f..dedc400 100644
--- a/tas25xx-algo.c
+++ b/tas25xx-algo.c
@@ -33,10 +33,13 @@
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34#include <linux/fs.h> 34#include <linux/fs.h>
35#include <linux/delay.h> 35#include <linux/delay.h>
36#include <dsp/q6afe-v2.h>
37#include <linux/of.h> 36#include <linux/of.h>
38#include <dsp/smart_amp.h>
39#include <linux/power_supply.h> 37#include <linux/power_supply.h>
38#ifdef CONFIG_PLATFORM_EXYNOS
39#include <sound/smart_amp.h>
40#else
41#include <dsp/smart_amp.h>
42#endif /* CONFIG_PLATFORM_EXYNOS */
40#include "tas25xx-algo.h" 43#include "tas25xx-algo.h"
41 44
42static uint32_t port = 0; 45static uint32_t port = 0;
@@ -72,8 +75,12 @@ static int afe_smartamp_get_set(u8 *user_data, uint32_t param_id,
72 uint8_t get_set, uint32_t length, uint32_t module_id) 75 uint8_t get_set, uint32_t length, uint32_t module_id)
73{ 76{
74 int ret = 0; 77 int ret = 0;
78#ifdef CONFIG_PLATFORM_EXYNOS
79 struct ti_smartpa_data resp_data;
80 (void)module_id;
81#else
75 struct afe_smartamp_get_calib calib_resp; 82 struct afe_smartamp_get_calib calib_resp;
76 83#endif
77 if(!p_tas25xx_algo) 84 if(!p_tas25xx_algo)
78 { 85 {
79 pr_err("[TI-SmartPA:%s] memory not allocated yet for p_tas25xx_algo", 86 pr_err("[TI-SmartPA:%s] memory not allocated yet for p_tas25xx_algo",
@@ -82,17 +89,26 @@ static int afe_smartamp_get_set(u8 *user_data, uint32_t param_id,
82 89
83 switch (get_set) { 90 switch (get_set) {
84 case TAS_SET_PARAM: 91 case TAS_SET_PARAM:
85 92#ifdef CONFIG_PLATFORM_EXYNOS
93 memcpy(resp_data.payload,user_data,length);
94 ret = ti_smartpa_write((void*)&resp_data, param_id, length);
95#else
86 ret = afe_smartamp_set_calib_data(param_id, 96 ret = afe_smartamp_set_calib_data(param_id,
87 (struct afe_smartamp_set_params_t *)user_data, length, module_id, p_tas25xx_algo->port); 97 (struct afe_smartamp_set_params_t *)user_data, length, module_id, p_tas25xx_algo->port);
98#endif /* CONFIG_PLATFORM_EXYNOS */
88 break; 99 break;
89 case TAS_GET_PARAM: 100 case TAS_GET_PARAM:
101#ifdef CONFIG_PLATFORM_EXYNOS
102 memset(&resp_data, 0, sizeof(resp_data));
103 ret = ti_smartpa_read((void*)&resp_data, param_id, length);
104 if (ret == 0)
105 memcpy(user_data, resp_data.payload, length);
106#else
90 memset(&calib_resp, 0, sizeof(calib_resp)); 107 memset(&calib_resp, 0, sizeof(calib_resp));
91
92 ret = afe_smartamp_get_calib_data(&calib_resp, 108 ret = afe_smartamp_get_calib_data(&calib_resp,
93 param_id, module_id, p_tas25xx_algo->port); 109 param_id, module_id, p_tas25xx_algo->port);
94
95 memcpy(user_data, calib_resp.res_cfg.payload, length); 110 memcpy(user_data, calib_resp.res_cfg.payload, length);
111#endif /* CONFIG_PLATFORM_EXYNOS */
96 break; 112 break;
97 default: 113 default:
98 goto fail_cmd; 114 goto fail_cmd;
diff --git a/tas25xx-calib.c b/tas25xx-calib.c
index ff5505d..0328ed1 100644
--- a/tas25xx-calib.c
+++ b/tas25xx-calib.c
@@ -31,7 +31,11 @@
31#include <linux/semaphore.h> 31#include <linux/semaphore.h>
32#include <linux/uaccess.h> 32#include <linux/uaccess.h>
33#include <linux/miscdevice.h> 33#include <linux/miscdevice.h>
34#ifdef CONFIG_PLATFORM_EXYNOS
35#include <sound/smart_amp.h>
36#else
34#include <dsp/smart_amp.h> 37#include <dsp/smart_amp.h>
38#endif
35 39
36/* Holds the Packet data required for processing */ 40/* Holds the Packet data required for processing */
37struct tas_dsp_pkt { 41struct tas_dsp_pkt {