/* SPDX-License-Identifier: GPL-2.0-only */
/*
* rt1017-sdca-sdw.h -- RT1017 SDCA ALSA SoC audio driver header
*
* Copyright(c) 2023 Realtek Semiconductor Corp.
*/
#ifndef __RT1017_SDW_H__
#define __RT1017_SDW_H__
#include <linux/regmap.h>
#include <linux/soundwire/sdw.h>
#include <linux/soundwire/sdw_type.h>
#include <linux/soundwire/sdw_registers.h>
#include <sound/soc.h>
/* RT1017 SDCA Control - function number */
#define FUNC_NUM_SMART_AMP 0 x04
/* RT1017 SDCA entity */
#define RT1017_SDCA_ENT_PDE23 0 x31
#define RT1017_SDCA_ENT_PDE22 0 x33
#define RT1017_SDCA_ENT_CS21 0 x21
#define RT1017_SDCA_ENT_SAPU29 0 x29
#define RT1017_SDCA_ENT_XU22 0 x22
#define RT1017_SDCA_ENT_FU 0 x03
#define RT1017_SDCA_ENT_UDMPU21 0 x02
/* RT1017 SDCA control */
#define RT1017_SDCA_CTL_FS_INDEX 0 x10
#define RT1017_SDCA_CTL_REQ_POWER_STATE 0 x01
#define RT1017_SDCA_CTL_PROT_STAT 0 x11
#define RT1017_SDCA_CTL_BYPASS 0 x01
#define RT1017_SDCA_CTL_FU_MUTE 0 x01
#define RT1017_SDCA_CTL_FU_VOLUME 0 x02
#define RT1017_SDCA_CTL_UDMPU_CLUSTER 0 x10
#define RT1017_CLASSD_INT_1 0 xd300
#define RT1017_PWM_TRIM_1 0 xd370
#define RT1017_PWM_FREQ_CTL_SRC_SEL_MASK (0 x3 << 2 )
#define RT1017_PWM_FREQ_CTL_SRC_SEL_EFUSE (0 x2 << 2 )
#define RT1017_PWM_FREQ_CTL_SRC_SEL_REG (0 x0 << 2 )
enum {
RT1017_SDCA_RATE_44100HZ = 0 x8,
RT1017_SDCA_RATE_48000HZ = 0 x9,
RT1017_SDCA_RATE_96000HZ = 0 xb,
RT1017_SDCA_RATE_192000HZ = 0 xd,
};
struct rt1017_sdca_priv {
struct snd_soc_component *component;
struct regmap *regmap;
struct sdw_slave *sdw_slave;
struct sdw_bus_params params;
bool hw_init;
bool first_hw_init;
};
static const struct reg_default rt1017_sdca_reg_defaults[] = {
{ 0 x3206, 0 x00 },
{ 0 xc001, 0 x43 },
{ 0 xc030, 0 x54 },
{ 0 xc104, 0 x8a },
{ 0 xc10b, 0 x2f },
{ 0 xc10c, 0 x2f },
{ 0 xc110, 0 x49 },
{ 0 xc112, 0 x10 },
{ 0 xc300, 0 xff },
{ 0 xc301, 0 xdd },
{ 0 xc318, 0 x40 },
{ 0 xc325, 0 x00 },
{ 0 xc326, 0 x00 },
{ 0 xc327, 0 x00 },
{ 0 xc328, 0 x02 },
{ 0 xc331, 0 xb2 },
{ 0 xc340, 0 x02 },
{ 0 xc350, 0 x21 },
{ 0 xc500, 0 x00 },
{ 0 xc502, 0 x00 },
{ 0 xc504, 0 x3f },
{ 0 xc507, 0 x1f },
{ 0 xc509, 0 x1f },
{ 0 xc510, 0 x40 },
{ 0 xc512, 0 x00 },
{ 0 xc518, 0 x02 },
{ 0 xc51b, 0 x7f },
{ 0 xc51d, 0 x0f },
{ 0 xc520, 0 x00 },
{ 0 xc540, 0 x80 },
{ 0 xc541, 0 x00 },
{ 0 xc542, 0 x0a },
{ 0 xc550, 0 x80 },
{ 0 xc551, 0 x0f },
{ 0 xc552, 0 xff },
{ 0 xc600, 0 x10 },
{ 0 xc602, 0 x83 },
{ 0 xc612, 0 x40 },
{ 0 xc622, 0 x40 },
{ 0 xc632, 0 x40 },
{ 0 xc642, 0 x40 },
{ 0 xc651, 0 x00 },
{ 0 xca00, 0 xc1 },
{ 0 xca09, 0 x00 },
{ 0 xca0a, 0 x51 },
{ 0 xca0b, 0 xeb },
{ 0 xca0c, 0 x85 },
{ 0 xca0e, 0 x00 },
{ 0 xca0f, 0 x10 },
{ 0 xca10, 0 x62 },
{ 0 xca11, 0 x4d },
{ 0 xca16, 0 x0f },
{ 0 xca17, 0 x00 },
{ 0 xcb00, 0 x10 },
{ 0 xcc00, 0 x10 },
{ 0 xcc02, 0 x0b },
{ 0 xd017, 0 x09 },
{ 0 xd01a, 0 x00 },
{ 0 xd01b, 0 x00 },
{ 0 xd01c, 0 x00 },
{ 0 xd101, 0 xa0 },
{ 0 xd20c, 0 x14 },
{ 0 xd300, 0 x0f },
{ 0 xd370, 0 x18 },
{ 0 xd500, 0 x00 },
{ 0 xd545, 0 x0b },
{ 0 xd546, 0 xf9 },
{ 0 xd547, 0 xb2 },
{ 0 xd548, 0 xa9 },
{ 0 xd5a5, 0 x00 },
{ 0 xd5a6, 0 x00 },
{ 0 xd5a7, 0 x00 },
{ 0 xd5a8, 0 x00 },
{ 0 xd5aa, 0 x00 },
{ 0 xd5ab, 0 x00 },
{ 0 xd5ac, 0 x00 },
{ 0 xd5ad, 0 x00 },
{ 0 xda04, 0 x03 },
{ 0 xda05, 0 x33 },
{ 0 xda06, 0 x33 },
{ 0 xda07, 0 x33 },
{ 0 xda09, 0 x5d },
{ 0 xda0a, 0 xc0 },
{ 0 xda0c, 0 x00 },
{ 0 xda0d, 0 x01 },
{ 0 xda0e, 0 x5d },
{ 0 xda0f, 0 x86 },
{ 0 xda11, 0 x20 },
{ 0 xda12, 0 x00 },
{ 0 xda13, 0 x00 },
{ 0 xda14, 0 x00 },
{ 0 xda16, 0 x7f },
{ 0 xda17, 0 xff },
{ 0 xda18, 0 xff },
{ 0 xda19, 0 xff },
{ 0 xdab6, 0 x00 },
{ 0 xdab7, 0 x01 },
{ 0 xdab8, 0 x00 },
{ 0 xdab9, 0 x01 },
{ 0 xdaba, 0 x00 },
{ 0 xdabb, 0 x01 },
{ 0 xdb09, 0 x0f },
{ 0 xdb0a, 0 xff },
{ 0 xdb14, 0 x00 },
{ SDW_SDCA_CTL(FUNC_NUM_SMART_AMP, RT1017_SDCA_ENT_UDMPU21,
RT1017_SDCA_CTL_UDMPU_CLUSTER, 0 ), 0 x00 },
{ SDW_SDCA_CTL(FUNC_NUM_SMART_AMP, RT1017_SDCA_ENT_FU,
RT1017_SDCA_CTL_FU_MUTE, 0 x01), 0 x01 },
{ SDW_SDCA_CTL(FUNC_NUM_SMART_AMP, RT1017_SDCA_ENT_XU22,
RT1017_SDCA_CTL_BYPASS, 0 ), 0 x01 },
{ SDW_SDCA_CTL(FUNC_NUM_SMART_AMP, RT1017_SDCA_ENT_CS21,
RT1017_SDCA_CTL_FS_INDEX, 0 ), 0 x09 },
{ SDW_SDCA_CTL(FUNC_NUM_SMART_AMP, RT1017_SDCA_ENT_PDE23,
RT1017_SDCA_CTL_REQ_POWER_STATE, 0 ), 0 x03 },
{ SDW_SDCA_CTL(FUNC_NUM_SMART_AMP, RT1017_SDCA_ENT_PDE22,
RT1017_SDCA_CTL_REQ_POWER_STATE, 0 ), 0 x03 },
};
#endif /* __RT1017_SDW_H__ */
Messung V0.5 in Prozent C=95 H=87 G=90
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-08)
¤
*© Formatika GbR, Deutschland