msm8953-mainline / linux

Linux mainline kernel with WIP patches for msm8953 devices
Other
112 stars 60 forks source link

sound: soc: codecs: add Texas Instruments TAS2557 support #47

Open M0Rf30 opened 2 years ago

M0Rf30 commented 2 years ago

this is a WIP driver for TI TAS2557 smart amplifier

Add somthing like this to your dts

&i2c_2 {
    status = "okay";

    /*smart PA*/
    speaker_codec: tas2557@4c{
        #sound-dai-cells = <1>;
        compatible = "ti,tas2557";
        reg = <0x4c>;
        ti,tas2557-reset-gpio = <&tlmm 86 0>;
        ti,tas2557-addr = <0x4c>;
    };
};

here the dmesg output

tas2557 1-004c: tas2557_i2c_probe enter
tas2557 1-004c: tas2557_parse_dt, tas2557 reset gpio 456
tas2557 1-004c: ti,tas2557 addr=0x4c
tas2557 1-004c: tas2557_hw_reset
tas2557 1-004c: tas2557_register_codec, enter
tas2557 1-004c: tas2557_fw_ready:
tas2557 1-004c: Firmware driver: 0x300
tas2557 1-004c: FW Size       = 24165
tas2557 1-004c: Checksum      = 0x9E30818C
tas2557 1-004c: PPC Version   = 0x5C000
tas2557 1-004c: FW  Version    = 0x1010000
tas2557 1-004c: Driver Version= 0x0300
tas2557 1-004c: Timestamp     = 1515726451
tas2557 1-004c: DDC Name      = E7_ChuckSmyth
tas2557 1-004c: Description   = TI SmartAmp
tas2557 1-004c: nSampleRate: 48000
tas2557 1-004c: mpConfigurations SampleRate: 48000
tas2557 1-004c: find matching configuration 0
tas2557 1-004c: tas2557_hw_reset
tas2557 1-004c: tas2557_load_default
tas2557 1-004c: load program 0 (Tuning Mode)
tas2557 1-004c: TAS2557 load data: Tuning Mode Program, Blocks = 1, Block Type = 1
tas2557 1-004c: tas2557_load_block: Type = 1, commands = 2867
tas2557 1-004c: TAS2557 load data: Tuning Mode Program, Blocks = 1, Block Type = 8
tas2557 1-004c: tas2557_load_coefficient, Prev=-1, new=0, Pow=0
tas2557 1-004c: load PLL: pll block for Configuration configuration_Tuning Mode_48 KHz_s1
tas2557 1-004c: tas2557_load_block: Type = 0, commands = 15
tas2557 1-004c: load configuration configuration_Tuning Mode_48 KHz_s1 conefficient pre block
tas2557 1-004c: TAS2557 load data: Snapshot 1, Blocks = 2, Block Type = 4
tas2557 1-004c: tas2557_load_block: Type = 4, commands = 7
tas2557 1-004c: load new configuration: configuration_Tuning Mode_48 KHz_s1, coeff block data
tas2557 1-004c: TAS2557 load data: Snapshot 1, Blocks = 2, Block Type = 3
tas2557 1-004c: tas2557_load_block: Type = 3, commands = 536

TAS2557 is used on xiaomi-vince, Fairphone FP3 AFAIK

z3ntu commented 2 years ago

Any plans to make this driver mainline-ready?

M0Rf30 commented 2 years ago

Any plans to make this driver mainline-ready?

no plans at all from my side, I've tried to do my best to make a starting point for TAS2557 looking at TAS2559 code within sdm845 mainline effort (you can find something here). I stripped the stereo management, but from the datasheet, two tas2557 can be connected to have a stereo usage.

dmesg reported below is on a xiaomi-vince, but, as you can imagine, I didn't played any song XD And that's all I can say