summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/cs43130.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2022-05-23 16:03:04 +0200
committerTakashi Iwai <tiwai@suse.de>2022-05-23 16:03:04 +0200
commit0163717ed5dec4fc3aaf937baa9f66f21ca11c1d (patch)
treeb0618a944385d1d35bd829c9aa09eddb5c9633fa /sound/soc/codecs/cs43130.h
parent1693e265e0a5dbe11fba21b48272dd15dbb71ec0 (diff)
parente5cd20e0d6713138444cc3f3f982712cf9a36143 (diff)
downloadlinux-0163717ed5dec4fc3aaf937baa9f66f21ca11c1d.tar.gz
linux-0163717ed5dec4fc3aaf937baa9f66f21ca11c1d.tar.bz2
linux-0163717ed5dec4fc3aaf937baa9f66f21ca11c1d.zip
Merge tag 'asoc-v5.19' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v5.19 This is quite a big update, partly due to the addition of some larger drivers (more of which is to follow since at least the AVS driver is still a work in progress) and partly due to Charles' work sorting out our handling of endianness. As has been the case recently it's much more about drivers than the core. - Overhaul of endianness specification for data formats, avoiding needless restrictions due to CODECs. - Initial stages of Intel AVS driver merge. - Introduction of v4 IPC mechanism for SOF. - TDM mode support for AK4613. - Support for Analog Devices ADAU1361, Cirrus Logic CS35L45, Maxim MAX98396, MediaTek MT8186, NXP i.MX8 micfil and SAI interfaces, nVidia Tegra186 ASRC, and Texas Instruments TAS2764 and TAS2780
Diffstat (limited to 'sound/soc/codecs/cs43130.h')
-rw-r--r--sound/soc/codecs/cs43130.h151
1 files changed, 76 insertions, 75 deletions
diff --git a/sound/soc/codecs/cs43130.h b/sound/soc/codecs/cs43130.h
index e62d671e95bb..1dd893674313 100644
--- a/sound/soc/codecs/cs43130.h
+++ b/sound/soc/codecs/cs43130.h
@@ -10,6 +10,8 @@
#ifndef __CS43130_H__
#define __CS43130_H__
+#include <linux/math.h>
+
/* CS43130 registers addresses */
/* all reg address is shifted by a byte for control byte to be LSB */
#define CS43130_FIRSTREG 0x010000
@@ -372,97 +374,96 @@ enum cs43130_dai_id {
};
struct cs43130_clk_gen {
- unsigned int mclk_int;
- int fs;
- u16 den;
- u16 num;
+ unsigned int mclk_int;
+ int fs;
+ struct u16_fract v;
};
/* frm_size = 16 */
static const struct cs43130_clk_gen cs43130_16_clk_gen[] = {
- {22579200, 32000, 441, 10,},
- {22579200, 44100, 32, 1,},
- {22579200, 48000, 147, 5,},
- {22579200, 88200, 16, 1,},
- {22579200, 96000, 147, 10,},
- {22579200, 176400, 8, 1,},
- {22579200, 192000, 147, 20,},
- {22579200, 352800, 4, 1,},
- {22579200, 384000, 147, 40,},
- {24576000, 32000, 48, 1,},
- {24576000, 44100, 5120, 147,},
- {24576000, 48000, 32, 1,},
- {24576000, 88200, 2560, 147,},
- {24576000, 96000, 16, 1,},
- {24576000, 176400, 1280, 147,},
- {24576000, 192000, 8, 1,},
- {24576000, 352800, 640, 147,},
- {24576000, 384000, 4, 1,},
+ { 22579200, 32000, .v = { 441, 10, }, },
+ { 22579200, 44100, .v = { 32, 1, }, },
+ { 22579200, 48000, .v = { 147, 5, }, },
+ { 22579200, 88200, .v = { 16, 1, }, },
+ { 22579200, 96000, .v = { 147, 10, }, },
+ { 22579200, 176400, .v = { 8, 1, }, },
+ { 22579200, 192000, .v = { 147, 20, }, },
+ { 22579200, 352800, .v = { 4, 1, }, },
+ { 22579200, 384000, .v = { 147, 40, }, },
+ { 24576000, 32000, .v = { 48, 1, }, },
+ { 24576000, 44100, .v = { 5120, 147, }, },
+ { 24576000, 48000, .v = { 32, 1, }, },
+ { 24576000, 88200, .v = { 2560, 147, }, },
+ { 24576000, 96000, .v = { 16, 1, }, },
+ { 24576000, 176400, .v = { 1280, 147, }, },
+ { 24576000, 192000, .v = { 8, 1, }, },
+ { 24576000, 352800, .v = { 640, 147, }, },
+ { 24576000, 384000, .v = { 4, 1, }, },
};
/* frm_size = 32 */
static const struct cs43130_clk_gen cs43130_32_clk_gen[] = {
- {22579200, 32000, 441, 20,},
- {22579200, 44100, 16, 1,},
- {22579200, 48000, 147, 10,},
- {22579200, 88200, 8, 1,},
- {22579200, 96000, 147, 20,},
- {22579200, 176400, 4, 1,},
- {22579200, 192000, 147, 40,},
- {22579200, 352800, 2, 1,},
- {22579200, 384000, 147, 80,},
- {24576000, 32000, 24, 1,},
- {24576000, 44100, 2560, 147,},
- {24576000, 48000, 16, 1,},
- {24576000, 88200, 1280, 147,},
- {24576000, 96000, 8, 1,},
- {24576000, 176400, 640, 147,},
- {24576000, 192000, 4, 1,},
- {24576000, 352800, 320, 147,},
- {24576000, 384000, 2, 1,},
+ { 22579200, 32000, .v = { 441, 20, }, },
+ { 22579200, 44100, .v = { 16, 1, }, },
+ { 22579200, 48000, .v = { 147, 10, }, },
+ { 22579200, 88200, .v = { 8, 1, }, },
+ { 22579200, 96000, .v = { 147, 20, }, },
+ { 22579200, 176400, .v = { 4, 1, }, },
+ { 22579200, 192000, .v = { 147, 40, }, },
+ { 22579200, 352800, .v = { 2, 1, }, },
+ { 22579200, 384000, .v = { 147, 80, }, },
+ { 24576000, 32000, .v = { 24, 1, }, },
+ { 24576000, 44100, .v = { 2560, 147, }, },
+ { 24576000, 48000, .v = { 16, 1, }, },
+ { 24576000, 88200, .v = { 1280, 147, }, },
+ { 24576000, 96000, .v = { 8, 1, }, },
+ { 24576000, 176400, .v = { 640, 147, }, },
+ { 24576000, 192000, .v = { 4, 1, }, },
+ { 24576000, 352800, .v = { 320, 147, }, },
+ { 24576000, 384000, .v = { 2, 1, }, },
};
/* frm_size = 48 */
static const struct cs43130_clk_gen cs43130_48_clk_gen[] = {
- {22579200, 32000, 147, 100,},
- {22579200, 44100, 32, 3,},
- {22579200, 48000, 49, 5,},
- {22579200, 88200, 16, 3,},
- {22579200, 96000, 49, 10,},
- {22579200, 176400, 8, 3,},
- {22579200, 192000, 49, 20,},
- {22579200, 352800, 4, 3,},
- {22579200, 384000, 49, 40,},
- {24576000, 32000, 16, 1,},
- {24576000, 44100, 5120, 441,},
- {24576000, 48000, 32, 3,},
- {24576000, 88200, 2560, 441,},
- {24576000, 96000, 16, 3,},
- {24576000, 176400, 1280, 441,},
- {24576000, 192000, 8, 3,},
- {24576000, 352800, 640, 441,},
- {24576000, 384000, 4, 3,},
+ { 22579200, 32000, .v = { 147, 100, }, },
+ { 22579200, 44100, .v = { 32, 3, }, },
+ { 22579200, 48000, .v = { 49, 5, }, },
+ { 22579200, 88200, .v = { 16, 3, }, },
+ { 22579200, 96000, .v = { 49, 10, }, },
+ { 22579200, 176400, .v = { 8, 3, }, },
+ { 22579200, 192000, .v = { 49, 20, }, },
+ { 22579200, 352800, .v = { 4, 3, }, },
+ { 22579200, 384000, .v = { 49, 40, }, },
+ { 24576000, 32000, .v = { 16, 1, }, },
+ { 24576000, 44100, .v = { 5120, 441, }, },
+ { 24576000, 48000, .v = { 32, 3, }, },
+ { 24576000, 88200, .v = { 2560, 441, }, },
+ { 24576000, 96000, .v = { 16, 3, }, },
+ { 24576000, 176400, .v = { 1280, 441, }, },
+ { 24576000, 192000, .v = { 8, 3, }, },
+ { 24576000, 352800, .v = { 640, 441, }, },
+ { 24576000, 384000, .v = { 4, 3, }, },
};
/* frm_size = 64 */
static const struct cs43130_clk_gen cs43130_64_clk_gen[] = {
- {22579200, 32000, 441, 40,},
- {22579200, 44100, 8, 1,},
- {22579200, 48000, 147, 20,},
- {22579200, 88200, 4, 1,},
- {22579200, 96000, 147, 40,},
- {22579200, 176400, 2, 1,},
- {22579200, 192000, 147, 80,},
- {22579200, 352800, 1, 1,},
- {24576000, 32000, 12, 1,},
- {24576000, 44100, 1280, 147,},
- {24576000, 48000, 8, 1,},
- {24576000, 88200, 640, 147,},
- {24576000, 96000, 4, 1,},
- {24576000, 176400, 320, 147,},
- {24576000, 192000, 2, 1,},
- {24576000, 352800, 160, 147,},
- {24576000, 384000, 1, 1,},
+ { 22579200, 32000, .v = { 441, 40, }, },
+ { 22579200, 44100, .v = { 8, 1, }, },
+ { 22579200, 48000, .v = { 147, 20, }, },
+ { 22579200, 88200, .v = { 4, 1, }, },
+ { 22579200, 96000, .v = { 147, 40, }, },
+ { 22579200, 176400, .v = { 2, 1, }, },
+ { 22579200, 192000, .v = { 147, 80, }, },
+ { 22579200, 352800, .v = { 1, 1, }, },
+ { 24576000, 32000, .v = { 12, 1, }, },
+ { 24576000, 44100, .v = { 1280, 147, }, },
+ { 24576000, 48000, .v = { 8, 1, }, },
+ { 24576000, 88200, .v = { 640, 147, }, },
+ { 24576000, 96000, .v = { 4, 1, }, },
+ { 24576000, 176400, .v = { 320, 147, }, },
+ { 24576000, 192000, .v = { 2, 1, }, },
+ { 24576000, 352800, .v = { 160, 147, }, },
+ { 24576000, 384000, .v = { 1, 1, }, },
};
struct cs43130_bitwidth_map {