diff options
Diffstat (limited to 'sound/pci/hda/hda_codec.h')
-rw-r--r-- | sound/pci/hda/hda_codec.h | 82 |
1 files changed, 67 insertions, 15 deletions
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index e5a7e19a8071..507fe8a917b6 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -386,6 +386,10 @@ enum { | |||
386 | /* DIGITAL2 bits */ | 386 | /* DIGITAL2 bits */ |
387 | #define AC_DIG2_CC (0x7f<<0) | 387 | #define AC_DIG2_CC (0x7f<<0) |
388 | 388 | ||
389 | /* DIGITAL3 bits */ | ||
390 | #define AC_DIG3_ICT (0xf<<0) | ||
391 | #define AC_DIG3_KAE (1<<7) | ||
392 | |||
389 | /* Pin widget control - 8bit */ | 393 | /* Pin widget control - 8bit */ |
390 | #define AC_PINCTL_EPT (0x3<<0) | 394 | #define AC_PINCTL_EPT (0x3<<0) |
391 | #define AC_PINCTL_EPT_NATIVE 0 | 395 | #define AC_PINCTL_EPT_NATIVE 0 |
@@ -610,9 +614,9 @@ struct hda_bus_ops { | |||
610 | struct hda_pcm *pcm); | 614 | struct hda_pcm *pcm); |
611 | /* reset bus for retry verb */ | 615 | /* reset bus for retry verb */ |
612 | void (*bus_reset)(struct hda_bus *bus); | 616 | void (*bus_reset)(struct hda_bus *bus); |
613 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 617 | #ifdef CONFIG_PM |
614 | /* notify power-up/down from codec to controller */ | 618 | /* notify power-up/down from codec to controller */ |
615 | void (*pm_notify)(struct hda_bus *bus); | 619 | void (*pm_notify)(struct hda_bus *bus, bool power_up); |
616 | #endif | 620 | #endif |
617 | }; | 621 | }; |
618 | 622 | ||
@@ -708,8 +712,6 @@ struct hda_codec_ops { | |||
708 | #ifdef CONFIG_PM | 712 | #ifdef CONFIG_PM |
709 | int (*suspend)(struct hda_codec *codec); | 713 | int (*suspend)(struct hda_codec *codec); |
710 | int (*resume)(struct hda_codec *codec); | 714 | int (*resume)(struct hda_codec *codec); |
711 | #endif | ||
712 | #ifdef CONFIG_SND_HDA_POWER_SAVE | ||
713 | int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid); | 715 | int (*check_power_status)(struct hda_codec *codec, hda_nid_t nid); |
714 | #endif | 716 | #endif |
715 | void (*reboot_notify)(struct hda_codec *codec); | 717 | void (*reboot_notify)(struct hda_codec *codec); |
@@ -774,6 +776,7 @@ struct hda_pcm { | |||
774 | unsigned int pcm_type; /* HDA_PCM_TYPE_XXX */ | 776 | unsigned int pcm_type; /* HDA_PCM_TYPE_XXX */ |
775 | int device; /* device number to assign */ | 777 | int device; /* device number to assign */ |
776 | struct snd_pcm *pcm; /* assigned PCM instance */ | 778 | struct snd_pcm *pcm; /* assigned PCM instance */ |
779 | bool own_chmap; /* codec driver provides own channel maps */ | ||
777 | }; | 780 | }; |
778 | 781 | ||
779 | /* codec information */ | 782 | /* codec information */ |
@@ -859,12 +862,13 @@ struct hda_codec { | |||
859 | unsigned int no_sticky_stream:1; /* no sticky-PCM stream assignment */ | 862 | unsigned int no_sticky_stream:1; /* no sticky-PCM stream assignment */ |
860 | unsigned int pins_shutup:1; /* pins are shut up */ | 863 | unsigned int pins_shutup:1; /* pins are shut up */ |
861 | unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */ | 864 | unsigned int no_trigger_sense:1; /* don't trigger at pin-sensing */ |
862 | unsigned int ignore_misc_bit:1; /* ignore MISC_NO_PRESENCE bit */ | ||
863 | unsigned int no_jack_detect:1; /* Machine has no jack-detection */ | 865 | unsigned int no_jack_detect:1; /* Machine has no jack-detection */ |
864 | unsigned int pcm_format_first:1; /* PCM format must be set first */ | 866 | unsigned int pcm_format_first:1; /* PCM format must be set first */ |
865 | unsigned int epss:1; /* supporting EPSS? */ | 867 | unsigned int epss:1; /* supporting EPSS? */ |
866 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 868 | #ifdef CONFIG_PM |
867 | unsigned int power_on :1; /* current (global) power-state */ | 869 | unsigned int power_on :1; /* current (global) power-state */ |
870 | unsigned int d3_stop_clk:1; /* support D3 operation without BCLK */ | ||
871 | unsigned int pm_down_notified:1; /* PM notified to controller */ | ||
868 | int power_transition; /* power-state in transition */ | 872 | int power_transition; /* power-state in transition */ |
869 | int power_count; /* current (global) power refcount */ | 873 | int power_count; /* current (global) power refcount */ |
870 | struct delayed_work power_work; /* delayed task for powerdown */ | 874 | struct delayed_work power_work; /* delayed task for powerdown */ |
@@ -1042,7 +1046,7 @@ int snd_hda_resume(struct hda_bus *bus); | |||
1042 | static inline | 1046 | static inline |
1043 | int hda_call_check_power_status(struct hda_codec *codec, hda_nid_t nid) | 1047 | int hda_call_check_power_status(struct hda_codec *codec, hda_nid_t nid) |
1044 | { | 1048 | { |
1045 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1049 | #ifdef CONFIG_PM |
1046 | if (codec->patch_ops.check_power_status) | 1050 | if (codec->patch_ops.check_power_status) |
1047 | return codec->patch_ops.check_power_status(codec, nid); | 1051 | return codec->patch_ops.check_power_status(codec, nid); |
1048 | #endif | 1052 | #endif |
@@ -1059,22 +1063,70 @@ const char *snd_hda_get_jack_location(u32 cfg); | |||
1059 | /* | 1063 | /* |
1060 | * power saving | 1064 | * power saving |
1061 | */ | 1065 | */ |
1062 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 1066 | #ifdef CONFIG_PM |
1063 | void snd_hda_power_up(struct hda_codec *codec); | 1067 | void snd_hda_power_save(struct hda_codec *codec, int delta, bool d3wait); |
1064 | void snd_hda_power_up_d3wait(struct hda_codec *codec); | ||
1065 | void snd_hda_power_down(struct hda_codec *codec); | ||
1066 | void snd_hda_update_power_acct(struct hda_codec *codec); | 1068 | void snd_hda_update_power_acct(struct hda_codec *codec); |
1067 | #else | 1069 | #else |
1068 | static inline void snd_hda_power_up(struct hda_codec *codec) {} | 1070 | static inline void snd_hda_power_save(struct hda_codec *codec, int delta, |
1069 | static inline void snd_hda_power_up_d3wait(struct hda_codec *codec) {} | 1071 | bool d3wait) {} |
1070 | static inline void snd_hda_power_down(struct hda_codec *codec) {} | ||
1071 | #endif | 1072 | #endif |
1072 | 1073 | ||
1074 | /** | ||
1075 | * snd_hda_power_up - Power-up the codec | ||
1076 | * @codec: HD-audio codec | ||
1077 | * | ||
1078 | * Increment the power-up counter and power up the hardware really when | ||
1079 | * not turned on yet. | ||
1080 | */ | ||
1081 | static inline void snd_hda_power_up(struct hda_codec *codec) | ||
1082 | { | ||
1083 | snd_hda_power_save(codec, 1, false); | ||
1084 | } | ||
1085 | |||
1086 | /** | ||
1087 | * snd_hda_power_up_d3wait - Power-up the codec after waiting for any pending | ||
1088 | * D3 transition to complete. This differs from snd_hda_power_up() when | ||
1089 | * power_transition == -1. snd_hda_power_up sees this case as a nop, | ||
1090 | * snd_hda_power_up_d3wait waits for the D3 transition to complete then powers | ||
1091 | * back up. | ||
1092 | * @codec: HD-audio codec | ||
1093 | * | ||
1094 | * Cancel any power down operation hapenning on the work queue, then power up. | ||
1095 | */ | ||
1096 | static inline void snd_hda_power_up_d3wait(struct hda_codec *codec) | ||
1097 | { | ||
1098 | snd_hda_power_save(codec, 1, true); | ||
1099 | } | ||
1100 | |||
1101 | /** | ||
1102 | * snd_hda_power_down - Power-down the codec | ||
1103 | * @codec: HD-audio codec | ||
1104 | * | ||
1105 | * Decrement the power-up counter and schedules the power-off work if | ||
1106 | * the counter rearches to zero. | ||
1107 | */ | ||
1108 | static inline void snd_hda_power_down(struct hda_codec *codec) | ||
1109 | { | ||
1110 | snd_hda_power_save(codec, -1, false); | ||
1111 | } | ||
1112 | |||
1113 | /** | ||
1114 | * snd_hda_power_sync - Synchronize the power-save status | ||
1115 | * @codec: HD-audio codec | ||
1116 | * | ||
1117 | * Synchronize the actual power state with the power account; | ||
1118 | * called when power_save parameter is changed | ||
1119 | */ | ||
1120 | static inline void snd_hda_power_sync(struct hda_codec *codec) | ||
1121 | { | ||
1122 | snd_hda_power_save(codec, 0, false); | ||
1123 | } | ||
1124 | |||
1073 | #ifdef CONFIG_SND_HDA_PATCH_LOADER | 1125 | #ifdef CONFIG_SND_HDA_PATCH_LOADER |
1074 | /* | 1126 | /* |
1075 | * patch firmware | 1127 | * patch firmware |
1076 | */ | 1128 | */ |
1077 | int snd_hda_load_patch(struct hda_bus *bus, const char *patch); | 1129 | int snd_hda_load_patch(struct hda_bus *bus, size_t size, const void *buf); |
1078 | #endif | 1130 | #endif |
1079 | 1131 | ||
1080 | /* | 1132 | /* |