@@ -603,6 +603,178 @@ static unsigned int find_sdca_control_bits(const struct sdca_entity *entity,
603
603
}
604
604
}
605
605
606
+ static enum sdca_control_datatype
607
+ find_sdca_control_datatype (const struct sdca_entity * entity ,
608
+ const struct sdca_control * control )
609
+ {
610
+ switch (SDCA_CTL_TYPE (entity -> type , control -> sel )) {
611
+ case SDCA_CTL_TYPE_S (XU , BYPASS ):
612
+ case SDCA_CTL_TYPE_S (MFPU , BYPASS ):
613
+ case SDCA_CTL_TYPE_S (FU , MUTE ):
614
+ case SDCA_CTL_TYPE_S (FU , AGC ):
615
+ case SDCA_CTL_TYPE_S (FU , BASS_BOOST ):
616
+ case SDCA_CTL_TYPE_S (FU , LOUDNESS ):
617
+ return SDCA_CTL_DATATYPE_ONEBIT ;
618
+ case SDCA_CTL_TYPE_S (IT , LATENCY ):
619
+ case SDCA_CTL_TYPE_S (OT , LATENCY ):
620
+ case SDCA_CTL_TYPE_S (MU , LATENCY ):
621
+ case SDCA_CTL_TYPE_S (SU , LATENCY ):
622
+ case SDCA_CTL_TYPE_S (FU , LATENCY ):
623
+ case SDCA_CTL_TYPE_S (XU , LATENCY ):
624
+ case SDCA_CTL_TYPE_S (CRU , LATENCY ):
625
+ case SDCA_CTL_TYPE_S (UDMPU , LATENCY ):
626
+ case SDCA_CTL_TYPE_S (MFPU , LATENCY ):
627
+ case SDCA_CTL_TYPE_S (SMPU , LATENCY ):
628
+ case SDCA_CTL_TYPE_S (SAPU , LATENCY ):
629
+ case SDCA_CTL_TYPE_S (PPU , LATENCY ):
630
+ case SDCA_CTL_TYPE_S (SU , SELECTOR ):
631
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_0 ):
632
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_1 ):
633
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_2 ):
634
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_3 ):
635
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_4 ):
636
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_5 ):
637
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_6 ):
638
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_7 ):
639
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_8 ):
640
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_9 ):
641
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_10 ):
642
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_11 ):
643
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_12 ):
644
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_13 ):
645
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_14 ):
646
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_15 ):
647
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_16 ):
648
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_17 ):
649
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_18 ):
650
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_19 ):
651
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_20 ):
652
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_21 ):
653
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_22 ):
654
+ case SDCA_CTL_TYPE_S (UDMPU , OPAQUESET_23 ):
655
+ case SDCA_CTL_TYPE_S (SAPU , PROTECTION_MODE ):
656
+ case SDCA_CTL_TYPE_S (SMPU , HIST_BUFFER_PREAMBLE ):
657
+ case SDCA_CTL_TYPE_S (XU , FDL_HOST_REQUEST ):
658
+ case SDCA_CTL_TYPE_S (XU , XU_ID ):
659
+ case SDCA_CTL_TYPE_S (CX , CLOCK_SELECT ):
660
+ case SDCA_CTL_TYPE_S (TG , TONE_DIVIDER ):
661
+ case SDCA_CTL_TYPE_S (ENTITY_0 , FUNCTION_MANUFACTURER_ID ):
662
+ case SDCA_CTL_TYPE_S (ENTITY_0 , FUNCTION_ID ):
663
+ case SDCA_CTL_TYPE_S (ENTITY_0 , FUNCTION_EXTENSION_ID ):
664
+ case SDCA_CTL_TYPE_S (ENTITY_0 , DEVICE_MANUFACTURER_ID ):
665
+ case SDCA_CTL_TYPE_S (ENTITY_0 , DEVICE_PART_ID ):
666
+ case SDCA_CTL_TYPE_S (XU , FDL_MESSAGEOFFSET ):
667
+ case SDCA_CTL_TYPE_S (XU , FDL_MESSAGELENGTH ):
668
+ case SDCA_CTL_TYPE_S (SPE , AUTHTX_MESSAGEOFFSET ):
669
+ case SDCA_CTL_TYPE_S (SPE , AUTHTX_MESSAGELENGTH ):
670
+ case SDCA_CTL_TYPE_S (SPE , AUTHRX_MESSAGEOFFSET ):
671
+ case SDCA_CTL_TYPE_S (SPE , AUTHRX_MESSAGELENGTH ):
672
+ case SDCA_CTL_TYPE_S (MFPU , AE_MESSAGEOFFSET ):
673
+ case SDCA_CTL_TYPE_S (MFPU , AE_MESSAGELENGTH ):
674
+ case SDCA_CTL_TYPE_S (SMPU , HIST_MESSAGEOFFSET ):
675
+ case SDCA_CTL_TYPE_S (SMPU , HIST_MESSAGELENGTH ):
676
+ case SDCA_CTL_TYPE_S (SMPU , DTODTX_MESSAGEOFFSET ):
677
+ case SDCA_CTL_TYPE_S (SMPU , DTODTX_MESSAGELENGTH ):
678
+ case SDCA_CTL_TYPE_S (SMPU , DTODRX_MESSAGEOFFSET ):
679
+ case SDCA_CTL_TYPE_S (SMPU , DTODRX_MESSAGELENGTH ):
680
+ case SDCA_CTL_TYPE_S (SAPU , DTODTX_MESSAGEOFFSET ):
681
+ case SDCA_CTL_TYPE_S (SAPU , DTODTX_MESSAGELENGTH ):
682
+ case SDCA_CTL_TYPE_S (SAPU , DTODRX_MESSAGEOFFSET ):
683
+ case SDCA_CTL_TYPE_S (SAPU , DTODRX_MESSAGELENGTH ):
684
+ case SDCA_CTL_TYPE_S (HIDE , HIDTX_MESSAGEOFFSET ):
685
+ case SDCA_CTL_TYPE_S (HIDE , HIDTX_MESSAGELENGTH ):
686
+ case SDCA_CTL_TYPE_S (HIDE , HIDRX_MESSAGEOFFSET ):
687
+ case SDCA_CTL_TYPE_S (HIDE , HIDRX_MESSAGELENGTH ):
688
+ return SDCA_CTL_DATATYPE_INTEGER ;
689
+ case SDCA_CTL_TYPE_S (IT , MIC_BIAS ):
690
+ case SDCA_CTL_TYPE_S (SMPU , HIST_BUFFER_MODE ):
691
+ case SDCA_CTL_TYPE_S (PDE , REQUESTED_PS ):
692
+ case SDCA_CTL_TYPE_S (PDE , ACTUAL_PS ):
693
+ case SDCA_CTL_TYPE_S (ENTITY_0 , FUNCTION_TYPE ):
694
+ return SDCA_CTL_DATATYPE_SPEC_ENCODED_VALUE ;
695
+ case SDCA_CTL_TYPE_S (XU , XU_VERSION ):
696
+ case SDCA_CTL_TYPE_S (ENTITY_0 , FUNCTION_SDCA_VERSION ):
697
+ case SDCA_CTL_TYPE_S (ENTITY_0 , FUNCTION_VERSION ):
698
+ case SDCA_CTL_TYPE_S (ENTITY_0 , FUNCTION_EXTENSION_VERSION ):
699
+ case SDCA_CTL_TYPE_S (ENTITY_0 , DEVICE_VERSION ):
700
+ case SDCA_CTL_TYPE_S (ENTITY_0 , DEVICE_SDCA_VERSION ):
701
+ return SDCA_CTL_DATATYPE_BCD ;
702
+ case SDCA_CTL_TYPE_S (FU , CHANNEL_VOLUME ):
703
+ case SDCA_CTL_TYPE_S (FU , GAIN ):
704
+ case SDCA_CTL_TYPE_S (MU , MIXER ):
705
+ case SDCA_CTL_TYPE_S (PPU , HORIZONTALBALANCE ):
706
+ case SDCA_CTL_TYPE_S (PPU , VERTICALBALANCE ):
707
+ case SDCA_CTL_TYPE_S (MFPU , ULTRASOUND_LEVEL ):
708
+ case SDCA_CTL_TYPE_S (UDMPU , ACOUSTIC_ENERGY_LEVEL_MONITOR ):
709
+ case SDCA_CTL_TYPE_S (UDMPU , ULTRASOUND_LOOP_GAIN ):
710
+ return SDCA_CTL_DATATYPE_Q7P8DB ;
711
+ case SDCA_CTL_TYPE_S (IT , USAGE ):
712
+ case SDCA_CTL_TYPE_S (OT , USAGE ):
713
+ case SDCA_CTL_TYPE_S (IT , CLUSTERINDEX ):
714
+ case SDCA_CTL_TYPE_S (CRU , CLUSTERINDEX ):
715
+ case SDCA_CTL_TYPE_S (UDMPU , CLUSTERINDEX ):
716
+ case SDCA_CTL_TYPE_S (MFPU , CLUSTERINDEX ):
717
+ case SDCA_CTL_TYPE_S (MFPU , CENTER_FREQUENCY_INDEX ):
718
+ case SDCA_CTL_TYPE_S (MFPU , AE_NUMBER ):
719
+ case SDCA_CTL_TYPE_S (SAPU , OPAQUESETREQ_INDEX ):
720
+ case SDCA_CTL_TYPE_S (XU , FDL_SET_INDEX ):
721
+ case SDCA_CTL_TYPE_S (CS , SAMPLERATEINDEX ):
722
+ case SDCA_CTL_TYPE_S (GE , SELECTED_MODE ):
723
+ case SDCA_CTL_TYPE_S (GE , DETECTED_MODE ):
724
+ return SDCA_CTL_DATATYPE_BYTEINDEX ;
725
+ case SDCA_CTL_TYPE_S (PPU , POSTURENUMBER ):
726
+ return SDCA_CTL_DATATYPE_POSTURENUMBER ;
727
+ case SDCA_CTL_TYPE_S (IT , DATAPORT_SELECTOR ):
728
+ case SDCA_CTL_TYPE_S (OT , DATAPORT_SELECTOR ):
729
+ return SDCA_CTL_DATATYPE_DP_INDEX ;
730
+ case SDCA_CTL_TYPE_S (MFPU , ALGORITHM_READY ):
731
+ case SDCA_CTL_TYPE_S (MFPU , ALGORITHM_ENABLE ):
732
+ case SDCA_CTL_TYPE_S (MFPU , ALGORITHM_PREPARE ):
733
+ case SDCA_CTL_TYPE_S (SAPU , PROTECTION_STATUS ):
734
+ case SDCA_CTL_TYPE_S (SMPU , TRIGGER_ENABLE ):
735
+ case SDCA_CTL_TYPE_S (SMPU , TRIGGER_STATUS ):
736
+ case SDCA_CTL_TYPE_S (SMPU , TRIGGER_READY ):
737
+ case SDCA_CTL_TYPE_S (SPE , PRIVACY_POLICY ):
738
+ case SDCA_CTL_TYPE_S (SPE , PRIVACY_OWNER ):
739
+ return SDCA_CTL_DATATYPE_BITINDEX ;
740
+ case SDCA_CTL_TYPE_S (IT , KEEP_ALIVE ):
741
+ case SDCA_CTL_TYPE_S (OT , KEEP_ALIVE ):
742
+ case SDCA_CTL_TYPE_S (IT , NDAI_STREAM ):
743
+ case SDCA_CTL_TYPE_S (OT , NDAI_STREAM ):
744
+ case SDCA_CTL_TYPE_S (IT , NDAI_CATEGORY ):
745
+ case SDCA_CTL_TYPE_S (OT , NDAI_CATEGORY ):
746
+ case SDCA_CTL_TYPE_S (IT , NDAI_CODINGTYPE ):
747
+ case SDCA_CTL_TYPE_S (OT , NDAI_CODINGTYPE ):
748
+ case SDCA_CTL_TYPE_S (IT , NDAI_PACKETTYPE ):
749
+ case SDCA_CTL_TYPE_S (OT , NDAI_PACKETTYPE ):
750
+ case SDCA_CTL_TYPE_S (SMPU , HIST_ERROR ):
751
+ case SDCA_CTL_TYPE_S (XU , FDL_STATUS ):
752
+ case SDCA_CTL_TYPE_S (CS , CLOCK_VALID ):
753
+ case SDCA_CTL_TYPE_S (SPE , PRIVACY_LOCKSTATE ):
754
+ case SDCA_CTL_TYPE_S (ENTITY_0 , COMMIT_GROUP_MASK ):
755
+ case SDCA_CTL_TYPE_S (ENTITY_0 , FUNCTION_STATUS ):
756
+ case SDCA_CTL_TYPE_S (ENTITY_0 , FUNCTION_ACTION ):
757
+ case SDCA_CTL_TYPE_S (XU , FDL_CURRENTOWNER ):
758
+ case SDCA_CTL_TYPE_S (SPE , AUTHTX_CURRENTOWNER ):
759
+ case SDCA_CTL_TYPE_S (SPE , AUTHRX_CURRENTOWNER ):
760
+ case SDCA_CTL_TYPE_S (MFPU , AE_CURRENTOWNER ):
761
+ case SDCA_CTL_TYPE_S (SMPU , HIST_CURRENTOWNER ):
762
+ case SDCA_CTL_TYPE_S (SMPU , DTODTX_CURRENTOWNER ):
763
+ case SDCA_CTL_TYPE_S (SMPU , DTODRX_CURRENTOWNER ):
764
+ case SDCA_CTL_TYPE_S (SAPU , DTODTX_CURRENTOWNER ):
765
+ case SDCA_CTL_TYPE_S (SAPU , DTODRX_CURRENTOWNER ):
766
+ case SDCA_CTL_TYPE_S (HIDE , HIDTX_CURRENTOWNER ):
767
+ case SDCA_CTL_TYPE_S (HIDE , HIDRX_CURRENTOWNER ):
768
+ return SDCA_CTL_DATATYPE_BITMAP ;
769
+ case SDCA_CTL_TYPE_S (IT , MATCHING_GUID ):
770
+ case SDCA_CTL_TYPE_S (OT , MATCHING_GUID ):
771
+ case SDCA_CTL_TYPE_S (ENTITY_0 , MATCHING_GUID ):
772
+ return SDCA_CTL_DATATYPE_GUID ;
773
+ default :
774
+ return SDCA_CTL_DATATYPE_IMPDEF ;
775
+ }
776
+ }
777
+
606
778
static int find_sdca_control_range (struct device * dev ,
607
779
struct fwnode_handle * control_node ,
608
780
struct sdca_control_range * range )
@@ -744,6 +916,7 @@ static int find_sdca_entity_control(struct device *dev, struct sdca_entity *enti
744
916
if (!control -> label )
745
917
return - ENOMEM ;
746
918
919
+ control -> type = find_sdca_control_datatype (entity , control );
747
920
control -> nbits = find_sdca_control_bits (entity , control );
748
921
749
922
dev_info (dev , "%s: %s: control %#x mode %#x layers %#x cn %#llx int %d value %#x %s\n" ,
0 commit comments