File: wcd-common.h

package info (click to toggle)
linux 6.18.12-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,742,348 kB
  • sloc: ansic: 26,784,619; asm: 272,099; sh: 148,799; python: 79,242; makefile: 57,743; perl: 36,527; xml: 19,542; cpp: 5,911; yacc: 4,939; lex: 2,950; awk: 1,607; sed: 30; ruby: 25
file content (46 lines) | stat: -rw-r--r-- 1,198 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2025, Qualcomm Technologies, Inc. and/or its subsidiaries.
 */

#ifndef __WCD_COMMON_H__
#define __WCD_COMMON_H__

struct device;
struct sdw_slave;
struct sdw_bus_params;
struct irq_domain;
enum sdw_slave_status;

#define WCD_MAX_MICBIAS		4

struct wcd_sdw_ch_info {
	int port_num;
	unsigned int ch_mask;
	unsigned int master_ch_mask;
};

#define WCD_SDW_CH(id, pn, cmask)	\
	[id] = {			\
		.port_num = pn,		\
		.ch_mask = cmask,	\
		.master_ch_mask = cmask,	\
	}

struct wcd_common {
	struct device *dev;
	int max_bias;
	u32 micb_mv[WCD_MAX_MICBIAS];
	u32 micb_vout[WCD_MAX_MICBIAS];
};

extern const struct component_ops wcd_sdw_component_ops;
int wcd_get_micb_vout_ctl_val(struct device *dev, u32 micb_mv);
int wcd_dt_parse_micbias_info(struct wcd_common *common);
int wcd_update_status(struct sdw_slave *slave, enum sdw_slave_status status);
int wcd_bus_config(struct sdw_slave *slave, struct sdw_bus_params *params);
int wcd_interrupt_callback(struct sdw_slave *slave, struct irq_domain *slave_irq,
		unsigned int wcd_intr_status0, unsigned int wcd_intr_status1,
		unsigned int wcd_intr_status2);

#endif /* __WCD_COMMON_H__  */