@@ -4946,7 +4946,7 @@ static void mute_all_mixer_nid(struct hda_codec *codec, hda_nid_t mix)
4946
4946
* @nid: audio widget
4947
4947
* @on: power on/off flag
4948
4948
*
4949
- * Set this in patch_ops .stream_pm. Only valid with power_save_node flag.
4949
+ * Set this in hda_codec_ops .stream_pm. Only valid with power_save_node flag.
4950
4950
*/
4951
4951
void snd_hda_gen_stream_pm (struct hda_codec * codec , hda_nid_t nid , bool on )
4952
4952
{
@@ -5230,7 +5230,7 @@ static const char * const follower_pfxs[] = {
5230
5230
* snd_hda_gen_build_controls - Build controls from the parsed results
5231
5231
* @codec: the HDA codec
5232
5232
*
5233
- * Pass this to build_controls patch_ops .
5233
+ * Pass this to build_controls hda_codec_ops .
5234
5234
*/
5235
5235
int snd_hda_gen_build_controls (struct hda_codec * codec )
5236
5236
{
@@ -5743,7 +5743,7 @@ static void setup_pcm_stream(struct hda_pcm_stream *str,
5743
5743
* snd_hda_gen_build_pcms - build PCM streams based on the parsed results
5744
5744
* @codec: the HDA codec
5745
5745
*
5746
- * Pass this to build_pcms patch_ops .
5746
+ * Pass this to build_pcms hda_codec_ops .
5747
5747
*/
5748
5748
int snd_hda_gen_build_pcms (struct hda_codec * codec )
5749
5749
{
@@ -6032,7 +6032,7 @@ static void clear_unsol_on_unused_pins(struct hda_codec *codec)
6032
6032
* snd_hda_gen_init - initialize the generic spec
6033
6033
* @codec: the HDA codec
6034
6034
*
6035
- * This can be put as patch_ops init function.
6035
+ * This can be put as hda_codec_ops init function.
6036
6036
*/
6037
6037
int snd_hda_gen_init (struct hda_codec * codec )
6038
6038
{
@@ -6070,26 +6070,26 @@ int snd_hda_gen_init(struct hda_codec *codec)
6070
6070
EXPORT_SYMBOL_GPL (snd_hda_gen_init );
6071
6071
6072
6072
/**
6073
- * snd_hda_gen_free - free the generic spec
6073
+ * snd_hda_gen_remove - free the generic spec
6074
6074
* @codec: the HDA codec
6075
6075
*
6076
- * This can be put as patch_ops free function.
6076
+ * This can be put as hda_codec_ops remove function.
6077
6077
*/
6078
- void snd_hda_gen_free (struct hda_codec * codec )
6078
+ void snd_hda_gen_remove (struct hda_codec * codec )
6079
6079
{
6080
6080
snd_hda_apply_fixup (codec , HDA_FIXUP_ACT_FREE );
6081
6081
snd_hda_gen_spec_free (codec -> spec );
6082
6082
kfree (codec -> spec );
6083
6083
codec -> spec = NULL ;
6084
6084
}
6085
- EXPORT_SYMBOL_GPL (snd_hda_gen_free );
6085
+ EXPORT_SYMBOL_GPL (snd_hda_gen_remove );
6086
6086
6087
6087
/**
6088
6088
* snd_hda_gen_check_power_status - check the loopback power save state
6089
6089
* @codec: the HDA codec
6090
6090
* @nid: NID to inspect
6091
6091
*
6092
- * This can be put as patch_ops check_power_status function.
6092
+ * This can be put as hda_codec_ops check_power_status function.
6093
6093
*/
6094
6094
int snd_hda_gen_check_power_status (struct hda_codec * codec , hda_nid_t nid )
6095
6095
{
@@ -6112,11 +6112,8 @@ static const struct hda_codec_ops generic_patch_ops = {
6112
6112
.check_power_status = snd_hda_gen_check_power_status ,
6113
6113
};
6114
6114
6115
- /*
6116
- * snd_hda_parse_generic_codec - Generic codec parser
6117
- * @codec: the HDA codec
6118
- */
6119
- static int snd_hda_parse_generic_codec (struct hda_codec * codec )
6115
+ static int snd_hda_gen_probe (struct hda_codec * codec ,
6116
+ const struct hda_device_id * id )
6120
6117
{
6121
6118
struct hda_gen_spec * spec ;
6122
6119
int err ;
@@ -6139,19 +6136,31 @@ static int snd_hda_parse_generic_codec(struct hda_codec *codec)
6139
6136
return 0 ;
6140
6137
6141
6138
error :
6142
- snd_hda_gen_free (codec );
6139
+ snd_hda_gen_remove (codec );
6143
6140
return err ;
6144
6141
}
6145
6142
6143
+ static const struct hda_codec_ops generic_codec_ops = {
6144
+ .probe = snd_hda_gen_probe ,
6145
+ .remove = snd_hda_gen_remove ,
6146
+ .build_controls = snd_hda_gen_build_controls ,
6147
+ .build_pcms = snd_hda_gen_build_pcms ,
6148
+ .init = snd_hda_gen_init ,
6149
+ .unsol_event = snd_hda_jack_unsol_event ,
6150
+ .check_power_status = snd_hda_gen_check_power_status ,
6151
+ .stream_pm = snd_hda_gen_stream_pm ,
6152
+ };
6153
+
6146
6154
static const struct hda_device_id snd_hda_id_generic [] = {
6147
- HDA_CODEC_ENTRY (0x1af40021 , "Generic" , snd_hda_parse_generic_codec ), /* QEMU */
6148
- HDA_CODEC_ENTRY (HDA_CODEC_ID_GENERIC , "Generic" , snd_hda_parse_generic_codec ),
6155
+ HDA_CODEC_ID (0x1af40021 , "Generic" ), /* QEMU */
6156
+ HDA_CODEC_ID (HDA_CODEC_ID_GENERIC , "Generic" ),
6149
6157
{} /* terminator */
6150
6158
};
6151
6159
MODULE_DEVICE_TABLE (hdaudio , snd_hda_id_generic );
6152
6160
6153
6161
static struct hda_codec_driver generic_driver = {
6154
6162
.id = snd_hda_id_generic ,
6163
+ .ops = & generic_codec_ops ,
6155
6164
};
6156
6165
6157
6166
module_hda_codec_driver (generic_driver );
0 commit comments