sst-acpi.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #include <linux/stddef.h>
  15. #include <linux/acpi.h>
  16. struct sst_acpi_package_context {
  17. char *name; /* package name */
  18. int length; /* number of elements */
  19. struct acpi_buffer *format;
  20. struct acpi_buffer *state;
  21. bool data_valid;
  22. };
  23. #if IS_ENABLED(CONFIG_ACPI)
  24. /* translation fron HID to I2C name, needed for DAI codec_name */
  25. const char *sst_acpi_find_name_from_hid(const u8 hid[ACPI_ID_LEN]);
  26. bool sst_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
  27. struct sst_acpi_package_context *ctx);
  28. #else
  29. static inline const char *sst_acpi_find_name_from_hid(const u8 hid[ACPI_ID_LEN])
  30. {
  31. return NULL;
  32. }
  33. static inline bool sst_acpi_find_package_from_hid(const u8 hid[ACPI_ID_LEN],
  34. struct sst_acpi_package_context *ctx)
  35. {
  36. return false;
  37. }
  38. #endif
  39. /* acpi match */
  40. struct sst_acpi_mach *sst_acpi_find_machine(struct sst_acpi_mach *machines);
  41. /* Descriptor for SST ASoC machine driver */
  42. struct sst_acpi_mach {
  43. /* ACPI ID for the matching machine driver. Audio codec for instance */
  44. const u8 id[ACPI_ID_LEN];
  45. /* machine driver name */
  46. const char *drv_name;
  47. /* firmware file name */
  48. const char *fw_filename;
  49. /* board name */
  50. const char *board;
  51. struct sst_acpi_mach * (*machine_quirk)(void *arg);
  52. void *pdata;
  53. };