sof-priv.h (ee8443050b2bf06d80fdd2c78cc25cae2abdedcd) | sof-priv.h (6955d9512d0ea814f1c2761bef7ad7b3cedf4d68) |
---|---|
1/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ 2/* 3 * This file is provided under a dual BSD/GPLv2 license. When using or 4 * redistributing this file, you may do so under either license. 5 * 6 * Copyright(c) 2018 Intel Corporation. All rights reserved. 7 * 8 * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- 278 unchanged lines hidden (view full) --- 287 int (*machine_register)(struct snd_sof_dev *sdev, 288 void *pdata); /* optional */ 289 void (*machine_unregister)(struct snd_sof_dev *sdev, 290 void *pdata); /* optional */ 291 struct snd_soc_acpi_mach * (*machine_select)(struct snd_sof_dev *sdev); /* optional */ 292 void (*set_mach_params)(struct snd_soc_acpi_mach *mach, 293 struct snd_sof_dev *sdev); /* optional */ 294 | 1/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ 2/* 3 * This file is provided under a dual BSD/GPLv2 license. When using or 4 * redistributing this file, you may do so under either license. 5 * 6 * Copyright(c) 2018 Intel Corporation. All rights reserved. 7 * 8 * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- 278 unchanged lines hidden (view full) --- 287 int (*machine_register)(struct snd_sof_dev *sdev, 288 void *pdata); /* optional */ 289 void (*machine_unregister)(struct snd_sof_dev *sdev, 290 void *pdata); /* optional */ 291 struct snd_soc_acpi_mach * (*machine_select)(struct snd_sof_dev *sdev); /* optional */ 292 void (*set_mach_params)(struct snd_soc_acpi_mach *mach, 293 struct snd_sof_dev *sdev); /* optional */ 294 |
295 /* IPC client ops */ 296 int (*register_ipc_clients)(struct snd_sof_dev *sdev); /* optional */ 297 void (*unregister_ipc_clients)(struct snd_sof_dev *sdev); /* optional */ 298 |
|
295 /* DAI ops */ 296 struct snd_soc_dai_driver *drv; 297 int num_drv; 298 299 /* ALSA HW info flags, will be stored in snd_pcm_runtime.hw.info */ 300 u32 hw_info; 301 302 const struct dsp_arch_ops *dsp_arch_ops; --- 171 unchanged lines hidden (view full) --- 474 * ref count per core that will be modified during system suspend/resume and during pcm 475 * hw_params/hw_free. This doesn't need to be protected with a mutex because pcm 476 * hw_params/hw_free are already protected by the PCM mutex in the ALSA framework in 477 * sound/core/ when streams are active and during system suspend/resume, streams are 478 * already suspended. 479 */ 480 int dsp_core_ref_count[SOF_MAX_DSP_NUM_CORES]; 481 | 299 /* DAI ops */ 300 struct snd_soc_dai_driver *drv; 301 int num_drv; 302 303 /* ALSA HW info flags, will be stored in snd_pcm_runtime.hw.info */ 304 u32 hw_info; 305 306 const struct dsp_arch_ops *dsp_arch_ops; --- 171 unchanged lines hidden (view full) --- 478 * ref count per core that will be modified during system suspend/resume and during pcm 479 * hw_params/hw_free. This doesn't need to be protected with a mutex because pcm 480 * hw_params/hw_free are already protected by the PCM mutex in the ALSA framework in 481 * sound/core/ when streams are active and during system suspend/resume, streams are 482 * already suspended. 483 */ 484 int dsp_core_ref_count[SOF_MAX_DSP_NUM_CORES]; 485 |
486 /* 487 * Used to keep track of registered IPC client devices so that they can 488 * be removed when the parent SOF module is removed. 489 */ 490 struct list_head ipc_client_list; 491 492 /* mutex to protect client list */ 493 struct mutex ipc_client_mutex; 494 495 /* 496 * Used for tracking the IPC client's RX registration for DSP initiated 497 * message handling. 498 */ 499 struct list_head ipc_rx_handler_list; 500 501 /* 502 * Used for tracking the IPC client's registration for DSP state change 503 * notification 504 */ 505 struct list_head fw_state_handler_list; 506 507 /* to protect the ipc_rx_handler_list and dsp_state_handler_list list */ 508 struct mutex client_event_handler_mutex; 509 |
|
482 void *private; /* core does not touch this */ 483}; 484 485/* 486 * Device Level. 487 */ 488 489int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data); --- 87 unchanged lines hidden (view full) --- 577 sof_dsp_arch_ops(sdev)->dsp_oops(sdev, level, oops); 578} 579 580extern const struct dsp_arch_ops sof_xtensa_arch_ops; 581 582/* 583 * Firmware state tracking 584 */ | 510 void *private; /* core does not touch this */ 511}; 512 513/* 514 * Device Level. 515 */ 516 517int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data); --- 87 unchanged lines hidden (view full) --- 605 sof_dsp_arch_ops(sdev)->dsp_oops(sdev, level, oops); 606} 607 608extern const struct dsp_arch_ops sof_xtensa_arch_ops; 609 610/* 611 * Firmware state tracking 612 */ |
585static inline void sof_set_fw_state(struct snd_sof_dev *sdev, 586 enum sof_fw_state new_state) 587{ 588 if (sdev->fw_state == new_state) 589 return; | 613void sof_set_fw_state(struct snd_sof_dev *sdev, enum sof_fw_state new_state); |
590 | 614 |
591 dev_dbg(sdev->dev, "fw_state change: %d -> %d\n", sdev->fw_state, new_state); 592 sdev->fw_state = new_state; 593} 594 | |
595/* 596 * Utilities 597 */ 598void sof_io_write(struct snd_sof_dev *sdev, void __iomem *addr, u32 value); 599void sof_io_write64(struct snd_sof_dev *sdev, void __iomem *addr, u64 value); 600u32 sof_io_read(struct snd_sof_dev *sdev, void __iomem *addr); 601u64 sof_io_read64(struct snd_sof_dev *sdev, void __iomem *addr); 602void sof_mailbox_write(struct snd_sof_dev *sdev, u32 offset, --- 15 unchanged lines hidden (view full) --- 618 const struct sof_ipc_pcm_params_reply *reply); 619 620int sof_stream_pcm_open(struct snd_sof_dev *sdev, 621 struct snd_pcm_substream *substream); 622int sof_stream_pcm_close(struct snd_sof_dev *sdev, 623 struct snd_pcm_substream *substream); 624 625int sof_machine_check(struct snd_sof_dev *sdev); | 615/* 616 * Utilities 617 */ 618void sof_io_write(struct snd_sof_dev *sdev, void __iomem *addr, u32 value); 619void sof_io_write64(struct snd_sof_dev *sdev, void __iomem *addr, u64 value); 620u32 sof_io_read(struct snd_sof_dev *sdev, void __iomem *addr); 621u64 sof_io_read64(struct snd_sof_dev *sdev, void __iomem *addr); 622void sof_mailbox_write(struct snd_sof_dev *sdev, u32 offset, --- 15 unchanged lines hidden (view full) --- 638 const struct sof_ipc_pcm_params_reply *reply); 639 640int sof_stream_pcm_open(struct snd_sof_dev *sdev, 641 struct snd_pcm_substream *substream); 642int sof_stream_pcm_close(struct snd_sof_dev *sdev, 643 struct snd_pcm_substream *substream); 644 645int sof_machine_check(struct snd_sof_dev *sdev); |
646 647/* SOF client support */ 648#if IS_ENABLED(CONFIG_SND_SOC_SOF_CLIENT) 649int sof_client_dev_register(struct snd_sof_dev *sdev, const char *name, u32 id, 650 const void *data, size_t size); 651void sof_client_dev_unregister(struct snd_sof_dev *sdev, const char *name, u32 id); 652int sof_register_clients(struct snd_sof_dev *sdev); 653void sof_unregister_clients(struct snd_sof_dev *sdev); 654void sof_client_ipc_rx_dispatcher(struct snd_sof_dev *sdev, void *msg_buf); 655void sof_client_fw_state_dispatcher(struct snd_sof_dev *sdev); 656#else /* CONFIG_SND_SOC_SOF_CLIENT */ 657static inline int sof_client_dev_register(struct snd_sof_dev *sdev, const char *name, 658 u32 id, const void *data, size_t size) 659{ 660 return 0; 661} 662 663static inline void sof_client_dev_unregister(struct snd_sof_dev *sdev, 664 const char *name, u32 id) 665{ 666} 667 668static inline int sof_register_clients(struct snd_sof_dev *sdev) 669{ 670 return 0; 671} 672 673static inline void sof_unregister_clients(struct snd_sof_dev *sdev) 674{ 675} 676 677static inline void sof_client_ipc_rx_dispatcher(struct snd_sof_dev *sdev, void *msg_buf) 678{ 679} 680 681static inline void sof_client_fw_state_dispatcher(struct snd_sof_dev *sdev) 682{ 683} 684#endif /* CONFIG_SND_SOC_SOF_CLIENT */ 685 |
|
626#endif | 686#endif |