Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: hda - add hda_intel_trace.h

This patch creates hda_intel_trace.h to add some pm trace functions
used in hda_intel.c

Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Libin Yang and committed by
Takashi Iwai
785d8c4b 18486508

+63
+1
sound/pci/hda/Makefile
··· 11 11 12 12 # for trace-points 13 13 CFLAGS_hda_controller.o := -I$(src) 14 + CFLAGS_hda_intel.o := -I$(src) 14 15 15 16 snd-hda-codec-generic-objs := hda_generic.o 16 17 snd-hda-codec-realtek-objs := patch_realtek.o
+9
sound/pci/hda/hda_intel.c
··· 64 64 #include "hda_controller.h" 65 65 #include "hda_intel.h" 66 66 67 + #define CREATE_TRACE_POINTS 68 + #include "hda_intel_trace.h" 69 + 67 70 /* position fix mode */ 68 71 enum { 69 72 POS_FIX_AUTO, ··· 834 831 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL 835 832 && hda->need_i915_power) 836 833 hda_display_power(hda, false); 834 + 835 + trace_azx_suspend(chip); 837 836 return 0; 838 837 } 839 838 ··· 869 864 hda_intel_init_chip(chip, true); 870 865 871 866 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 867 + 868 + trace_azx_resume(chip); 872 869 return 0; 873 870 } 874 871 #endif /* CONFIG_PM_SLEEP || SUPPORT_VGA_SWITCHEROO */ ··· 904 897 && hda->need_i915_power) 905 898 hda_display_power(hda, false); 906 899 900 + trace_azx_runtime_suspend(chip); 907 901 return 0; 908 902 } 909 903 ··· 953 945 azx_writew(chip, WAKEEN, azx_readw(chip, WAKEEN) & 954 946 ~STATESTS_INT_MASK); 955 947 948 + trace_azx_runtime_resume(chip); 956 949 return 0; 957 950 } 958 951
+53
sound/pci/hda/hda_intel_trace.h
··· 1 + #undef TRACE_SYSTEM 2 + #define TRACE_SYSTEM hda_intel 3 + #define TRACE_INCLUDE_FILE hda_intel_trace 4 + 5 + #if !defined(_TRACE_HDA_INTEL_H) || defined(TRACE_HEADER_MULTI_READ) 6 + #define _TRACE_HDA_INTEL_H 7 + 8 + #include <linux/tracepoint.h> 9 + 10 + DECLARE_EVENT_CLASS(hda_pm, 11 + TP_PROTO(struct azx *chip), 12 + 13 + TP_ARGS(chip), 14 + 15 + TP_STRUCT__entry( 16 + __field(int, dev_index) 17 + ), 18 + 19 + TP_fast_assign( 20 + __entry->dev_index = (chip)->dev_index; 21 + ), 22 + 23 + TP_printk("card index: %d", __entry->dev_index) 24 + ); 25 + 26 + DEFINE_EVENT(hda_pm, azx_suspend, 27 + TP_PROTO(struct azx *chip), 28 + TP_ARGS(chip) 29 + ); 30 + 31 + DEFINE_EVENT(hda_pm, azx_resume, 32 + TP_PROTO(struct azx *chip), 33 + TP_ARGS(chip) 34 + ); 35 + 36 + #ifdef CONFIG_PM 37 + DEFINE_EVENT(hda_pm, azx_runtime_suspend, 38 + TP_PROTO(struct azx *chip), 39 + TP_ARGS(chip) 40 + ); 41 + 42 + DEFINE_EVENT(hda_pm, azx_runtime_resume, 43 + TP_PROTO(struct azx *chip), 44 + TP_ARGS(chip) 45 + ); 46 + #endif 47 + 48 + #endif /* _TRACE_HDA_INTEL_H */ 49 + 50 + /* This part must be outside protection */ 51 + #undef TRACE_INCLUDE_PATH 52 + #define TRACE_INCLUDE_PATH . 53 + #include <trace/define_trace.h>