2022-02-26 23:39:18 +05:30
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, The Linux Foundation. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LPASS_MACRO_COMMON_H__
|
|
|
|
#define __LPASS_MACRO_COMMON_H__
|
|
|
|
|
2023-03-13 08:54:39 +01:00
|
|
|
/* NPL clock is expected */
|
|
|
|
#define LPASS_MACRO_FLAG_HAS_NPL_CLOCK BIT(0)
|
2023-08-25 19:23:13 +02:00
|
|
|
/* The soundwire block should be internally reset at probe */
|
|
|
|
#define LPASS_MACRO_FLAG_RESET_SWR BIT(1)
|
2023-03-13 08:54:39 +01:00
|
|
|
|
2024-02-26 12:59:24 +01:00
|
|
|
enum lpass_version {
|
|
|
|
LPASS_VER_9_0_0,
|
2024-02-26 12:59:25 +01:00
|
|
|
LPASS_VER_9_2_0,
|
2024-02-26 12:59:24 +01:00
|
|
|
LPASS_VER_10_0_0,
|
|
|
|
LPASS_VER_11_0_0,
|
|
|
|
};
|
|
|
|
|
2024-06-13 11:49:31 +01:00
|
|
|
enum lpass_codec_version {
|
2024-06-25 18:57:35 +02:00
|
|
|
LPASS_CODEC_VERSION_UNKNOWN,
|
|
|
|
LPASS_CODEC_VERSION_1_0,
|
2024-06-13 11:49:31 +01:00
|
|
|
LPASS_CODEC_VERSION_1_1,
|
|
|
|
LPASS_CODEC_VERSION_1_2,
|
|
|
|
LPASS_CODEC_VERSION_2_0,
|
|
|
|
LPASS_CODEC_VERSION_2_1,
|
|
|
|
LPASS_CODEC_VERSION_2_5,
|
|
|
|
LPASS_CODEC_VERSION_2_6,
|
|
|
|
LPASS_CODEC_VERSION_2_7,
|
|
|
|
LPASS_CODEC_VERSION_2_8,
|
|
|
|
};
|
|
|
|
|
2022-02-26 23:39:18 +05:30
|
|
|
struct lpass_macro {
|
|
|
|
struct device *macro_pd;
|
|
|
|
struct device *dcodec_pd;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct lpass_macro *lpass_macro_pds_init(struct device *dev);
|
|
|
|
void lpass_macro_pds_exit(struct lpass_macro *pds);
|
2024-06-25 18:57:36 +02:00
|
|
|
void lpass_macro_set_codec_version(enum lpass_codec_version version);
|
|
|
|
enum lpass_codec_version lpass_macro_get_codec_version(void);
|
2024-06-13 11:49:31 +01:00
|
|
|
|
2024-07-01 09:39:33 +02:00
|
|
|
static inline void lpass_macro_pds_exit_action(void *pds)
|
|
|
|
{
|
|
|
|
lpass_macro_pds_exit(pds);
|
|
|
|
}
|
|
|
|
|
2024-06-13 11:49:31 +01:00
|
|
|
static inline const char *lpass_macro_get_codec_version_string(int version)
|
|
|
|
{
|
|
|
|
switch (version) {
|
2024-08-03 13:41:40 +03:00
|
|
|
case LPASS_CODEC_VERSION_1_0:
|
|
|
|
return "v1.0";
|
|
|
|
case LPASS_CODEC_VERSION_1_1:
|
|
|
|
return "v1.1";
|
|
|
|
case LPASS_CODEC_VERSION_1_2:
|
|
|
|
return "v1.2";
|
2024-06-13 11:49:31 +01:00
|
|
|
case LPASS_CODEC_VERSION_2_0:
|
|
|
|
return "v2.0";
|
|
|
|
case LPASS_CODEC_VERSION_2_1:
|
|
|
|
return "v2.1";
|
|
|
|
case LPASS_CODEC_VERSION_2_5:
|
|
|
|
return "v2.5";
|
|
|
|
case LPASS_CODEC_VERSION_2_6:
|
|
|
|
return "v2.6";
|
|
|
|
case LPASS_CODEC_VERSION_2_7:
|
|
|
|
return "v2.7";
|
|
|
|
case LPASS_CODEC_VERSION_2_8:
|
|
|
|
return "v2.8";
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return "NA";
|
|
|
|
}
|
2022-02-26 23:39:18 +05:30
|
|
|
|
|
|
|
#endif /* __LPASS_MACRO_COMMON_H__ */
|