Loading sound/pci/hda/hda_hwdep.c +20 −0 Original line number Diff line number Diff line Loading @@ -644,6 +644,26 @@ int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key) } EXPORT_SYMBOL_HDA(snd_hda_get_bool_hint); int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp) { const char *p; unsigned long val; int ret; mutex_lock(&codec->user_mutex); p = snd_hda_get_hint(codec, key); if (!p) ret = -ENOENT; else if (strict_strtoul(p, 0, &val)) ret = -EINVAL; else { *valp = val; ret = 0; } mutex_unlock(&codec->user_mutex); return ret; } EXPORT_SYMBOL_HDA(snd_hda_get_int_hint); #endif /* CONFIG_SND_HDA_RECONFIG */ #ifdef CONFIG_SND_HDA_PATCH_LOADER Loading sound/pci/hda/hda_local.h +7 −0 Original line number Diff line number Diff line Loading @@ -618,6 +618,7 @@ static inline int snd_hda_hwdep_add_sysfs(struct hda_codec *codec) #ifdef CONFIG_SND_HDA_RECONFIG const char *snd_hda_get_hint(struct hda_codec *codec, const char *key); int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key); int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp); #else static inline const char *snd_hda_get_hint(struct hda_codec *codec, const char *key) Loading @@ -630,6 +631,12 @@ int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key) { return -ENOENT; } static inline int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp) { return -ENOENT; } #endif /* Loading sound/pci/hda/patch_sigmatel.c +4 −18 Original line number Diff line number Diff line Loading @@ -4295,24 +4295,10 @@ static void stac92xx_power_down(struct hda_codec *codec) static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid, int enable); static inline int get_int_hint(struct hda_codec *codec, const char *key, static inline bool get_int_hint(struct hda_codec *codec, const char *key, int *valp) { #ifdef CONFIG_SND_HDA_RECONFIG const char *p; mutex_lock(&codec->user_mutex); p = snd_hda_get_hint(codec, key); if (p) { unsigned long val; if (!strict_strtoul(p, 0, &val)) { *valp = val; mutex_unlock(&codec->user_mutex); return 1; } } mutex_unlock(&codec->user_mutex); #endif return 0; return !snd_hda_get_int_hint(codec, key, valp); } /* override some hints from the hwdep entry */ Loading Loading
sound/pci/hda/hda_hwdep.c +20 −0 Original line number Diff line number Diff line Loading @@ -644,6 +644,26 @@ int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key) } EXPORT_SYMBOL_HDA(snd_hda_get_bool_hint); int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp) { const char *p; unsigned long val; int ret; mutex_lock(&codec->user_mutex); p = snd_hda_get_hint(codec, key); if (!p) ret = -ENOENT; else if (strict_strtoul(p, 0, &val)) ret = -EINVAL; else { *valp = val; ret = 0; } mutex_unlock(&codec->user_mutex); return ret; } EXPORT_SYMBOL_HDA(snd_hda_get_int_hint); #endif /* CONFIG_SND_HDA_RECONFIG */ #ifdef CONFIG_SND_HDA_PATCH_LOADER Loading
sound/pci/hda/hda_local.h +7 −0 Original line number Diff line number Diff line Loading @@ -618,6 +618,7 @@ static inline int snd_hda_hwdep_add_sysfs(struct hda_codec *codec) #ifdef CONFIG_SND_HDA_RECONFIG const char *snd_hda_get_hint(struct hda_codec *codec, const char *key); int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key); int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp); #else static inline const char *snd_hda_get_hint(struct hda_codec *codec, const char *key) Loading @@ -630,6 +631,12 @@ int snd_hda_get_bool_hint(struct hda_codec *codec, const char *key) { return -ENOENT; } static inline int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp) { return -ENOENT; } #endif /* Loading
sound/pci/hda/patch_sigmatel.c +4 −18 Original line number Diff line number Diff line Loading @@ -4295,24 +4295,10 @@ static void stac92xx_power_down(struct hda_codec *codec) static void stac_toggle_power_map(struct hda_codec *codec, hda_nid_t nid, int enable); static inline int get_int_hint(struct hda_codec *codec, const char *key, static inline bool get_int_hint(struct hda_codec *codec, const char *key, int *valp) { #ifdef CONFIG_SND_HDA_RECONFIG const char *p; mutex_lock(&codec->user_mutex); p = snd_hda_get_hint(codec, key); if (p) { unsigned long val; if (!strict_strtoul(p, 0, &val)) { *valp = val; mutex_unlock(&codec->user_mutex); return 1; } } mutex_unlock(&codec->user_mutex); #endif return 0; return !snd_hda_get_int_hint(codec, key, valp); } /* override some hints from the hwdep entry */ Loading