Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * rt1316-sdw.h -- RT1316 SDCA ALSA SoC audio driver header
0004  *
0005  * Copyright(c) 2021 Realtek Semiconductor Corp.
0006  */
0007 
0008 #ifndef __RT1316_SDW_H__
0009 #define __RT1316_SDW_H__
0010 
0011 #include <linux/regmap.h>
0012 #include <linux/soundwire/sdw.h>
0013 #include <linux/soundwire/sdw_type.h>
0014 #include <linux/soundwire/sdw_registers.h>
0015 #include <sound/soc.h>
0016 
0017 /* RT1316 SDCA Control - function number */
0018 #define FUNC_NUM_SMART_AMP 0x04
0019 
0020 /* RT1316 SDCA entity */
0021 #define RT1316_SDCA_ENT_PDE23 0x31
0022 #define RT1316_SDCA_ENT_PDE27 0x32
0023 #define RT1316_SDCA_ENT_PDE22 0x33
0024 #define RT1316_SDCA_ENT_PDE24 0x34
0025 #define RT1316_SDCA_ENT_XU24 0x24
0026 #define RT1316_SDCA_ENT_FU21 0x03
0027 #define RT1316_SDCA_ENT_UDMPU21 0x02
0028 
0029 /* RT1316 SDCA control */
0030 #define RT1316_SDCA_CTL_SAMPLE_FREQ_INDEX 0x10
0031 #define RT1316_SDCA_CTL_REQ_POWER_STATE 0x01
0032 #define RT1316_SDCA_CTL_BYPASS 0x01
0033 #define RT1316_SDCA_CTL_FU_MUTE 0x01
0034 #define RT1316_SDCA_CTL_FU_VOLUME 0x02
0035 #define RT1316_SDCA_CTL_UDMPU_CLUSTER 0x10
0036 
0037 /* RT1316 SDCA channel */
0038 #define CH_L 0x01
0039 #define CH_R 0x02
0040 
0041 struct rt1316_sdw_priv {
0042     struct snd_soc_component *component;
0043     struct regmap *regmap;
0044     struct sdw_slave *sdw_slave;
0045     enum sdw_slave_status status;
0046     struct sdw_bus_params params;
0047     bool hw_init;
0048     bool first_hw_init;
0049 };
0050 
0051 struct sdw_stream_data {
0052     struct sdw_stream_runtime *sdw_stream;
0053 };
0054 
0055 #endif /* __RT1316_SDW_H__ */