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

firmware: cs_dsp: Switch to using namespaced exports

Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:

Use EXPORT_SYMBOL_NS_GPL() instead of EXPORT_SYMBOL_GPL() and patch the
three drivers that use cs_dsp to add the MODULE_IMPORT_NS().

To make the namespace more specific the KConfig symbol for cs_dsp is
changed from CS_DSP to FW_CS_DSP.

+38 -35
+1 -1
drivers/firmware/cirrus/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 3 - config CS_DSP 3 + config FW_CS_DSP 4 4 tristate 5 5 default n
+1 -1
drivers/firmware/cirrus/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 # 3 - obj-$(CONFIG_CS_DSP) += cs_dsp.o 3 + obj-$(CONFIG_FW_CS_DSP) += cs_dsp.o
+31 -31
drivers/firmware/cirrus/cs_dsp.c
··· 369 369 return NULL; 370 370 } 371 371 } 372 - EXPORT_SYMBOL_GPL(cs_dsp_mem_region_name); 372 + EXPORT_SYMBOL_NS_GPL(cs_dsp_mem_region_name, FW_CS_DSP); 373 373 374 374 #ifdef CONFIG_DEBUG_FS 375 375 static void cs_dsp_debugfs_save_wmfwname(struct cs_dsp *dsp, const char *s) ··· 480 480 481 481 dsp->debugfs_root = root; 482 482 } 483 - EXPORT_SYMBOL_GPL(cs_dsp_init_debugfs); 483 + EXPORT_SYMBOL_NS_GPL(cs_dsp_init_debugfs, FW_CS_DSP); 484 484 485 485 /** 486 486 * cs_dsp_cleanup_debugfs() - Removes DSP representation from debugfs ··· 492 492 debugfs_remove_recursive(dsp->debugfs_root); 493 493 dsp->debugfs_root = NULL; 494 494 } 495 - EXPORT_SYMBOL_GPL(cs_dsp_cleanup_debugfs); 495 + EXPORT_SYMBOL_NS_GPL(cs_dsp_cleanup_debugfs, FW_CS_DSP); 496 496 #else 497 497 void cs_dsp_init_debugfs(struct cs_dsp *dsp, struct dentry *debugfs_root) 498 498 { 499 499 } 500 - EXPORT_SYMBOL_GPL(cs_dsp_init_debugfs); 500 + EXPORT_SYMBOL_NS_GPL(cs_dsp_init_debugfs, FW_CS_DSP); 501 501 502 502 void cs_dsp_cleanup_debugfs(struct cs_dsp *dsp) 503 503 { 504 504 } 505 - EXPORT_SYMBOL_GPL(cs_dsp_cleanup_debugfs); 505 + EXPORT_SYMBOL_NS_GPL(cs_dsp_cleanup_debugfs, FW_CS_DSP); 506 506 507 507 static inline void cs_dsp_debugfs_save_wmfwname(struct cs_dsp *dsp, 508 508 const char *s) ··· 710 710 711 711 return -ETIMEDOUT; 712 712 } 713 - EXPORT_SYMBOL_GPL(cs_dsp_coeff_write_acked_control); 713 + EXPORT_SYMBOL_NS_GPL(cs_dsp_coeff_write_acked_control, FW_CS_DSP); 714 714 715 715 static int cs_dsp_coeff_write_ctrl_raw(struct cs_dsp_coeff_ctl *ctl, 716 716 unsigned int off, const void *buf, size_t len) ··· 785 785 786 786 return 1; 787 787 } 788 - EXPORT_SYMBOL_GPL(cs_dsp_coeff_write_ctrl); 788 + EXPORT_SYMBOL_NS_GPL(cs_dsp_coeff_write_ctrl, FW_CS_DSP); 789 789 790 790 static int cs_dsp_coeff_read_ctrl_raw(struct cs_dsp_coeff_ctl *ctl, 791 791 unsigned int off, void *buf, size_t len) ··· 857 857 858 858 return ret; 859 859 } 860 - EXPORT_SYMBOL_GPL(cs_dsp_coeff_read_ctrl); 860 + EXPORT_SYMBOL_NS_GPL(cs_dsp_coeff_read_ctrl, FW_CS_DSP); 861 861 862 862 static int cs_dsp_coeff_init_control_caches(struct cs_dsp *dsp) 863 863 { ··· 1500 1500 1501 1501 return rslt; 1502 1502 } 1503 - EXPORT_SYMBOL_GPL(cs_dsp_get_ctl); 1503 + EXPORT_SYMBOL_NS_GPL(cs_dsp_get_ctl, FW_CS_DSP); 1504 1504 1505 1505 static void cs_dsp_ctl_fixup_base(struct cs_dsp *dsp, 1506 1506 const struct cs_dsp_alg_region *alg_region) ··· 1590 1590 1591 1591 return NULL; 1592 1592 } 1593 - EXPORT_SYMBOL_GPL(cs_dsp_find_alg_region); 1593 + EXPORT_SYMBOL_NS_GPL(cs_dsp_find_alg_region, FW_CS_DSP); 1594 1594 1595 1595 static struct cs_dsp_alg_region *cs_dsp_create_region(struct cs_dsp *dsp, 1596 1596 int type, __be32 id, ··· 2224 2224 2225 2225 return cs_dsp_common_init(dsp); 2226 2226 } 2227 - EXPORT_SYMBOL_GPL(cs_dsp_adsp1_init); 2227 + EXPORT_SYMBOL_NS_GPL(cs_dsp_adsp1_init, FW_CS_DSP); 2228 2228 2229 2229 /** 2230 2230 * cs_dsp_adsp1_power_up() - Load and start the named firmware ··· 2316 2316 mutex_unlock(&dsp->pwr_lock); 2317 2317 return ret; 2318 2318 } 2319 - EXPORT_SYMBOL_GPL(cs_dsp_adsp1_power_up); 2319 + EXPORT_SYMBOL_NS_GPL(cs_dsp_adsp1_power_up, FW_CS_DSP); 2320 2320 2321 2321 /** 2322 2322 * cs_dsp_adsp1_power_down() - Halts the DSP ··· 2348 2348 2349 2349 mutex_unlock(&dsp->pwr_lock); 2350 2350 } 2351 - EXPORT_SYMBOL_GPL(cs_dsp_adsp1_power_down); 2351 + EXPORT_SYMBOL_NS_GPL(cs_dsp_adsp1_power_down, FW_CS_DSP); 2352 2352 2353 2353 static int cs_dsp_adsp2v2_enable_core(struct cs_dsp *dsp) 2354 2354 { ··· 2500 2500 2501 2501 return ret; 2502 2502 } 2503 - EXPORT_SYMBOL_GPL(cs_dsp_set_dspclk); 2503 + EXPORT_SYMBOL_NS_GPL(cs_dsp_set_dspclk, FW_CS_DSP); 2504 2504 2505 2505 static void cs_dsp_stop_watchdog(struct cs_dsp *dsp) 2506 2506 { ··· 2590 2590 2591 2591 return ret; 2592 2592 } 2593 - EXPORT_SYMBOL_GPL(cs_dsp_power_up); 2593 + EXPORT_SYMBOL_NS_GPL(cs_dsp_power_up, FW_CS_DSP); 2594 2594 2595 2595 /** 2596 2596 * cs_dsp_power_down() - Powers-down the DSP ··· 2624 2624 2625 2625 cs_dsp_dbg(dsp, "Shutdown complete\n"); 2626 2626 } 2627 - EXPORT_SYMBOL_GPL(cs_dsp_power_down); 2627 + EXPORT_SYMBOL_NS_GPL(cs_dsp_power_down, FW_CS_DSP); 2628 2628 2629 2629 static int cs_dsp_adsp2_start_core(struct cs_dsp *dsp) 2630 2630 { ··· 2710 2710 2711 2711 return ret; 2712 2712 } 2713 - EXPORT_SYMBOL_GPL(cs_dsp_run); 2713 + EXPORT_SYMBOL_NS_GPL(cs_dsp_run, FW_CS_DSP); 2714 2714 2715 2715 /** 2716 2716 * cs_dsp_stop() - Stops the firmware ··· 2749 2749 2750 2750 cs_dsp_dbg(dsp, "Execution stopped\n"); 2751 2751 } 2752 - EXPORT_SYMBOL_GPL(cs_dsp_stop); 2752 + EXPORT_SYMBOL_NS_GPL(cs_dsp_stop, FW_CS_DSP); 2753 2753 2754 2754 static int cs_dsp_halo_start_core(struct cs_dsp *dsp) 2755 2755 { ··· 2811 2811 2812 2812 return cs_dsp_common_init(dsp); 2813 2813 } 2814 - EXPORT_SYMBOL_GPL(cs_dsp_adsp2_init); 2814 + EXPORT_SYMBOL_NS_GPL(cs_dsp_adsp2_init, FW_CS_DSP); 2815 2815 2816 2816 /** 2817 2817 * cs_dsp_halo_init() - Initialise a cs_dsp structure representing a HALO Core DSP ··· 2825 2825 2826 2826 return cs_dsp_common_init(dsp); 2827 2827 } 2828 - EXPORT_SYMBOL_GPL(cs_dsp_halo_init); 2828 + EXPORT_SYMBOL_NS_GPL(cs_dsp_halo_init, FW_CS_DSP); 2829 2829 2830 2830 /** 2831 2831 * cs_dsp_remove() - Clean a cs_dsp before deletion ··· 2845 2845 cs_dsp_free_ctl_blk(ctl); 2846 2846 } 2847 2847 } 2848 - EXPORT_SYMBOL_GPL(cs_dsp_remove); 2848 + EXPORT_SYMBOL_NS_GPL(cs_dsp_remove, FW_CS_DSP); 2849 2849 2850 2850 /** 2851 2851 * cs_dsp_read_raw_data_block() - Reads a block of data from DSP memory ··· 2882 2882 2883 2883 return 0; 2884 2884 } 2885 - EXPORT_SYMBOL_GPL(cs_dsp_read_raw_data_block); 2885 + EXPORT_SYMBOL_NS_GPL(cs_dsp_read_raw_data_block, FW_CS_DSP); 2886 2886 2887 2887 /** 2888 2888 * cs_dsp_read_data_word() - Reads a word from DSP memory ··· 2906 2906 2907 2907 return 0; 2908 2908 } 2909 - EXPORT_SYMBOL_GPL(cs_dsp_read_data_word); 2909 + EXPORT_SYMBOL_NS_GPL(cs_dsp_read_data_word, FW_CS_DSP); 2910 2910 2911 2911 /** 2912 2912 * cs_dsp_write_data_word() - Writes a word to DSP memory ··· 2932 2932 2933 2933 return regmap_raw_write(dsp->regmap, reg, &val, sizeof(val)); 2934 2934 } 2935 - EXPORT_SYMBOL_GPL(cs_dsp_write_data_word); 2935 + EXPORT_SYMBOL_NS_GPL(cs_dsp_write_data_word, FW_CS_DSP); 2936 2936 2937 2937 /** 2938 2938 * cs_dsp_remove_padding() - Convert unpacked words to packed bytes ··· 2956 2956 *pack_out++ = (u8)(word >> 16); 2957 2957 } 2958 2958 } 2959 - EXPORT_SYMBOL_GPL(cs_dsp_remove_padding); 2959 + EXPORT_SYMBOL_NS_GPL(cs_dsp_remove_padding, FW_CS_DSP); 2960 2960 2961 2961 /** 2962 2962 * cs_dsp_adsp2_bus_error() - Handle a DSP bus error interrupt ··· 3026 3026 error: 3027 3027 mutex_unlock(&dsp->pwr_lock); 3028 3028 } 3029 - EXPORT_SYMBOL_GPL(cs_dsp_adsp2_bus_error); 3029 + EXPORT_SYMBOL_NS_GPL(cs_dsp_adsp2_bus_error, FW_CS_DSP); 3030 3030 3031 3031 /** 3032 3032 * cs_dsp_halo_bus_error() - Handle a DSP bus error interrupt ··· 3086 3086 exit_unlock: 3087 3087 mutex_unlock(&dsp->pwr_lock); 3088 3088 } 3089 - EXPORT_SYMBOL_GPL(cs_dsp_halo_bus_error); 3089 + EXPORT_SYMBOL_NS_GPL(cs_dsp_halo_bus_error, FW_CS_DSP); 3090 3090 3091 3091 /** 3092 3092 * cs_dsp_halo_wdt_expire() - Handle DSP watchdog expiry ··· 3106 3106 3107 3107 mutex_unlock(&dsp->pwr_lock); 3108 3108 } 3109 - EXPORT_SYMBOL_GPL(cs_dsp_halo_wdt_expire); 3109 + EXPORT_SYMBOL_NS_GPL(cs_dsp_halo_wdt_expire, FW_CS_DSP); 3110 3110 3111 3111 static const struct cs_dsp_ops cs_dsp_adsp1_ops = { 3112 3112 .validate_version = cs_dsp_validate_version, ··· 3228 3228 3229 3229 return 0; 3230 3230 } 3231 - EXPORT_SYMBOL_GPL(cs_dsp_chunk_write); 3231 + EXPORT_SYMBOL_NS_GPL(cs_dsp_chunk_write, FW_CS_DSP); 3232 3232 3233 3233 /** 3234 3234 * cs_dsp_chunk_flush() - Pad remaining data with zero and commit to chunk ··· 3247 3247 3248 3248 return cs_dsp_chunk_write(ch, CS_DSP_DATA_WORD_BITS - ch->cachebits, 0); 3249 3249 } 3250 - EXPORT_SYMBOL_GPL(cs_dsp_chunk_flush); 3250 + EXPORT_SYMBOL_NS_GPL(cs_dsp_chunk_flush, FW_CS_DSP); 3251 3251 3252 3252 /** 3253 3253 * cs_dsp_chunk_read() - Parse data from a DSP memory chunk ··· 3289 3289 3290 3290 return result; 3291 3291 } 3292 - EXPORT_SYMBOL_GPL(cs_dsp_chunk_read); 3292 + EXPORT_SYMBOL_NS_GPL(cs_dsp_chunk_read, FW_CS_DSP); 3293 3293 3294 3294 MODULE_DESCRIPTION("Cirrus Logic DSP Support"); 3295 3295 MODULE_AUTHOR("Simon Trimmer <simont@opensource.cirrus.com>");
+1 -1
sound/pci/hda/Kconfig
··· 98 98 99 99 config SND_HDA_CS_DSP_CONTROLS 100 100 tristate 101 - select CS_DSP 101 + select FW_CS_DSP 102 102 103 103 config SND_HDA_SCODEC_CS35L41_I2C 104 104 tristate "Build CS35L41 HD-audio side codec support for I2C Bus"
+1
sound/pci/hda/cs35l41_hda.c
··· 1545 1545 MODULE_IMPORT_NS(SND_HDA_CS_DSP_CONTROLS); 1546 1546 MODULE_AUTHOR("Lucas Tanure, Cirrus Logic Inc, <tanureal@opensource.cirrus.com>"); 1547 1547 MODULE_LICENSE("GPL"); 1548 + MODULE_IMPORT_NS(FW_CS_DSP);
+1
sound/pci/hda/hda_cs_dsp_ctl.c
··· 249 249 MODULE_DESCRIPTION("CS_DSP ALSA Control HDA Library"); 250 250 MODULE_AUTHOR("Stefan Binding, <sbinding@opensource.cirrus.com>"); 251 251 MODULE_LICENSE("GPL"); 252 + MODULE_IMPORT_NS(FW_CS_DSP);
+1 -1
sound/soc/codecs/Kconfig
··· 349 349 350 350 config SND_SOC_WM_ADSP 351 351 tristate 352 - select CS_DSP 352 + select FW_CS_DSP 353 353 select SND_SOC_COMPRESS 354 354 default y if SND_SOC_MADERA=y 355 355 default y if SND_SOC_CS47L24=y
+1
sound/soc/codecs/wm_adsp.c
··· 2069 2069 }; 2070 2070 2071 2071 MODULE_LICENSE("GPL v2"); 2072 + MODULE_IMPORT_NS(FW_CS_DSP);