~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/sound/soc-acpi.h

Version: ~ [ linux-5.9-rc6 ] ~ [ linux-5.8.10 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.66 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.146 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.198 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.236 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.236 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2013-15, Intel Corporation. All rights reserved.
  3  *
  4  * This program is free software; you can redistribute it and/or
  5  * modify it under the terms of the GNU General Public License version
  6  * 2 as published by the Free Software Foundation.
  7  *
  8  * This program is distributed in the hope that it will be useful,
  9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 11  * GNU General Public License for more details.
 12  *
 13  */
 14 
 15 #ifndef __LINUX_SND_SOC_ACPI_H
 16 #define __LINUX_SND_SOC_ACPI_H
 17 
 18 #include <linux/stddef.h>
 19 #include <linux/acpi.h>
 20 #include <linux/mod_devicetable.h>
 21 
 22 struct snd_soc_acpi_package_context {
 23         char *name;           /* package name */
 24         int length;           /* number of elements */
 25         struct acpi_buffer *format;
 26         struct acpi_buffer *state;
 27         bool data_valid;
 28 };
 29 
 30 /* codec name is used in DAIs is i2c-<HID>:00 with HID being 8 chars */
 31 #define SND_ACPI_I2C_ID_LEN (4 + ACPI_ID_LEN + 3 + 1)
 32 
 33 #if IS_ENABLED(CONFIG_ACPI)
 34 bool snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
 35                                     struct snd_soc_acpi_package_context *ctx);
 36 #else
 37 static inline bool
 38 snd_soc_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
 39                                    struct snd_soc_acpi_package_context *ctx)
 40 {
 41         return false;
 42 }
 43 #endif
 44 
 45 /* acpi match */
 46 struct snd_soc_acpi_mach *
 47 snd_soc_acpi_find_machine(struct snd_soc_acpi_mach *machines);
 48 
 49 /**
 50  * snd_soc_acpi_mach: ACPI-based machine descriptor. Most of the fields are
 51  * related to the hardware, except for the firmware and topology file names.
 52  * A platform supported by legacy and Sound Open Firmware (SOF) would expose
 53  * all firmware/topology related fields.
 54  *
 55  * @id: ACPI ID (usually the codec's) used to find a matching machine driver.
 56  * @drv_name: machine driver name
 57  * @fw_filename: firmware file name. Used when SOF is not enabled.
 58  * @board: board name
 59  * @machine_quirk: pointer to quirk, usually based on DMI information when
 60  * ACPI ID alone is not sufficient, wrong or misleading
 61  * @quirk_data: data used to uniquely identify a machine, usually a list of
 62  * audio codecs whose presence if checked with ACPI
 63  * @pdata: intended for platform data or machine specific-ops. This structure
 64  *  is not constant since this field may be updated at run-time
 65  * @sof_fw_filename: Sound Open Firmware file name, if enabled
 66  * @sof_tplg_filename: Sound Open Firmware topology file name, if enabled
 67  * @asoc_plat_name: ASoC platform name, used for binding machine drivers
 68  * if non NULL
 69  * @new_mach_data: machine driver private data fixup
 70  */
 71 /* Descriptor for SST ASoC machine driver */
 72 struct snd_soc_acpi_mach {
 73         const u8 id[ACPI_ID_LEN];
 74         const char *drv_name;
 75         const char *fw_filename;
 76         const char *board;
 77         struct snd_soc_acpi_mach * (*machine_quirk)(void *arg);
 78         const void *quirk_data;
 79         void *pdata;
 80         const char *sof_fw_filename;
 81         const char *sof_tplg_filename;
 82         const char *asoc_plat_name;
 83         struct platform_device * (*new_mach_data)(void *pdata);
 84 };
 85 
 86 #define SND_SOC_ACPI_MAX_CODECS 3
 87 
 88 /**
 89  * struct snd_soc_acpi_codecs: Structure to hold secondary codec information
 90  * apart from the matched one, this data will be passed to the quirk function
 91  * to match with the ACPI detected devices
 92  *
 93  * @num_codecs: number of secondary codecs used in the platform
 94  * @codecs: holds the codec IDs
 95  *
 96  */
 97 struct snd_soc_acpi_codecs {
 98         int num_codecs;
 99         u8 codecs[SND_SOC_ACPI_MAX_CODECS][ACPI_ID_LEN];
100 };
101 
102 /* check all codecs */
103 struct snd_soc_acpi_mach *snd_soc_acpi_codec_list(void *arg);
104 
105 #endif
106 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp