Ignore:
Timestamp:
Aug 21, 2021, 3:35:34 AM (4 years ago)
Author:
David Azarewicz
Message:

Merge changes from next branch.

Location:
GPL/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/include/sound/soc.h

    r679 r695  
    491491        const struct snd_pcm_hardware *hw);
    492492
    493 /* Jack reporting */
    494 void snd_soc_jack_report(struct snd_soc_jack *jack, int status, int mask);
    495 int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count,
    496                           struct snd_soc_jack_pin *pins);
    497 void snd_soc_jack_notifier_register(struct snd_soc_jack *jack,
    498                                     struct notifier_block *nb);
    499 void snd_soc_jack_notifier_unregister(struct snd_soc_jack *jack,
    500                                       struct notifier_block *nb);
    501 int snd_soc_jack_add_zones(struct snd_soc_jack *jack, int count,
    502                           struct snd_soc_jack_zone *zones);
    503 int snd_soc_jack_get_type(struct snd_soc_jack *jack, int micbias_voltage);
    504 #ifdef CONFIG_GPIOLIB
    505 int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
    506                         struct snd_soc_jack_gpio *gpios);
    507 int snd_soc_jack_add_gpiods(struct device *gpiod_dev,
    508                             struct snd_soc_jack *jack,
    509                             int count, struct snd_soc_jack_gpio *gpios);
    510 void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
    511                         struct snd_soc_jack_gpio *gpios);
    512 #else
    513 static inline int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
    514                                          struct snd_soc_jack_gpio *gpios)
    515 {
    516         return 0;
    517 }
    518 
    519 static inline int snd_soc_jack_add_gpiods(struct device *gpiod_dev,
    520                                           struct snd_soc_jack *jack,
    521                                           int count,
    522                                           struct snd_soc_jack_gpio *gpios)
    523 {
    524         return 0;
    525 }
    526 
    527 static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
    528                                            struct snd_soc_jack_gpio *gpios)
    529 {
    530 }
    531 #endif
    532 
    533493struct snd_ac97 *snd_soc_alloc_ac97_component(struct snd_soc_component *component);
    534494struct snd_ac97 *snd_soc_new_ac97_component(struct snd_soc_component *component,
     
    617577        struct snd_ctl_elem_value *ucontrol);
    618578
    619 /**
    620  * struct snd_soc_jack_pin - Describes a pin to update based on jack detection
    621  *
    622  * @pin:    name of the pin to update
    623  * @mask:   bits to check for in reported jack status
    624  * @invert: if non-zero then pin is enabled when status is not reported
    625  * @list:   internal list entry
    626  */
    627 struct snd_soc_jack_pin {
    628         struct list_head list;
    629         const char *pin;
    630         int mask;
    631         bool invert;
    632 };
    633 
    634 /**
    635  * struct snd_soc_jack_zone - Describes voltage zones of jack detection
    636  *
    637  * @min_mv: start voltage in mv
    638  * @max_mv: end voltage in mv
    639  * @jack_type: type of jack that is expected for this voltage
    640  * @debounce_time: debounce_time for jack, codec driver should wait for this
    641  *              duration before reading the adc for voltages
    642  * @list:   internal list entry
    643  */
    644 struct snd_soc_jack_zone {
    645         unsigned int min_mv;
    646         unsigned int max_mv;
    647         unsigned int jack_type;
    648         unsigned int debounce_time;
    649         struct list_head list;
    650 };
    651 
    652 /**
    653  * struct snd_soc_jack_gpio - Describes a gpio pin for jack detection
    654  *
    655  * @gpio:         legacy gpio number
    656  * @idx:          gpio descriptor index within the function of the GPIO
    657  *                consumer device
    658  * @gpiod_dev:    GPIO consumer device
    659  * @name:         gpio name. Also as connection ID for the GPIO consumer
    660  *                device function name lookup
    661  * @report:       value to report when jack detected
    662  * @invert:       report presence in low state
    663  * @debounce_time: debounce time in ms
    664  * @wake:         enable as wake source
    665  * @jack_status_check: callback function which overrides the detection
    666  *                     to provide more complex checks (eg, reading an
    667  *                     ADC).
    668  */
    669 struct snd_soc_jack_gpio {
    670         unsigned int gpio;
    671         unsigned int idx;
    672         struct device *gpiod_dev;
    673         const char *name;
    674         int report;
    675         int invert;
    676         int debounce_time;
    677         bool wake;
    678 
    679         /* private: */
    680         struct snd_soc_jack *jack;
    681         struct delayed_work work;
    682         struct notifier_block pm_notifier;
    683         struct gpio_desc *desc;
    684 
    685         void *data;
    686         /* public: */
    687         int (*jack_status_check)(void *data);
    688 };
    689 
    690 struct snd_soc_jack {
    691         struct mutex mutex;
    692         struct snd_jack *jack;
    693         struct snd_soc_card *card;
    694         struct list_head pins;
    695         int status;
    696         struct blocking_notifier_head notifier;
    697         struct list_head jack_zones;
    698 };
    699 
    700579/* SoC PCM stream information */
    701580struct snd_soc_pcm_stream {
     
    807686
    808687        /* Symmetry requirements */
    809         unsigned int symmetric_rates:1;
     688        unsigned int symmetric_rate:1;
    810689        unsigned int symmetric_channels:1;
    811         unsigned int symmetric_samplebits:1;
     690        unsigned int symmetric_sample_bits:1;
    812691
    813692        /* Do not create a PCM for this DAI link (Backend link) */
     
    834713        unsigned int ignore:1;
    835714
     715        /* This flag will reorder stop sequence. By enabling this flag
     716         * DMA controller stop sequence will be invoked first followed by
     717         * CPU DAI driver stop sequence
     718         */
     719        unsigned int stop_dma_first:1;
     720
    836721#ifdef CONFIG_SND_SOC_TOPOLOGY
    837722        struct snd_soc_dobj dobj; /* For topology */
    838723#endif
    839724};
     725
     726static inline struct snd_soc_dai_link_component*
     727asoc_link_to_cpu(struct snd_soc_dai_link *link, int n) {
     728        return &(link)->cpus[n];
     729}
     730
     731static inline struct snd_soc_dai_link_component*
     732asoc_link_to_codec(struct snd_soc_dai_link *link, int n) {
     733        return &(link)->codecs[n];
     734}
     735
     736static inline struct snd_soc_dai_link_component*
     737asoc_link_to_platform(struct snd_soc_dai_link *link, int n) {
     738        return &(link)->platforms[n];
     739}
     740
    840741#define for_each_link_codecs(link, i, codec)                            \
    841742        for ((i) = 0;                                                   \
    842              ((i) < link->num_codecs) && ((codec) = &link->codecs[i]);  \
     743             ((i) < link->num_codecs) &&                                \
     744                     ((codec) = asoc_link_to_codec(link, i));           \
    843745             (i)++)
    844746
     
    846748        for ((i) = 0;                                                   \
    847749             ((i) < link->num_platforms) &&                             \
    848              ((platform) = &link->platforms[i]);                        \
     750                     ((platform) = asoc_link_to_platform(link, i));     \
    849751             (i)++)
    850752
    851753#define for_each_link_cpus(link, i, cpu)                                \
    852754        for ((i) = 0;                                                   \
    853              ((i) < link->num_cpus) && ((cpu) = &link->cpus[i]);        \
     755             ((i) < link->num_cpus) &&                                  \
     756                     ((cpu) = asoc_link_to_cpu(link, i));               \
    854757             (i)++)
    855758
     
    1085988        unsigned int disable_route_checks:1;
    1086989        unsigned int probed:1;
     990        unsigned int component_chaining:1;
    1087991
    1088992        void *drvdata;
     
    11621066        /* function mark */
    11631067        struct snd_pcm_substream *mark_startup;
     1068        struct snd_pcm_substream *mark_hw_params;
     1069        struct snd_pcm_substream *mark_trigger;
     1070        struct snd_compr_stream  *mark_compr_startup;
    11641071
    11651072        /* bit field */
     
    11841091             ((i) < rtd->num_cpus) && ((dai) = asoc_rtd_to_cpu(rtd, i)); \
    11851092             (i)++)
    1186 #define for_each_rtd_cpu_dais_rollback(rtd, i, dai)             \
    1187         for (; (--(i) >= 0) && ((dai) = asoc_rtd_to_cpu(rtd, i));)
    11881093#define for_each_rtd_codec_dais(rtd, i, dai)                            \
    11891094        for ((i) = 0;                                                   \
    11901095             ((i) < rtd->num_codecs) && ((dai) = asoc_rtd_to_codec(rtd, i)); \
    11911096             (i)++)
    1192 #define for_each_rtd_codec_dais_rollback(rtd, i, dai)           \
    1193         for (; (--(i) >= 0) && ((dai) = asoc_rtd_to_codec(rtd, i));)
    11941097#define for_each_rtd_dais(rtd, i, dai)                                  \
    11951098        for ((i) = 0;                                                   \
     
    11971100                     ((dai) = (rtd)->dais[i]);                          \
    11981101             (i)++)
    1199 #define for_each_rtd_dais_rollback(rtd, i, dai)         \
    1200         for (; (--(i) >= 0) && ((dai) = (rtd)->dais[i]);)
    12011102
    12021103void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);
     
    13431244                                     struct device_node **framemaster);
    13441245int snd_soc_get_dai_id(struct device_node *ep);
    1345 int snd_soc_get_dai_name(struct of_phandle_args *args,
     1246int snd_soc_get_dai_name(const struct of_phandle_args *args,
    13461247                         const char **dai_name);
    13471248int snd_soc_of_get_dai_name(struct device_node *of_node,
     
    13861287        /* set platform name for each dailink */
    13871288        for_each_card_prelinks(card, i, dai_link) {
     1289                /* only single platform is supported for now */
     1290                if (dai_link->num_platforms != 1)
     1291                        return -EINVAL;
     1292
     1293                if (!dai_link->platforms)
     1294                        return -EINVAL;
     1295
    13881296                name = devm_kstrdup(card->dev, platform_name, GFP_KERNEL);
    13891297                if (!name)
    13901298                        return -ENOMEM;
    13911299
    1392                 if (!dai_link->platforms)
    1393                         return -EINVAL;
    1394 
    13951300                /* only single platform is supported for now */
    13961301                dai_link->platforms->name = name;
     
    14191324#include <sound/soc-component.h>
    14201325#include <sound/soc-card.h>
     1326#include <sound/soc-jack.h>
    14211327
    14221328#endif
Note: See TracChangeset for help on using the changeset viewer.