122851890Sopenharmony_cidiff --git a/include/drm/bridge/analogix_dp.h b/include/drm/bridge/analogix_dp.h
222851890Sopenharmony_ciindex b0dcc0733..291eb8787 100644
322851890Sopenharmony_ci--- a/include/drm/bridge/analogix_dp.h
422851890Sopenharmony_ci+++ b/include/drm/bridge/analogix_dp.h
522851890Sopenharmony_ci@@ -8,6 +8,7 @@
622851890Sopenharmony_ci #define _ANALOGIX_DP_H_
722851890Sopenharmony_ci 
822851890Sopenharmony_ci #include <drm/drm_crtc.h>
922851890Sopenharmony_ci+#include <sound/hdmi-codec.h>
1022851890Sopenharmony_ci 
1122851890Sopenharmony_ci struct analogix_dp_device;
1222851890Sopenharmony_ci 
1322851890Sopenharmony_ci@@ -25,21 +26,32 @@ static inline bool is_rockchip(enum analogix_dp_devtype type)
1422851890Sopenharmony_ci struct analogix_dp_plat_data {
1522851890Sopenharmony_ci 	enum analogix_dp_devtype dev_type;
1622851890Sopenharmony_ci 	struct drm_panel *panel;
1722851890Sopenharmony_ci+	struct drm_bridge *bridge;
1822851890Sopenharmony_ci 	struct drm_encoder *encoder;
1922851890Sopenharmony_ci 	struct drm_connector *connector;
2022851890Sopenharmony_ci 	bool skip_connector;
2122851890Sopenharmony_ci+	bool ssc;
2222851890Sopenharmony_ci+
2322851890Sopenharmony_ci+	bool split_mode;
2422851890Sopenharmony_ci+	struct analogix_dp_device *left;
2522851890Sopenharmony_ci+	struct analogix_dp_device *right;
2622851890Sopenharmony_ci 
2722851890Sopenharmony_ci 	int (*power_on_start)(struct analogix_dp_plat_data *);
2822851890Sopenharmony_ci 	int (*power_on_end)(struct analogix_dp_plat_data *);
2922851890Sopenharmony_ci 	int (*power_off)(struct analogix_dp_plat_data *);
3022851890Sopenharmony_ci 	int (*attach)(struct analogix_dp_plat_data *, struct drm_bridge *,
3122851890Sopenharmony_ci 		      struct drm_connector *);
3222851890Sopenharmony_ci+	void (*detach)(struct analogix_dp_plat_data *, struct drm_bridge *);
3322851890Sopenharmony_ci 	int (*get_modes)(struct analogix_dp_plat_data *,
3422851890Sopenharmony_ci 			 struct drm_connector *);
3522851890Sopenharmony_ci+	void (*convert_to_split_mode)(struct drm_display_mode *);
3622851890Sopenharmony_ci+	void (*convert_to_origin_mode)(struct drm_display_mode *);
3722851890Sopenharmony_ci };
3822851890Sopenharmony_ci 
3922851890Sopenharmony_ci int analogix_dp_resume(struct analogix_dp_device *dp);
4022851890Sopenharmony_ci int analogix_dp_suspend(struct analogix_dp_device *dp);
4122851890Sopenharmony_ci+int analogix_dp_runtime_resume(struct analogix_dp_device *dp);
4222851890Sopenharmony_ci+int analogix_dp_runtime_suspend(struct analogix_dp_device *dp);
4322851890Sopenharmony_ci 
4422851890Sopenharmony_ci struct analogix_dp_device *
4522851890Sopenharmony_ci analogix_dp_probe(struct device *dev, struct analogix_dp_plat_data *plat_data);
4622851890Sopenharmony_ci@@ -50,4 +62,13 @@ void analogix_dp_remove(struct analogix_dp_device *dp);
4722851890Sopenharmony_ci int analogix_dp_start_crc(struct drm_connector *connector);
4822851890Sopenharmony_ci int analogix_dp_stop_crc(struct drm_connector *connector);
4922851890Sopenharmony_ci 
5022851890Sopenharmony_ci+int analogix_dp_audio_hw_params(struct analogix_dp_device *dp,
5122851890Sopenharmony_ci+				struct hdmi_codec_daifmt *daifmt,
5222851890Sopenharmony_ci+				struct hdmi_codec_params *params);
5322851890Sopenharmony_ci+void analogix_dp_audio_shutdown(struct analogix_dp_device *dp);
5422851890Sopenharmony_ci+int analogix_dp_audio_startup(struct analogix_dp_device *dp);
5522851890Sopenharmony_ci+int analogix_dp_audio_get_eld(struct analogix_dp_device *dp,
5622851890Sopenharmony_ci+			      u8 *buf, size_t len);
5722851890Sopenharmony_ci+int analogix_dp_loader_protect(struct analogix_dp_device *dp);
5822851890Sopenharmony_ci+
5922851890Sopenharmony_ci #endif /* _ANALOGIX_DP_H_ */
6022851890Sopenharmony_cidiff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
6122851890Sopenharmony_ciindex ea34ca146..0b7f860d9 100644
6222851890Sopenharmony_ci--- a/include/drm/bridge/dw_hdmi.h
6322851890Sopenharmony_ci+++ b/include/drm/bridge/dw_hdmi.h
6422851890Sopenharmony_ci@@ -6,12 +6,15 @@
6522851890Sopenharmony_ci #ifndef __DW_HDMI__
6622851890Sopenharmony_ci #define __DW_HDMI__
6722851890Sopenharmony_ci 
6822851890Sopenharmony_ci+#include <drm/drm_property.h>
6922851890Sopenharmony_ci #include <sound/hdmi-codec.h>
7022851890Sopenharmony_ci+#include <media/cec.h>
7122851890Sopenharmony_ci 
7222851890Sopenharmony_ci struct drm_display_info;
7322851890Sopenharmony_ci struct drm_display_mode;
7422851890Sopenharmony_ci struct drm_encoder;
7522851890Sopenharmony_ci struct dw_hdmi;
7622851890Sopenharmony_ci+struct dw_hdmi_qp;
7722851890Sopenharmony_ci struct platform_device;
7822851890Sopenharmony_ci 
7922851890Sopenharmony_ci /**
8022851890Sopenharmony_ci@@ -92,6 +95,13 @@ enum dw_hdmi_phy_type {
8122851890Sopenharmony_ci 	DW_HDMI_PHY_VENDOR_PHY = 0xfe,
8222851890Sopenharmony_ci };
8322851890Sopenharmony_ci 
8422851890Sopenharmony_ci+struct dw_hdmi_audio_tmds_n {
8522851890Sopenharmony_ci+	unsigned long tmds;
8622851890Sopenharmony_ci+	unsigned int n_32k;
8722851890Sopenharmony_ci+	unsigned int n_44k1;
8822851890Sopenharmony_ci+	unsigned int n_48k;
8922851890Sopenharmony_ci+};
9022851890Sopenharmony_ci+
9122851890Sopenharmony_ci struct dw_hdmi_mpll_config {
9222851890Sopenharmony_ci 	unsigned long mpixelclock;
9322851890Sopenharmony_ci 	struct {
9422851890Sopenharmony_ci@@ -112,6 +122,15 @@ struct dw_hdmi_phy_config {
9522851890Sopenharmony_ci 	u16 vlev_ctr;   /* voltage level control */
9622851890Sopenharmony_ci };
9722851890Sopenharmony_ci 
9822851890Sopenharmony_ci+struct dw_hdmi_link_config {
9922851890Sopenharmony_ci+	bool dsc_mode;
10022851890Sopenharmony_ci+	bool frl_mode;
10122851890Sopenharmony_ci+	int frl_lanes;
10222851890Sopenharmony_ci+	int rate_per_lane;
10322851890Sopenharmony_ci+	int hcactive;
10422851890Sopenharmony_ci+	u8 pps_payload[128];
10522851890Sopenharmony_ci+};
10622851890Sopenharmony_ci+
10722851890Sopenharmony_ci struct dw_hdmi_phy_ops {
10822851890Sopenharmony_ci 	int (*init)(struct dw_hdmi *hdmi, void *data,
10922851890Sopenharmony_ci 		    const struct drm_display_info *display,
11022851890Sopenharmony_ci@@ -123,12 +142,48 @@ struct dw_hdmi_phy_ops {
11122851890Sopenharmony_ci 	void (*setup_hpd)(struct dw_hdmi *hdmi, void *data);
11222851890Sopenharmony_ci };
11322851890Sopenharmony_ci 
11422851890Sopenharmony_ci+struct dw_hdmi_qp_phy_ops {
11522851890Sopenharmony_ci+	int (*init)(struct dw_hdmi_qp *hdmi, void *data,
11622851890Sopenharmony_ci+		    struct drm_display_mode *mode);
11722851890Sopenharmony_ci+	void (*disable)(struct dw_hdmi_qp *hdmi, void *data);
11822851890Sopenharmony_ci+	enum drm_connector_status (*read_hpd)(struct dw_hdmi_qp *hdmi,
11922851890Sopenharmony_ci+					      void *data);
12022851890Sopenharmony_ci+	void (*update_hpd)(struct dw_hdmi_qp *hdmi, void *data,
12122851890Sopenharmony_ci+			   bool force, bool disabled, bool rxsense);
12222851890Sopenharmony_ci+	void (*setup_hpd)(struct dw_hdmi_qp *hdmi, void *data);
12322851890Sopenharmony_ci+	void (*set_mode)(struct dw_hdmi_qp *dw_hdmi, void *data,
12422851890Sopenharmony_ci+			 u32 mode_mask, bool enable);
12522851890Sopenharmony_ci+};
12622851890Sopenharmony_ci+
12722851890Sopenharmony_ci+struct dw_hdmi_property_ops {
12822851890Sopenharmony_ci+	void (*attach_properties)(struct drm_connector *connector,
12922851890Sopenharmony_ci+				  unsigned int color, int version,
13022851890Sopenharmony_ci+				  void *data);
13122851890Sopenharmony_ci+	void (*destroy_properties)(struct drm_connector *connector,
13222851890Sopenharmony_ci+				   void *data);
13322851890Sopenharmony_ci+	int (*set_property)(struct drm_connector *connector,
13422851890Sopenharmony_ci+			    struct drm_connector_state *state,
13522851890Sopenharmony_ci+			    struct drm_property *property,
13622851890Sopenharmony_ci+			    u64 val,
13722851890Sopenharmony_ci+			    void *data);
13822851890Sopenharmony_ci+	int (*get_property)(struct drm_connector *connector,
13922851890Sopenharmony_ci+			    const struct drm_connector_state *state,
14022851890Sopenharmony_ci+			    struct drm_property *property,
14122851890Sopenharmony_ci+			    u64 *val,
14222851890Sopenharmony_ci+			    void *data);
14322851890Sopenharmony_ci+};
14422851890Sopenharmony_ci+
14522851890Sopenharmony_ci struct dw_hdmi_plat_data {
14622851890Sopenharmony_ci 	struct regmap *regm;
14722851890Sopenharmony_ci 
14822851890Sopenharmony_ci+	unsigned long input_bus_format;
14922851890Sopenharmony_ci 	unsigned long input_bus_encoding;
15022851890Sopenharmony_ci+	unsigned int max_tmdsclk;
15122851890Sopenharmony_ci 	bool use_drm_infoframe;
15222851890Sopenharmony_ci 	bool ycbcr_420_allowed;
15322851890Sopenharmony_ci+	bool unsupported_yuv_input;
15422851890Sopenharmony_ci+	bool unsupported_deep_color;
15522851890Sopenharmony_ci+	bool is_hdmi_qp;
15622851890Sopenharmony_ci 
15722851890Sopenharmony_ci 	/*
15822851890Sopenharmony_ci 	 * Private data passed to all the .mode_valid() and .configure_phy()
15922851890Sopenharmony_ci@@ -137,22 +192,55 @@ struct dw_hdmi_plat_data {
16022851890Sopenharmony_ci 	void *priv_data;
16122851890Sopenharmony_ci 
16222851890Sopenharmony_ci 	/* Platform-specific mode validation (optional). */
16322851890Sopenharmony_ci-	enum drm_mode_status (*mode_valid)(struct dw_hdmi *hdmi, void *data,
16422851890Sopenharmony_ci+	enum drm_mode_status (*mode_valid)(struct drm_connector *connector,
16522851890Sopenharmony_ci+					   void *data,
16622851890Sopenharmony_ci 					   const struct drm_display_info *info,
16722851890Sopenharmony_ci 					   const struct drm_display_mode *mode);
16822851890Sopenharmony_ci 
16922851890Sopenharmony_ci 	/* Vendor PHY support */
17022851890Sopenharmony_ci 	const struct dw_hdmi_phy_ops *phy_ops;
17122851890Sopenharmony_ci+	const struct dw_hdmi_qp_phy_ops *qp_phy_ops;
17222851890Sopenharmony_ci 	const char *phy_name;
17322851890Sopenharmony_ci 	void *phy_data;
17422851890Sopenharmony_ci 	unsigned int phy_force_vendor;
17522851890Sopenharmony_ci+	const struct dw_hdmi_audio_tmds_n *tmds_n_table;
17622851890Sopenharmony_ci+
17722851890Sopenharmony_ci+	/* split mode */
17822851890Sopenharmony_ci+	bool split_mode;
17922851890Sopenharmony_ci+	bool first_screen;
18022851890Sopenharmony_ci+	struct dw_hdmi_qp *left;
18122851890Sopenharmony_ci+	struct dw_hdmi_qp *right;
18222851890Sopenharmony_ci 
18322851890Sopenharmony_ci 	/* Synopsys PHY support */
18422851890Sopenharmony_ci 	const struct dw_hdmi_mpll_config *mpll_cfg;
18522851890Sopenharmony_ci+	const struct dw_hdmi_mpll_config *mpll_cfg_420;
18622851890Sopenharmony_ci 	const struct dw_hdmi_curr_ctrl *cur_ctr;
18722851890Sopenharmony_ci 	const struct dw_hdmi_phy_config *phy_config;
18822851890Sopenharmony_ci 	int (*configure_phy)(struct dw_hdmi *hdmi, void *data,
18922851890Sopenharmony_ci 			     unsigned long mpixelclock);
19022851890Sopenharmony_ci+
19122851890Sopenharmony_ci+	unsigned long (*get_input_bus_format)(void *data);
19222851890Sopenharmony_ci+	unsigned long (*get_output_bus_format)(void *data);
19322851890Sopenharmony_ci+	unsigned long (*get_enc_in_encoding)(void *data);
19422851890Sopenharmony_ci+	unsigned long (*get_enc_out_encoding)(void *data);
19522851890Sopenharmony_ci+	unsigned long (*get_quant_range)(void *data);
19622851890Sopenharmony_ci+	struct drm_property *(*get_hdr_property)(void *data);
19722851890Sopenharmony_ci+	struct drm_property_blob *(*get_hdr_blob)(void *data);
19822851890Sopenharmony_ci+	bool (*get_color_changed)(void *data);
19922851890Sopenharmony_ci+	int (*get_yuv422_format)(struct drm_connector *connector,
20022851890Sopenharmony_ci+				 struct edid *edid);
20122851890Sopenharmony_ci+	int (*get_edid_dsc_info)(void *data, struct edid *edid);
20222851890Sopenharmony_ci+	int (*get_next_hdr_data)(void *data, struct edid *edid,
20322851890Sopenharmony_ci+				 struct drm_connector *connector);
20422851890Sopenharmony_ci+	struct dw_hdmi_link_config *(*get_link_cfg)(void *data);
20522851890Sopenharmony_ci+	void (*set_grf_cfg)(void *data);
20622851890Sopenharmony_ci+	void (*convert_to_split_mode)(struct drm_display_mode *mode);
20722851890Sopenharmony_ci+	void (*convert_to_origin_mode)(struct drm_display_mode *mode);
20822851890Sopenharmony_ci+	int (*dclk_set)(void *data, bool enable);
20922851890Sopenharmony_ci+
21022851890Sopenharmony_ci+	/* Vendor Property support */
21122851890Sopenharmony_ci+	const struct dw_hdmi_property_ops *property_ops;
21222851890Sopenharmony_ci+	struct drm_connector *connector;
21322851890Sopenharmony_ci };
21422851890Sopenharmony_ci 
21522851890Sopenharmony_ci struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
21622851890Sopenharmony_ci@@ -161,8 +249,9 @@ void dw_hdmi_remove(struct dw_hdmi *hdmi);
21722851890Sopenharmony_ci void dw_hdmi_unbind(struct dw_hdmi *hdmi);
21822851890Sopenharmony_ci struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev,
21922851890Sopenharmony_ci 			     struct drm_encoder *encoder,
22022851890Sopenharmony_ci-			     const struct dw_hdmi_plat_data *plat_data);
22122851890Sopenharmony_ci+			     struct dw_hdmi_plat_data *plat_data);
22222851890Sopenharmony_ci 
22322851890Sopenharmony_ci+void dw_hdmi_suspend(struct dw_hdmi *hdmi);
22422851890Sopenharmony_ci void dw_hdmi_resume(struct dw_hdmi *hdmi);
22522851890Sopenharmony_ci 
22622851890Sopenharmony_ci void dw_hdmi_setup_rx_sense(struct dw_hdmi *hdmi, bool hpd, bool rx_sense);
22722851890Sopenharmony_ci@@ -192,5 +281,31 @@ enum drm_connector_status dw_hdmi_phy_read_hpd(struct dw_hdmi *hdmi,
22822851890Sopenharmony_ci void dw_hdmi_phy_update_hpd(struct dw_hdmi *hdmi, void *data,
22922851890Sopenharmony_ci 			    bool force, bool disabled, bool rxsense);
23022851890Sopenharmony_ci void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data);
23122851890Sopenharmony_ci+void dw_hdmi_set_quant_range(struct dw_hdmi *hdmi);
23222851890Sopenharmony_ci+void dw_hdmi_set_output_type(struct dw_hdmi *hdmi, u64 val);
23322851890Sopenharmony_ci+bool dw_hdmi_get_output_whether_hdmi(struct dw_hdmi *hdmi);
23422851890Sopenharmony_ci+int dw_hdmi_get_output_type_cap(struct dw_hdmi *hdmi);
23522851890Sopenharmony_ci+void dw_hdmi_set_cec_adap(struct dw_hdmi *hdmi, struct cec_adapter *adap);
23622851890Sopenharmony_ci+
23722851890Sopenharmony_ci+void dw_hdmi_qp_unbind(struct dw_hdmi_qp *hdmi);
23822851890Sopenharmony_ci+struct dw_hdmi_qp *dw_hdmi_qp_bind(struct platform_device *pdev,
23922851890Sopenharmony_ci+				struct drm_encoder *encoder,
24022851890Sopenharmony_ci+				struct dw_hdmi_plat_data *plat_data);
24122851890Sopenharmony_ci+void dw_hdmi_qp_suspend(struct device *dev, struct dw_hdmi_qp *hdmi);
24222851890Sopenharmony_ci+void dw_hdmi_qp_resume(struct device *dev, struct dw_hdmi_qp *hdmi);
24322851890Sopenharmony_ci+void dw_hdmi_qp_cec_set_hpd(struct dw_hdmi_qp *hdmi, bool plug_in, bool change);
24422851890Sopenharmony_ci+void dw_hdmi_qp_set_cec_adap(struct dw_hdmi_qp *hdmi, struct cec_adapter *adap);
24522851890Sopenharmony_ci+int dw_hdmi_qp_set_earc(struct dw_hdmi_qp *hdmi);
24622851890Sopenharmony_ci+void dw_hdmi_qp_set_sample_rate(struct dw_hdmi_qp *hdmi, unsigned int rate);
24722851890Sopenharmony_ci+void dw_hdmi_qp_set_channel_count(struct dw_hdmi_qp *hdmi, unsigned int cnt);
24822851890Sopenharmony_ci+void dw_hdmi_qp_set_channel_status(struct dw_hdmi_qp *hdmi, u8 *channel_status,
24922851890Sopenharmony_ci+				   bool ref2stream);
25022851890Sopenharmony_ci+void dw_hdmi_qp_set_channel_allocation(struct dw_hdmi_qp *hdmi, unsigned int ca);
25122851890Sopenharmony_ci+void dw_hdmi_qp_set_audio_infoframe(struct dw_hdmi_qp *hdmi,
25222851890Sopenharmony_ci+				    struct hdmi_codec_params *hparms);
25322851890Sopenharmony_ci+void dw_hdmi_qp_audio_enable(struct dw_hdmi_qp *hdmi);
25422851890Sopenharmony_ci+void dw_hdmi_qp_audio_disable(struct dw_hdmi_qp *hdmi);
25522851890Sopenharmony_ci+int dw_hdmi_qp_set_plugged_cb(struct dw_hdmi_qp *hdmi, hdmi_codec_plugged_cb fn,
25622851890Sopenharmony_ci+			      struct device *codec_dev);
25722851890Sopenharmony_ci 
25822851890Sopenharmony_ci #endif /* __IMX_HDMI_H__ */
25922851890Sopenharmony_cidiff --git a/include/drm/bridge/dw_mipi_dsi.h b/include/drm/bridge/dw_mipi_dsi.h
26022851890Sopenharmony_ciindex bda8aa7c2..f89b0476a 100644
26122851890Sopenharmony_ci--- a/include/drm/bridge/dw_mipi_dsi.h
26222851890Sopenharmony_ci+++ b/include/drm/bridge/dw_mipi_dsi.h
26322851890Sopenharmony_ci@@ -66,5 +66,6 @@ void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi);
26422851890Sopenharmony_ci int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi, struct drm_encoder *encoder);
26522851890Sopenharmony_ci void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi);
26622851890Sopenharmony_ci void dw_mipi_dsi_set_slave(struct dw_mipi_dsi *dsi, struct dw_mipi_dsi *slave);
26722851890Sopenharmony_ci+struct drm_connector *dw_mipi_dsi_get_connector(struct dw_mipi_dsi *dsi);
26822851890Sopenharmony_ci 
26922851890Sopenharmony_ci #endif /* __DW_MIPI_DSI__ */
27022851890Sopenharmony_cidiff --git a/include/drm/drm_auth.h b/include/drm/drm_auth.h
27122851890Sopenharmony_ciindex f99d3417f..6bf8b2b78 100644
27222851890Sopenharmony_ci--- a/include/drm/drm_auth.h
27322851890Sopenharmony_ci+++ b/include/drm/drm_auth.h
27422851890Sopenharmony_ci@@ -107,7 +107,6 @@ struct drm_master {
27522851890Sopenharmony_ci };
27622851890Sopenharmony_ci 
27722851890Sopenharmony_ci struct drm_master *drm_master_get(struct drm_master *master);
27822851890Sopenharmony_ci-struct drm_master *drm_file_get_master(struct drm_file *file_priv);
27922851890Sopenharmony_ci void drm_master_put(struct drm_master **master);
28022851890Sopenharmony_ci bool drm_is_current_master(struct drm_file *fpriv);
28122851890Sopenharmony_ci 
28222851890Sopenharmony_cidiff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
28322851890Sopenharmony_ciindex 928136556..f8cd5d8e5 100644
28422851890Sopenharmony_ci--- a/include/drm/drm_connector.h
28522851890Sopenharmony_ci+++ b/include/drm/drm_connector.h
28622851890Sopenharmony_ci@@ -175,6 +175,48 @@ struct drm_scdc {
28722851890Sopenharmony_ci 	struct drm_scrambling scrambling;
28822851890Sopenharmony_ci };
28922851890Sopenharmony_ci 
29022851890Sopenharmony_ci+#ifdef CONFIG_NO_GKI
29122851890Sopenharmony_ci+/**
29222851890Sopenharmony_ci+ * struct drm_hdmi_dsc_cap - DSC capabilities of HDMI sink
29322851890Sopenharmony_ci+ *
29422851890Sopenharmony_ci+ * Describes the DSC support provided by HDMI 2.1 sink.
29522851890Sopenharmony_ci+ * The information is fetched fom additional HFVSDB blocks defined
29622851890Sopenharmony_ci+ * for HDMI 2.1.
29722851890Sopenharmony_ci+ */
29822851890Sopenharmony_ci+struct drm_hdmi_dsc_cap {
29922851890Sopenharmony_ci+	/** @v_1p2: flag for dsc1.2 version support by sink */
30022851890Sopenharmony_ci+	bool v_1p2;
30122851890Sopenharmony_ci+
30222851890Sopenharmony_ci+	/** @native_420: Does sink support DSC with 4:2:0 compression */
30322851890Sopenharmony_ci+	bool native_420;
30422851890Sopenharmony_ci+
30522851890Sopenharmony_ci+	/**
30622851890Sopenharmony_ci+	 * @all_bpp: Does sink support all bpp with 4:4:4: or 4:2:2
30722851890Sopenharmony_ci+	 * compressed formats
30822851890Sopenharmony_ci+	 */
30922851890Sopenharmony_ci+	bool all_bpp;
31022851890Sopenharmony_ci+
31122851890Sopenharmony_ci+	/**
31222851890Sopenharmony_ci+	 * @bpc_supported: compressed bpc supported by sink : 10, 12 or 16 bpc
31322851890Sopenharmony_ci+	 */
31422851890Sopenharmony_ci+	u8 bpc_supported;
31522851890Sopenharmony_ci+
31622851890Sopenharmony_ci+	/** @max_slices: maximum number of Horizontal slices supported by */
31722851890Sopenharmony_ci+	u8 max_slices;
31822851890Sopenharmony_ci+
31922851890Sopenharmony_ci+	/** @clk_per_slice : max pixel clock in MHz supported per slice */
32022851890Sopenharmony_ci+	int clk_per_slice;
32122851890Sopenharmony_ci+
32222851890Sopenharmony_ci+	/** @max_lanes : dsc max lanes supported for Fixed rate Link training */
32322851890Sopenharmony_ci+	u8 max_lanes;
32422851890Sopenharmony_ci+
32522851890Sopenharmony_ci+	/** @max_frl_rate_per_lane : maximum frl rate with DSC per lane */
32622851890Sopenharmony_ci+	u8 max_frl_rate_per_lane;
32722851890Sopenharmony_ci+
32822851890Sopenharmony_ci+	/** @total_chunk_kbytes: max size of chunks in KBs supported per line*/
32922851890Sopenharmony_ci+	u8 total_chunk_kbytes;
33022851890Sopenharmony_ci+};
33122851890Sopenharmony_ci+#endif
33222851890Sopenharmony_ci 
33322851890Sopenharmony_ci /**
33422851890Sopenharmony_ci  * struct drm_hdmi_info - runtime information about the connected HDMI sink
33522851890Sopenharmony_ci@@ -207,6 +249,17 @@ struct drm_hdmi_info {
33622851890Sopenharmony_ci 
33722851890Sopenharmony_ci 	/** @y420_dc_modes: bitmap of deep color support index */
33822851890Sopenharmony_ci 	u8 y420_dc_modes;
33922851890Sopenharmony_ci+
34022851890Sopenharmony_ci+#ifdef CONFIG_NO_GKI
34122851890Sopenharmony_ci+	/** @max_frl_rate_per_lane: support fixed rate link */
34222851890Sopenharmony_ci+	u8 max_frl_rate_per_lane;
34322851890Sopenharmony_ci+
34422851890Sopenharmony_ci+	/** @max_lanes: supported by sink */
34522851890Sopenharmony_ci+	u8 max_lanes;
34622851890Sopenharmony_ci+
34722851890Sopenharmony_ci+	/** @dsc_cap: DSC capabilities of the sink */
34822851890Sopenharmony_ci+	struct drm_hdmi_dsc_cap dsc_cap;
34922851890Sopenharmony_ci+#endif
35022851890Sopenharmony_ci };
35122851890Sopenharmony_ci 
35222851890Sopenharmony_ci /**
35322851890Sopenharmony_ci@@ -1596,6 +1649,7 @@ drm_connector_is_unregistered(struct drm_connector *connector)
35422851890Sopenharmony_ci 		DRM_CONNECTOR_UNREGISTERED;
35522851890Sopenharmony_ci }
35622851890Sopenharmony_ci 
35722851890Sopenharmony_ci+void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode);
35822851890Sopenharmony_ci const char *drm_get_connector_type_name(unsigned int connector_type);
35922851890Sopenharmony_ci const char *drm_get_connector_status_name(enum drm_connector_status status);
36022851890Sopenharmony_ci const char *drm_get_subpixel_order_name(enum subpixel_order order);
36122851890Sopenharmony_cidiff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
36222851890Sopenharmony_ciindex 59b51a09c..3a3d9d887 100644
36322851890Sopenharmony_ci--- a/include/drm/drm_crtc.h
36422851890Sopenharmony_ci+++ b/include/drm/drm_crtc.h
36522851890Sopenharmony_ci@@ -287,7 +287,16 @@ struct drm_crtc_state {
36622851890Sopenharmony_ci 	 * NULL) is an array of &struct drm_color_lut.
36722851890Sopenharmony_ci 	 */
36822851890Sopenharmony_ci 	struct drm_property_blob *gamma_lut;
36922851890Sopenharmony_ci-
37022851890Sopenharmony_ci+#if defined(CONFIG_ROCKCHIP_DRM_CUBIC_LUT)
37122851890Sopenharmony_ci+	/**
37222851890Sopenharmony_ci+	 * @cubic_lut:
37322851890Sopenharmony_ci+	 *
37422851890Sopenharmony_ci+	 * Cubic Lookup table for converting pixel data. See
37522851890Sopenharmony_ci+	 * drm_crtc_enable_color_mgmt(). The blob (if not NULL) is a 3D array
37622851890Sopenharmony_ci+	 * of &struct drm_color_lut.
37722851890Sopenharmony_ci+	 */
37822851890Sopenharmony_ci+	struct drm_property_blob *cubic_lut;
37922851890Sopenharmony_ci+#endif
38022851890Sopenharmony_ci 	/**
38122851890Sopenharmony_ci 	 * @target_vblank:
38222851890Sopenharmony_ci 	 *
38322851890Sopenharmony_cidiff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
38422851890Sopenharmony_ciindex e57d0440f..e395d1fc1 100644
38522851890Sopenharmony_ci--- a/include/drm/drm_drv.h
38622851890Sopenharmony_ci+++ b/include/drm/drm_drv.h
38722851890Sopenharmony_ci@@ -29,6 +29,7 @@
38822851890Sopenharmony_ci 
38922851890Sopenharmony_ci #include <linux/list.h>
39022851890Sopenharmony_ci #include <linux/irqreturn.h>
39122851890Sopenharmony_ci+#include <linux/uuid.h>
39222851890Sopenharmony_ci 
39322851890Sopenharmony_ci #include <drm/drm_device.h>
39422851890Sopenharmony_ci 
39522851890Sopenharmony_ci@@ -460,6 +461,15 @@ struct drm_driver {
39622851890Sopenharmony_ci 	int (*gem_prime_mmap)(struct drm_gem_object *obj,
39722851890Sopenharmony_ci 				struct vm_area_struct *vma);
39822851890Sopenharmony_ci 
39922851890Sopenharmony_ci+	/**
40022851890Sopenharmony_ci+	 * @gem_prime_get_uuid
40122851890Sopenharmony_ci+	 *
40222851890Sopenharmony_ci+	 * get_uuid hook for GEM drivers. Retrieves the virtio uuid of the
40322851890Sopenharmony_ci+	 * given GEM buffer.
40422851890Sopenharmony_ci+	 */
40522851890Sopenharmony_ci+	int (*gem_prime_get_uuid)(struct drm_gem_object *obj,
40622851890Sopenharmony_ci+				  uuid_t *uuid);
40722851890Sopenharmony_ci+
40822851890Sopenharmony_ci 	/**
40922851890Sopenharmony_ci 	 * @dumb_create:
41022851890Sopenharmony_ci 	 *
41122851890Sopenharmony_cidiff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
41222851890Sopenharmony_ciindex e97daf6ff..043491c74 100644
41322851890Sopenharmony_ci--- a/include/drm/drm_edid.h
41422851890Sopenharmony_ci+++ b/include/drm/drm_edid.h
41522851890Sopenharmony_ci@@ -229,6 +229,38 @@ struct detailed_timing {
41622851890Sopenharmony_ci 				    DRM_EDID_YCBCR420_DC_36 | \
41722851890Sopenharmony_ci 				    DRM_EDID_YCBCR420_DC_30)
41822851890Sopenharmony_ci 
41922851890Sopenharmony_ci+#ifdef CONFIG_NO_GKI
42022851890Sopenharmony_ci+/* HDMI 2.1 additional fields */
42122851890Sopenharmony_ci+#define DRM_EDID_MAX_FRL_RATE_MASK		0xf0
42222851890Sopenharmony_ci+#define DRM_EDID_FAPA_START_LOCATION		(1 << 0)
42322851890Sopenharmony_ci+#define DRM_EDID_ALLM				(1 << 1)
42422851890Sopenharmony_ci+#define DRM_EDID_FVA				(1 << 2)
42522851890Sopenharmony_ci+
42622851890Sopenharmony_ci+/* Deep Color specific */
42722851890Sopenharmony_ci+#define DRM_EDID_DC_30BIT_420			(1 << 0)
42822851890Sopenharmony_ci+#define DRM_EDID_DC_36BIT_420			(1 << 1)
42922851890Sopenharmony_ci+#define DRM_EDID_DC_48BIT_420			(1 << 2)
43022851890Sopenharmony_ci+
43122851890Sopenharmony_ci+/* VRR specific */
43222851890Sopenharmony_ci+#define DRM_EDID_CNMVRR				(1 << 3)
43322851890Sopenharmony_ci+#define DRM_EDID_CINEMA_VRR			(1 << 4)
43422851890Sopenharmony_ci+#define DRM_EDID_MDELTA				(1 << 5)
43522851890Sopenharmony_ci+#define DRM_EDID_VRR_MAX_UPPER_MASK		0xc0
43622851890Sopenharmony_ci+#define DRM_EDID_VRR_MAX_LOWER_MASK		0xff
43722851890Sopenharmony_ci+#define DRM_EDID_VRR_MIN_MASK			0x3f
43822851890Sopenharmony_ci+
43922851890Sopenharmony_ci+/* DSC specific */
44022851890Sopenharmony_ci+#define DRM_EDID_DSC_10BPC			(1 << 0)
44122851890Sopenharmony_ci+#define DRM_EDID_DSC_12BPC			(1 << 1)
44222851890Sopenharmony_ci+#define DRM_EDID_DSC_16BPC			(1 << 2)
44322851890Sopenharmony_ci+#define DRM_EDID_DSC_ALL_BPP			(1 << 3)
44422851890Sopenharmony_ci+#define DRM_EDID_DSC_NATIVE_420			(1 << 6)
44522851890Sopenharmony_ci+#define DRM_EDID_DSC_1P2			(1 << 7)
44622851890Sopenharmony_ci+#define DRM_EDID_DSC_MAX_FRL_RATE_MASK		0xf0
44722851890Sopenharmony_ci+#define DRM_EDID_DSC_MAX_SLICES			0xf
44822851890Sopenharmony_ci+#define DRM_EDID_DSC_TOTAL_CHUNK_KBYTES		0x3f
44922851890Sopenharmony_ci+#endif
45022851890Sopenharmony_ci+
45122851890Sopenharmony_ci /* ELD Header Block */
45222851890Sopenharmony_ci #define DRM_ELD_HEADER_BLOCK_SIZE	4
45322851890Sopenharmony_ci 
45422851890Sopenharmony_ci@@ -359,8 +391,6 @@ drm_load_edid_firmware(struct drm_connector *connector)
45522851890Sopenharmony_ci }
45622851890Sopenharmony_ci #endif
45722851890Sopenharmony_ci 
45822851890Sopenharmony_ci-bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2);
45922851890Sopenharmony_ci-
46022851890Sopenharmony_ci int
46122851890Sopenharmony_ci drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
46222851890Sopenharmony_ci 					 const struct drm_connector *connector,
46322851890Sopenharmony_ci@@ -483,35 +513,99 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
46422851890Sopenharmony_ci 	int (*get_edid_block)(void *data, u8 *buf, unsigned int block,
46522851890Sopenharmony_ci 			      size_t len),
46622851890Sopenharmony_ci 	void *data);
46722851890Sopenharmony_ci-struct edid *drm_get_edid(struct drm_connector *connector,
46822851890Sopenharmony_ci-			  struct i2c_adapter *adapter);
46922851890Sopenharmony_ci struct edid *drm_get_edid_switcheroo(struct drm_connector *connector,
47022851890Sopenharmony_ci 				     struct i2c_adapter *adapter);
47122851890Sopenharmony_ci-struct edid *drm_edid_duplicate(const struct edid *edid);
47222851890Sopenharmony_ci-int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
47322851890Sopenharmony_ci-int drm_add_override_edid_modes(struct drm_connector *connector);
47422851890Sopenharmony_ci 
47522851890Sopenharmony_ci-u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
47622851890Sopenharmony_ci bool drm_detect_hdmi_monitor(struct edid *edid);
47722851890Sopenharmony_ci-bool drm_detect_monitor_audio(struct edid *edid);
47822851890Sopenharmony_ci enum hdmi_quantization_range
47922851890Sopenharmony_ci drm_default_rgb_quant_range(const struct drm_display_mode *mode);
48022851890Sopenharmony_ci-int drm_add_modes_noedid(struct drm_connector *connector,
48122851890Sopenharmony_ci-			 int hdisplay, int vdisplay);
48222851890Sopenharmony_ci void drm_set_preferred_mode(struct drm_connector *connector,
48322851890Sopenharmony_ci 			    int hpref, int vpref);
48422851890Sopenharmony_ci 
48522851890Sopenharmony_ci int drm_edid_header_is_valid(const u8 *raw_edid);
48622851890Sopenharmony_ci bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
48722851890Sopenharmony_ci 			  bool *edid_corrupt);
48822851890Sopenharmony_ci-bool drm_edid_is_valid(struct edid *edid);
48922851890Sopenharmony_ci+struct drm_display_mode *
49022851890Sopenharmony_ci+drm_display_mode_from_cea_vic(struct drm_device *dev,
49122851890Sopenharmony_ci+			      u8 video_code);
49222851890Sopenharmony_ci+
49322851890Sopenharmony_ci+#ifdef CONFIG_DRM_EDID
49422851890Sopenharmony_ci+struct edid *drm_get_edid(struct drm_connector *connector,
49522851890Sopenharmony_ci+			  struct i2c_adapter *adapter);
49622851890Sopenharmony_ci+struct edid *drm_edid_duplicate(const struct edid *edid);
49722851890Sopenharmony_ci+int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
49822851890Sopenharmony_ci+int drm_add_override_edid_modes(struct drm_connector *connector);
49922851890Sopenharmony_ci+u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
50022851890Sopenharmony_ci+int drm_add_modes_noedid(struct drm_connector *connector,
50122851890Sopenharmony_ci+			 int hdisplay, int vdisplay);
50222851890Sopenharmony_ci+bool drm_detect_monitor_audio(struct edid *edid);
50322851890Sopenharmony_ci void drm_edid_get_monitor_name(struct edid *edid, char *name,
50422851890Sopenharmony_ci 			       int buflen);
50522851890Sopenharmony_ci+bool drm_edid_is_valid(struct edid *edid);
50622851890Sopenharmony_ci+bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2);
50722851890Sopenharmony_ci struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
50822851890Sopenharmony_ci 					   int hsize, int vsize, int fresh,
50922851890Sopenharmony_ci 					   bool rb);
51022851890Sopenharmony_ci-struct drm_display_mode *
51122851890Sopenharmony_ci-drm_display_mode_from_cea_vic(struct drm_device *dev,
51222851890Sopenharmony_ci-			      u8 video_code);
51322851890Sopenharmony_ci+#else
51422851890Sopenharmony_ci+static inline struct edid *drm_get_edid(struct drm_connector *connector,
51522851890Sopenharmony_ci+					struct i2c_adapter *adapter)
51622851890Sopenharmony_ci+{
51722851890Sopenharmony_ci+	return NULL;
51822851890Sopenharmony_ci+}
51922851890Sopenharmony_ci+
52022851890Sopenharmony_ci+static inline struct edid *drm_edid_duplicate(const struct edid *edid)
52122851890Sopenharmony_ci+{
52222851890Sopenharmony_ci+	return NULL;
52322851890Sopenharmony_ci+}
52422851890Sopenharmony_ci+
52522851890Sopenharmony_ci+static inline int drm_add_edid_modes(struct drm_connector *connector,
52622851890Sopenharmony_ci+				     struct edid *edid)
52722851890Sopenharmony_ci+{
52822851890Sopenharmony_ci+	return 0;
52922851890Sopenharmony_ci+}
53022851890Sopenharmony_ci+
53122851890Sopenharmony_ci+static inline int drm_add_override_edid_modes(struct drm_connector *connector)
53222851890Sopenharmony_ci+{
53322851890Sopenharmony_ci+	return 0;
53422851890Sopenharmony_ci+}
53522851890Sopenharmony_ci+
53622851890Sopenharmony_ci+static inline u8 drm_match_cea_mode(const struct drm_display_mode *to_match)
53722851890Sopenharmony_ci+{
53822851890Sopenharmony_ci+	return 0;
53922851890Sopenharmony_ci+}
54022851890Sopenharmony_ci+
54122851890Sopenharmony_ci+static inline int drm_add_modes_noedid(struct drm_connector *connector,
54222851890Sopenharmony_ci+				       int hdisplay, int vdisplay)
54322851890Sopenharmony_ci+{
54422851890Sopenharmony_ci+	return 0;
54522851890Sopenharmony_ci+}
54622851890Sopenharmony_ci+
54722851890Sopenharmony_ci+static inline bool drm_detect_monitor_audio(struct edid *edid)
54822851890Sopenharmony_ci+{
54922851890Sopenharmony_ci+	return false;
55022851890Sopenharmony_ci+}
55122851890Sopenharmony_ci+
55222851890Sopenharmony_ci+static inline void drm_edid_get_monitor_name(struct edid *edid, char *name,
55322851890Sopenharmony_ci+					     int buflen)
55422851890Sopenharmony_ci+{
55522851890Sopenharmony_ci+}
55622851890Sopenharmony_ci+
55722851890Sopenharmony_ci+static inline bool drm_edid_is_valid(struct edid *edid)
55822851890Sopenharmony_ci+{
55922851890Sopenharmony_ci+	return false;
56022851890Sopenharmony_ci+}
56122851890Sopenharmony_ci+
56222851890Sopenharmony_ci+static inline bool drm_edid_are_equal(const struct edid *edid1, const struct edid *edid2)
56322851890Sopenharmony_ci+{
56422851890Sopenharmony_ci+	return false;
56522851890Sopenharmony_ci+}
56622851890Sopenharmony_ci+
56722851890Sopenharmony_ci+static inline struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
56822851890Sopenharmony_ci+					   int hsize, int vsize, int fresh,
56922851890Sopenharmony_ci+					   bool rb)
57022851890Sopenharmony_ci+{
57122851890Sopenharmony_ci+	return NULL;
57222851890Sopenharmony_ci+}
57322851890Sopenharmony_ci+#endif
57422851890Sopenharmony_ci 
57522851890Sopenharmony_ci #endif /* __DRM_EDID_H__ */
57622851890Sopenharmony_cidiff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
57722851890Sopenharmony_ciindex 42d04607d..b81b3bfb0 100644
57822851890Sopenharmony_ci--- a/include/drm/drm_file.h
57922851890Sopenharmony_ci+++ b/include/drm/drm_file.h
58022851890Sopenharmony_ci@@ -226,27 +226,15 @@ struct drm_file {
58122851890Sopenharmony_ci 	/**
58222851890Sopenharmony_ci 	 * @master:
58322851890Sopenharmony_ci 	 *
58422851890Sopenharmony_ci-	 * Master this node is currently associated with. Protected by struct
58522851890Sopenharmony_ci-	 * &drm_device.master_mutex, and serialized by @master_lookup_lock.
58622851890Sopenharmony_ci-	 *
58722851890Sopenharmony_ci-	 * Only relevant if drm_is_primary_client() returns true. Note that
58822851890Sopenharmony_ci-	 * this only matches &drm_device.master if the master is the currently
58922851890Sopenharmony_ci-	 * active one.
59022851890Sopenharmony_ci-	 *
59122851890Sopenharmony_ci-	 * When dereferencing this pointer, either hold struct
59222851890Sopenharmony_ci-	 * &drm_device.master_mutex for the duration of the pointer's use, or
59322851890Sopenharmony_ci-	 * use drm_file_get_master() if struct &drm_device.master_mutex is not
59422851890Sopenharmony_ci-	 * currently held and there is no other need to hold it. This prevents
59522851890Sopenharmony_ci-	 * @master from being freed during use.
59622851890Sopenharmony_ci+	 * Master this node is currently associated with. Only relevant if
59722851890Sopenharmony_ci+	 * drm_is_primary_client() returns true. Note that this only
59822851890Sopenharmony_ci+	 * matches &drm_device.master if the master is the currently active one.
59922851890Sopenharmony_ci 	 *
60022851890Sopenharmony_ci 	 * See also @authentication and @is_master and the :ref:`section on
60122851890Sopenharmony_ci 	 * primary nodes and authentication <drm_primary_node>`.
60222851890Sopenharmony_ci 	 */
60322851890Sopenharmony_ci 	struct drm_master *master;
60422851890Sopenharmony_ci 
60522851890Sopenharmony_ci-	/** @master_lock: Serializes @master. */
60622851890Sopenharmony_ci-	spinlock_t master_lookup_lock;
60722851890Sopenharmony_ci-
60822851890Sopenharmony_ci 	/** @pid: Process that opened this file. */
60922851890Sopenharmony_ci 	struct pid *pid;
61022851890Sopenharmony_ci 
61122851890Sopenharmony_ci@@ -411,6 +399,9 @@ void drm_event_cancel_free(struct drm_device *dev,
61222851890Sopenharmony_ci 			   struct drm_pending_event *p);
61322851890Sopenharmony_ci void drm_send_event_locked(struct drm_device *dev, struct drm_pending_event *e);
61422851890Sopenharmony_ci void drm_send_event(struct drm_device *dev, struct drm_pending_event *e);
61522851890Sopenharmony_ci+void drm_send_event_timestamp_locked(struct drm_device *dev,
61622851890Sopenharmony_ci+				     struct drm_pending_event *e,
61722851890Sopenharmony_ci+				     ktime_t timestamp);
61822851890Sopenharmony_ci 
61922851890Sopenharmony_ci struct file *mock_drm_getfile(struct drm_minor *minor, unsigned int flags);
62022851890Sopenharmony_ci 
62122851890Sopenharmony_cidiff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
62222851890Sopenharmony_ciindex 360e6377e..952f475a6 100644
62322851890Sopenharmony_ci--- a/include/drm/drm_mipi_dsi.h
62422851890Sopenharmony_ci+++ b/include/drm/drm_mipi_dsi.h
62522851890Sopenharmony_ci@@ -19,12 +19,18 @@ struct drm_dsc_picture_parameter_set;
62622851890Sopenharmony_ci #define MIPI_DSI_MSG_REQ_ACK	BIT(0)
62722851890Sopenharmony_ci /* use Low Power Mode to transmit message */
62822851890Sopenharmony_ci #define MIPI_DSI_MSG_USE_LPM	BIT(1)
62922851890Sopenharmony_ci+/* read mipi_dsi_msg.ctrl and unicast to only that ctrls */
63022851890Sopenharmony_ci+#define MIPI_DSI_MSG_UNICAST	BIT(2)
63122851890Sopenharmony_ci+/* Stack all commands until lastcommand bit and trigger all in one go */
63222851890Sopenharmony_ci+#define MIPI_DSI_MSG_LASTCOMMAND BIT(3)
63322851890Sopenharmony_ci 
63422851890Sopenharmony_ci /**
63522851890Sopenharmony_ci  * struct mipi_dsi_msg - read/write DSI buffer
63622851890Sopenharmony_ci  * @channel: virtual channel id
63722851890Sopenharmony_ci  * @type: payload data type
63822851890Sopenharmony_ci  * @flags: flags controlling this message transmission
63922851890Sopenharmony_ci+ * @ctrl: ctrl index to transmit on
64022851890Sopenharmony_ci+ * @wait_ms: duration in ms to wait after message transmission
64122851890Sopenharmony_ci  * @tx_len: length of @tx_buf
64222851890Sopenharmony_ci  * @tx_buf: data to be written
64322851890Sopenharmony_ci  * @rx_len: length of @rx_buf
64422851890Sopenharmony_ci@@ -34,6 +40,8 @@ struct mipi_dsi_msg {
64522851890Sopenharmony_ci 	u8 channel;
64622851890Sopenharmony_ci 	u8 type;
64722851890Sopenharmony_ci 	u16 flags;
64822851890Sopenharmony_ci+	u32 ctrl;
64922851890Sopenharmony_ci+	u32 wait_ms;
65022851890Sopenharmony_ci 
65122851890Sopenharmony_ci 	size_t tx_len;
65222851890Sopenharmony_ci 	const void *tx_buf;
65322851890Sopenharmony_ci@@ -132,6 +140,10 @@ struct mipi_dsi_host *of_find_mipi_dsi_host_by_node(struct device_node *node);
65422851890Sopenharmony_ci #define MIPI_DSI_CLOCK_NON_CONTINUOUS	BIT(10)
65522851890Sopenharmony_ci /* transmit data in low power */
65622851890Sopenharmony_ci #define MIPI_DSI_MODE_LPM		BIT(11)
65722851890Sopenharmony_ci+/* disable BLLP area */
65822851890Sopenharmony_ci+#define MIPI_DSI_MODE_VIDEO_BLLP	BIT(12)
65922851890Sopenharmony_ci+/* disable EOF BLLP area */
66022851890Sopenharmony_ci+#define MIPI_DSI_MODE_VIDEO_EOF_BLLP	BIT(13)
66122851890Sopenharmony_ci 
66222851890Sopenharmony_ci enum mipi_dsi_pixel_format {
66322851890Sopenharmony_ci 	MIPI_DSI_FMT_RGB888,
66422851890Sopenharmony_cidiff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
66522851890Sopenharmony_ciindex a18f73eb3..76d114569 100644
66622851890Sopenharmony_ci--- a/include/drm/drm_mode_config.h
66722851890Sopenharmony_ci+++ b/include/drm/drm_mode_config.h
66822851890Sopenharmony_ci@@ -794,6 +794,19 @@ struct drm_mode_config {
66922851890Sopenharmony_ci 	 */
67022851890Sopenharmony_ci 	struct drm_property *gamma_lut_size_property;
67122851890Sopenharmony_ci 
67222851890Sopenharmony_ci+#if defined(CONFIG_ROCKCHIP_DRM_CUBIC_LUT)
67322851890Sopenharmony_ci+	/**
67422851890Sopenharmony_ci+	 * @cubic_lut_property: Optional CRTC property to set the 3D LUT used to
67522851890Sopenharmony_ci+	 * convert color spaces.
67622851890Sopenharmony_ci+	 */
67722851890Sopenharmony_ci+	struct drm_property *cubic_lut_property;
67822851890Sopenharmony_ci+	/**
67922851890Sopenharmony_ci+	 * @cubic_lut_size_property: Optional CRTC property for the size of the
68022851890Sopenharmony_ci+	 * 3D LUT as supported by the driver (read-only).
68122851890Sopenharmony_ci+	 */
68222851890Sopenharmony_ci+	struct drm_property *cubic_lut_size_property;
68322851890Sopenharmony_ci+#endif
68422851890Sopenharmony_ci+
68522851890Sopenharmony_ci 	/**
68622851890Sopenharmony_ci 	 * @suggested_x_property: Optional connector property with a hint for
68722851890Sopenharmony_ci 	 * the position of the output on the host's screen.
68822851890Sopenharmony_cidiff --git a/include/drm/drm_mode_object.h b/include/drm/drm_mode_object.h
68922851890Sopenharmony_ciindex c34a3e803..6292fa663 100644
69022851890Sopenharmony_ci--- a/include/drm/drm_mode_object.h
69122851890Sopenharmony_ci+++ b/include/drm/drm_mode_object.h
69222851890Sopenharmony_ci@@ -60,7 +60,7 @@ struct drm_mode_object {
69322851890Sopenharmony_ci 	void (*free_cb)(struct kref *kref);
69422851890Sopenharmony_ci };
69522851890Sopenharmony_ci 
69622851890Sopenharmony_ci-#define DRM_OBJECT_MAX_PROPERTY 24
69722851890Sopenharmony_ci+#define DRM_OBJECT_MAX_PROPERTY 64
69822851890Sopenharmony_ci /**
69922851890Sopenharmony_ci  * struct drm_object_properties - property tracking for &drm_mode_object
70022851890Sopenharmony_ci  */
70122851890Sopenharmony_cidiff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h
70222851890Sopenharmony_ciindex 0f69f9fbf..a9d0c6b08 100644
70322851890Sopenharmony_ci--- a/include/drm/drm_prime.h
70422851890Sopenharmony_ci+++ b/include/drm/drm_prime.h
70522851890Sopenharmony_ci@@ -107,5 +107,6 @@ void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg);
70622851890Sopenharmony_ci int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages,
70722851890Sopenharmony_ci 				     dma_addr_t *addrs, int max_pages);
70822851890Sopenharmony_ci 
70922851890Sopenharmony_ci+int drm_gem_dmabuf_get_uuid(struct dma_buf *dma_buf, uuid_t *uuid);
71022851890Sopenharmony_ci 
71122851890Sopenharmony_ci #endif /* __DRM_PRIME_H__ */
71222851890Sopenharmony_cidiff --git a/include/dt-bindings/clock/rk3399-cru.h b/include/dt-bindings/clock/rk3399-cru.h
71322851890Sopenharmony_ciindex 44e0a319f..b541bdce1 100644
71422851890Sopenharmony_ci--- a/include/dt-bindings/clock/rk3399-cru.h
71522851890Sopenharmony_ci+++ b/include/dt-bindings/clock/rk3399-cru.h
71622851890Sopenharmony_ci@@ -7,6 +7,8 @@
71722851890Sopenharmony_ci #ifndef _DT_BINDINGS_CLK_ROCKCHIP_RK3399_H
71822851890Sopenharmony_ci #define _DT_BINDINGS_CLK_ROCKCHIP_RK3399_H
71922851890Sopenharmony_ci 
72022851890Sopenharmony_ci+#define RK3399_TWO_PLL_FOR_VOP
72122851890Sopenharmony_ci+
72222851890Sopenharmony_ci /* core clocks */
72322851890Sopenharmony_ci #define PLL_APLLL			1
72422851890Sopenharmony_ci #define PLL_APLLB			2
72522851890Sopenharmony_ci@@ -19,6 +21,7 @@
72622851890Sopenharmony_ci #define ARMCLKB				9
72722851890Sopenharmony_ci 
72822851890Sopenharmony_ci /* sclk gates (special clocks) */
72922851890Sopenharmony_ci+#define SCLK_I2SOUT_SRC			64
73022851890Sopenharmony_ci #define SCLK_I2C1			65
73122851890Sopenharmony_ci #define SCLK_I2C2			66
73222851890Sopenharmony_ci #define SCLK_I2C3			67
73322851890Sopenharmony_ci@@ -122,9 +125,18 @@
73422851890Sopenharmony_ci #define SCLK_DPHY_RX0_CFG		165
73522851890Sopenharmony_ci #define SCLK_RMII_SRC			166
73622851890Sopenharmony_ci #define SCLK_PCIEPHY_REF100M		167
73722851890Sopenharmony_ci-#define SCLK_DDRC			168
73822851890Sopenharmony_ci-#define SCLK_TESTCLKOUT1		169
73922851890Sopenharmony_ci-#define SCLK_TESTCLKOUT2		170
74022851890Sopenharmony_ci+#define SCLK_USBPHY0_480M_SRC		168
74122851890Sopenharmony_ci+#define SCLK_USBPHY1_480M_SRC		169
74222851890Sopenharmony_ci+#define SCLK_DDRC			170
74322851890Sopenharmony_ci+#define SCLK_TESTCLKOUT2		171
74422851890Sopenharmony_ci+#define SCLK_UART0_SRC			172
74522851890Sopenharmony_ci+#define SCLK_UART_SRC			173
74622851890Sopenharmony_ci+#define SCLK_I2S0_DIV			174
74722851890Sopenharmony_ci+#define SCLK_I2S1_DIV			175
74822851890Sopenharmony_ci+#define SCLK_I2S2_DIV			176
74922851890Sopenharmony_ci+#define SCLK_SPDIF_DIV			177
75022851890Sopenharmony_ci+#define SCLK_TESTCLKOUT1		179
75122851890Sopenharmony_ci+#define SCLK_CIF_OUT_SRC		178
75222851890Sopenharmony_ci 
75322851890Sopenharmony_ci #define DCLK_VOP0			180
75422851890Sopenharmony_ci #define DCLK_VOP1			181
75522851890Sopenharmony_ci@@ -351,6 +363,7 @@
75622851890Sopenharmony_ci #define SCLK_I2C0_PMU			9
75722851890Sopenharmony_ci #define SCLK_I2C4_PMU			10
75822851890Sopenharmony_ci #define SCLK_I2C8_PMU			11
75922851890Sopenharmony_ci+#define SCLK_UART4_SRC			12
76022851890Sopenharmony_ci 
76122851890Sopenharmony_ci #define PCLK_SRC_PMU			19
76222851890Sopenharmony_ci #define PCLK_PMU			20
76322851890Sopenharmony_ci@@ -421,7 +434,7 @@
76422851890Sopenharmony_ci #define SRST_A_ADB400_GIC2COREB		40
76522851890Sopenharmony_ci #define SRST_A_ADB400_COREB2GIC		41
76622851890Sopenharmony_ci #define SRST_P_DBG_B			42
76722851890Sopenharmony_ci-#define SRST_L2_B_T			43
76822851890Sopenharmony_ci+#define SRST_L2_B_T			44
76922851890Sopenharmony_ci #define SRST_ADB_B_T			45
77022851890Sopenharmony_ci #define SRST_A_RKPERF_B			46
77122851890Sopenharmony_ci #define SRST_PVTM_CORE_B		47
77222851890Sopenharmony_ci@@ -594,13 +607,13 @@
77322851890Sopenharmony_ci #define SRST_P_SPI0			214
77422851890Sopenharmony_ci #define SRST_P_SPI1			215
77522851890Sopenharmony_ci #define SRST_P_SPI2			216
77622851890Sopenharmony_ci-#define SRST_P_SPI3			217
77722851890Sopenharmony_ci-#define SRST_P_SPI4			218
77822851890Sopenharmony_ci+#define SRST_P_SPI4			217
77922851890Sopenharmony_ci+#define SRST_P_SPI5			218
78022851890Sopenharmony_ci #define SRST_SPI0			219
78122851890Sopenharmony_ci #define SRST_SPI1			220
78222851890Sopenharmony_ci #define SRST_SPI2			221
78322851890Sopenharmony_ci-#define SRST_SPI3			222
78422851890Sopenharmony_ci-#define SRST_SPI4			223
78522851890Sopenharmony_ci+#define SRST_SPI4			222
78622851890Sopenharmony_ci+#define SRST_SPI5			223
78722851890Sopenharmony_ci 
78822851890Sopenharmony_ci /* cru_softrst_con14 */
78922851890Sopenharmony_ci #define SRST_I2S0_8CH			224
79022851890Sopenharmony_ci@@ -722,8 +735,8 @@
79122851890Sopenharmony_ci #define SRST_H_CM0S_NOC			3
79222851890Sopenharmony_ci #define SRST_DBG_CM0S			4
79322851890Sopenharmony_ci #define SRST_PO_CM0S			5
79422851890Sopenharmony_ci-#define SRST_P_SPI6			6
79522851890Sopenharmony_ci-#define SRST_SPI6			7
79622851890Sopenharmony_ci+#define SRST_P_SPI3			6
79722851890Sopenharmony_ci+#define SRST_SPI3			7
79822851890Sopenharmony_ci #define SRST_P_TIMER_0_1		8
79922851890Sopenharmony_ci #define SRST_P_TIMER_0			9
80022851890Sopenharmony_ci #define SRST_P_TIMER_1			10
80122851890Sopenharmony_cidiff --git a/include/dt-bindings/soc/rockchip,boot-mode.h b/include/dt-bindings/soc/rockchip,boot-mode.h
80222851890Sopenharmony_ciindex 4b0914c09..1436e1d32 100644
80322851890Sopenharmony_ci--- a/include/dt-bindings/soc/rockchip,boot-mode.h
80422851890Sopenharmony_ci+++ b/include/dt-bindings/soc/rockchip,boot-mode.h
80522851890Sopenharmony_ci@@ -10,7 +10,15 @@
80622851890Sopenharmony_ci #define BOOT_BL_DOWNLOAD	(REBOOT_FLAG + 1)
80722851890Sopenharmony_ci /* enter recovery */
80822851890Sopenharmony_ci #define BOOT_RECOVERY		(REBOOT_FLAG + 3)
80922851890Sopenharmony_ci- /* enter fastboot mode */
81022851890Sopenharmony_ci+/* reboot by panic */
81122851890Sopenharmony_ci+#define BOOT_PANIC		(REBOOT_FLAG + 7)
81222851890Sopenharmony_ci+/* reboot by watchdog */
81322851890Sopenharmony_ci+#define BOOT_WATCHDOG		(REBOOT_FLAG + 8)
81422851890Sopenharmony_ci+/* enter fastboot mode */
81522851890Sopenharmony_ci #define BOOT_FASTBOOT		(REBOOT_FLAG + 9)
81622851890Sopenharmony_ci+/* enter charging mode */
81722851890Sopenharmony_ci+#define BOOT_CHARGING		(REBOOT_FLAG + 11)
81822851890Sopenharmony_ci+/* enter usb mass storage mode */
81922851890Sopenharmony_ci+#define BOOT_UMS		(REBOOT_FLAG + 12)
82022851890Sopenharmony_ci 
82122851890Sopenharmony_ci #endif
82222851890Sopenharmony_cidiff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
82322851890Sopenharmony_ciindex d9b69bbde..ebfb4e7c1 100644
82422851890Sopenharmony_ci--- a/include/linux/blk_types.h
82522851890Sopenharmony_ci+++ b/include/linux/blk_types.h
82622851890Sopenharmony_ci@@ -46,6 +46,7 @@ struct block_device {
82722851890Sopenharmony_ci 	int			bd_fsfreeze_count;
82822851890Sopenharmony_ci 	/* Mutex for freeze */
82922851890Sopenharmony_ci 	struct mutex		bd_fsfreeze_mutex;
83022851890Sopenharmony_ci+	struct super_block	*bd_fsfreeze_sb;
83122851890Sopenharmony_ci } __randomize_layout;
83222851890Sopenharmony_ci 
83322851890Sopenharmony_ci /*
83422851890Sopenharmony_cidiff --git a/include/linux/bpf.h b/include/linux/bpf.h
83522851890Sopenharmony_ciindex a8b2625e5..469fa0f9f 100644
83622851890Sopenharmony_ci--- a/include/linux/bpf.h
83722851890Sopenharmony_ci+++ b/include/linux/bpf.h
83822851890Sopenharmony_ci@@ -173,7 +173,7 @@ struct bpf_map {
83922851890Sopenharmony_ci 	atomic64_t usercnt;
84022851890Sopenharmony_ci 	struct work_struct work;
84122851890Sopenharmony_ci 	struct mutex freeze_mutex;
84222851890Sopenharmony_ci-	atomic64_t writecnt;
84322851890Sopenharmony_ci+	u64 writecnt; /* writable mmap cnt; protected by freeze_mutex */
84422851890Sopenharmony_ci };
84522851890Sopenharmony_ci 
84622851890Sopenharmony_ci static inline bool map_value_has_spin_lock(const struct bpf_map *map)
84722851890Sopenharmony_ci@@ -1333,7 +1333,6 @@ void bpf_map_charge_move(struct bpf_map_memory *dst,
84822851890Sopenharmony_ci void *bpf_map_area_alloc(u64 size, int numa_node);
84922851890Sopenharmony_ci void *bpf_map_area_mmapable_alloc(u64 size, int numa_node);
85022851890Sopenharmony_ci void bpf_map_area_free(void *base);
85122851890Sopenharmony_ci-bool bpf_map_write_active(const struct bpf_map *map);
85222851890Sopenharmony_ci void bpf_map_init_from_attr(struct bpf_map *map, union bpf_attr *attr);
85322851890Sopenharmony_ci int  generic_map_lookup_batch(struct bpf_map *map,
85422851890Sopenharmony_ci 			      const union bpf_attr *attr,
85522851890Sopenharmony_cidiff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
85622851890Sopenharmony_ciindex 9c88b7da3..14b808b02 100644
85722851890Sopenharmony_ci--- a/include/linux/cgroup.h
85822851890Sopenharmony_ci+++ b/include/linux/cgroup.h
85922851890Sopenharmony_ci@@ -676,6 +676,8 @@ static inline struct psi_group *cgroup_psi(struct cgroup *cgrp)
86022851890Sopenharmony_ci 	return &cgrp->psi;
86122851890Sopenharmony_ci }
86222851890Sopenharmony_ci 
86322851890Sopenharmony_ci+bool cgroup_psi_enabled(void);
86422851890Sopenharmony_ci+
86522851890Sopenharmony_ci static inline void cgroup_init_kthreadd(void)
86622851890Sopenharmony_ci {
86722851890Sopenharmony_ci 	/*
86822851890Sopenharmony_ci@@ -735,6 +737,11 @@ static inline struct psi_group *cgroup_psi(struct cgroup *cgrp)
86922851890Sopenharmony_ci 	return NULL;
87022851890Sopenharmony_ci }
87122851890Sopenharmony_ci 
87222851890Sopenharmony_ci+static inline bool cgroup_psi_enabled(void)
87322851890Sopenharmony_ci+{
87422851890Sopenharmony_ci+	return false;
87522851890Sopenharmony_ci+}
87622851890Sopenharmony_ci+
87722851890Sopenharmony_ci static inline bool task_under_cgroup_hierarchy(struct task_struct *task,
87822851890Sopenharmony_ci 					       struct cgroup *ancestor)
87922851890Sopenharmony_ci {
88022851890Sopenharmony_ci@@ -816,13 +823,33 @@ static inline void cgroup_account_cputime_field(struct task_struct *task,
88122851890Sopenharmony_ci  */
88222851890Sopenharmony_ci #ifdef CONFIG_SOCK_CGROUP_DATA
88322851890Sopenharmony_ci 
88422851890Sopenharmony_ci+#if defined(CONFIG_CGROUP_NET_PRIO) || defined(CONFIG_CGROUP_NET_CLASSID)
88522851890Sopenharmony_ci+extern spinlock_t cgroup_sk_update_lock;
88622851890Sopenharmony_ci+#endif
88722851890Sopenharmony_ci+
88822851890Sopenharmony_ci+void cgroup_sk_alloc_disable(void);
88922851890Sopenharmony_ci void cgroup_sk_alloc(struct sock_cgroup_data *skcd);
89022851890Sopenharmony_ci void cgroup_sk_clone(struct sock_cgroup_data *skcd);
89122851890Sopenharmony_ci void cgroup_sk_free(struct sock_cgroup_data *skcd);
89222851890Sopenharmony_ci 
89322851890Sopenharmony_ci static inline struct cgroup *sock_cgroup_ptr(struct sock_cgroup_data *skcd)
89422851890Sopenharmony_ci {
89522851890Sopenharmony_ci-	return skcd->cgroup;
89622851890Sopenharmony_ci+#if defined(CONFIG_CGROUP_NET_PRIO) || defined(CONFIG_CGROUP_NET_CLASSID)
89722851890Sopenharmony_ci+	unsigned long v;
89822851890Sopenharmony_ci+
89922851890Sopenharmony_ci+	/*
90022851890Sopenharmony_ci+	 * @skcd->val is 64bit but the following is safe on 32bit too as we
90122851890Sopenharmony_ci+	 * just need the lower ulong to be written and read atomically.
90222851890Sopenharmony_ci+	 */
90322851890Sopenharmony_ci+	v = READ_ONCE(skcd->val);
90422851890Sopenharmony_ci+
90522851890Sopenharmony_ci+	if (v & 3)
90622851890Sopenharmony_ci+		return &cgrp_dfl_root.cgrp;
90722851890Sopenharmony_ci+
90822851890Sopenharmony_ci+	return (struct cgroup *)(unsigned long)v ?: &cgrp_dfl_root.cgrp;
90922851890Sopenharmony_ci+#else
91022851890Sopenharmony_ci+	return (struct cgroup *)(unsigned long)skcd->val;
91122851890Sopenharmony_ci+#endif
91222851890Sopenharmony_ci }
91322851890Sopenharmony_ci 
91422851890Sopenharmony_ci #else	/* CONFIG_CGROUP_DATA */
91522851890Sopenharmony_cidiff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
91622851890Sopenharmony_ciindex 03a5de5f9..d9897d0b1 100644
91722851890Sopenharmony_ci--- a/include/linux/clk-provider.h
91822851890Sopenharmony_ci+++ b/include/linux/clk-provider.h
91922851890Sopenharmony_ci@@ -599,6 +599,7 @@ struct clk_divider {
92022851890Sopenharmony_ci 	u8		shift;
92122851890Sopenharmony_ci 	u8		width;
92222851890Sopenharmony_ci 	u8		flags;
92322851890Sopenharmony_ci+	unsigned long	max_prate;
92422851890Sopenharmony_ci 	const struct clk_div_table	*table;
92522851890Sopenharmony_ci 	spinlock_t	*lock;
92622851890Sopenharmony_ci };
92722851890Sopenharmony_ci@@ -936,6 +937,8 @@ void clk_hw_unregister_fixed_factor(struct clk_hw *hw);
92822851890Sopenharmony_ci  * CLK_FRAC_DIVIDER_BIG_ENDIAN - By default little endian register accesses are
92922851890Sopenharmony_ci  *	used for the divider register.  Setting this flag makes the register
93022851890Sopenharmony_ci  *	accesses big endian.
93122851890Sopenharmony_ci+ * CLK_FRAC_DIVIDER_NO_LIMIT - not need to follow the 20 times limit on
93222851890Sopenharmony_ci+ *	fractional divider
93322851890Sopenharmony_ci  */
93422851890Sopenharmony_ci struct clk_fractional_divider {
93522851890Sopenharmony_ci 	struct clk_hw	hw;
93622851890Sopenharmony_ci@@ -947,6 +950,7 @@ struct clk_fractional_divider {
93722851890Sopenharmony_ci 	u8		nwidth;
93822851890Sopenharmony_ci 	u32		nmask;
93922851890Sopenharmony_ci 	u8		flags;
94022851890Sopenharmony_ci+	unsigned long	max_prate;
94122851890Sopenharmony_ci 	void		(*approximation)(struct clk_hw *hw,
94222851890Sopenharmony_ci 				unsigned long rate, unsigned long *parent_rate,
94322851890Sopenharmony_ci 				unsigned long *m, unsigned long *n);
94422851890Sopenharmony_ci@@ -957,6 +961,7 @@ struct clk_fractional_divider {
94522851890Sopenharmony_ci 
94622851890Sopenharmony_ci #define CLK_FRAC_DIVIDER_ZERO_BASED		BIT(0)
94722851890Sopenharmony_ci #define CLK_FRAC_DIVIDER_BIG_ENDIAN		BIT(1)
94822851890Sopenharmony_ci+#define CLK_FRAC_DIVIDER_NO_LIMIT		BIT(2)
94922851890Sopenharmony_ci 
95022851890Sopenharmony_ci extern const struct clk_ops clk_fractional_divider_ops;
95122851890Sopenharmony_ci struct clk *clk_register_fractional_divider(struct device *dev,
95222851890Sopenharmony_ci@@ -1017,6 +1022,9 @@ extern const struct clk_ops clk_multiplier_ops;
95322851890Sopenharmony_ci  * @mux_hw:	handle between composite and hardware-specific mux clock
95422851890Sopenharmony_ci  * @rate_hw:	handle between composite and hardware-specific rate clock
95522851890Sopenharmony_ci  * @gate_hw:	handle between composite and hardware-specific gate clock
95622851890Sopenharmony_ci+ * @brother_hw: a member of clk_composite who has the common parent clocks
95722851890Sopenharmony_ci+ *              with another clk_composite, and it's also a handle between
95822851890Sopenharmony_ci+ *              common and hardware-specific interfaces
95922851890Sopenharmony_ci  * @mux_ops:	clock ops for mux
96022851890Sopenharmony_ci  * @rate_ops:	clock ops for rate
96122851890Sopenharmony_ci  * @gate_ops:	clock ops for gate
96222851890Sopenharmony_ci@@ -1028,6 +1036,7 @@ struct clk_composite {
96322851890Sopenharmony_ci 	struct clk_hw	*mux_hw;
96422851890Sopenharmony_ci 	struct clk_hw	*rate_hw;
96522851890Sopenharmony_ci 	struct clk_hw	*gate_hw;
96622851890Sopenharmony_ci+	struct clk_hw	*brother_hw;
96722851890Sopenharmony_ci 
96822851890Sopenharmony_ci 	const struct clk_ops	*mux_ops;
96922851890Sopenharmony_ci 	const struct clk_ops	*rate_ops;
97022851890Sopenharmony_cidiff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
97122851890Sopenharmony_ciindex 04c20de66..047f449d3 100644
97222851890Sopenharmony_ci--- a/include/linux/cpuset.h
97322851890Sopenharmony_ci+++ b/include/linux/cpuset.h
97422851890Sopenharmony_ci@@ -15,6 +15,7 @@
97522851890Sopenharmony_ci #include <linux/cpumask.h>
97622851890Sopenharmony_ci #include <linux/nodemask.h>
97722851890Sopenharmony_ci #include <linux/mm.h>
97822851890Sopenharmony_ci+#include <linux/mmu_context.h>
97922851890Sopenharmony_ci #include <linux/jump_label.h>
98022851890Sopenharmony_ci 
98122851890Sopenharmony_ci #ifdef CONFIG_CPUSETS
98222851890Sopenharmony_ci@@ -162,6 +163,8 @@ static inline void set_mems_allowed(nodemask_t nodemask)
98322851890Sopenharmony_ci 	task_unlock(current);
98422851890Sopenharmony_ci }
98522851890Sopenharmony_ci 
98622851890Sopenharmony_ci+extern void cpuset_hotplug_workfn(struct work_struct *work);
98722851890Sopenharmony_ci+
98822851890Sopenharmony_ci #else /* !CONFIG_CPUSETS */
98922851890Sopenharmony_ci 
99022851890Sopenharmony_ci static inline bool cpusets_enabled(void) { return false; }
99122851890Sopenharmony_ci@@ -184,7 +187,7 @@ static inline void cpuset_read_unlock(void) { }
99222851890Sopenharmony_ci static inline void cpuset_cpus_allowed(struct task_struct *p,
99322851890Sopenharmony_ci 				       struct cpumask *mask)
99422851890Sopenharmony_ci {
99522851890Sopenharmony_ci-	cpumask_copy(mask, cpu_possible_mask);
99622851890Sopenharmony_ci+	cpumask_copy(mask, task_cpu_possible_mask(p));
99722851890Sopenharmony_ci }
99822851890Sopenharmony_ci 
99922851890Sopenharmony_ci static inline void cpuset_cpus_allowed_fallback(struct task_struct *p)
100022851890Sopenharmony_ci@@ -280,6 +283,8 @@ static inline bool read_mems_allowed_retry(unsigned int seq)
100122851890Sopenharmony_ci 	return false;
100222851890Sopenharmony_ci }
100322851890Sopenharmony_ci 
100422851890Sopenharmony_ci+static inline void cpuset_hotplug_workfn(struct work_struct *work) {}
100522851890Sopenharmony_ci+
100622851890Sopenharmony_ci #endif /* !CONFIG_CPUSETS */
100722851890Sopenharmony_ci 
100822851890Sopenharmony_ci #endif /* _LINUX_CPUSET_H */
100922851890Sopenharmony_cidiff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h
101022851890Sopenharmony_ciindex 0c5706abb..fc3c3f21f 100644
101122851890Sopenharmony_ci--- a/include/linux/dma-buf.h
101222851890Sopenharmony_ci+++ b/include/linux/dma-buf.h
101322851890Sopenharmony_ci@@ -209,6 +209,41 @@ struct dma_buf_ops {
101422851890Sopenharmony_ci 	 */
101522851890Sopenharmony_ci 	int (*begin_cpu_access)(struct dma_buf *, enum dma_data_direction);
101622851890Sopenharmony_ci 
101722851890Sopenharmony_ci+	/**
101822851890Sopenharmony_ci+	 * @begin_cpu_access_partial:
101922851890Sopenharmony_ci+	 *
102022851890Sopenharmony_ci+	 * This is called from dma_buf_begin_cpu_access_partial() and allows the
102122851890Sopenharmony_ci+	 * exporter to ensure that the memory specified in the range is
102222851890Sopenharmony_ci+	 * available for cpu access - the exporter might need to allocate or
102322851890Sopenharmony_ci+	 * swap-in and pin the backing storage.
102422851890Sopenharmony_ci+	 * The exporter also needs to ensure that cpu access is
102522851890Sopenharmony_ci+	 * coherent for the access direction. The direction can be used by the
102622851890Sopenharmony_ci+	 * exporter to optimize the cache flushing, i.e. access with a different
102722851890Sopenharmony_ci+	 * direction (read instead of write) might return stale or even bogus
102822851890Sopenharmony_ci+	 * data (e.g. when the exporter needs to copy the data to temporary
102922851890Sopenharmony_ci+	 * storage).
103022851890Sopenharmony_ci+	 *
103122851890Sopenharmony_ci+	 * This callback is optional.
103222851890Sopenharmony_ci+	 *
103322851890Sopenharmony_ci+	 * FIXME: This is both called through the DMA_BUF_IOCTL_SYNC command
103422851890Sopenharmony_ci+	 * from userspace (where storage shouldn't be pinned to avoid handing
103522851890Sopenharmony_ci+	 * de-factor mlock rights to userspace) and for the kernel-internal
103622851890Sopenharmony_ci+	 * users of the various kmap interfaces, where the backing storage must
103722851890Sopenharmony_ci+	 * be pinned to guarantee that the atomic kmap calls can succeed. Since
103822851890Sopenharmony_ci+	 * there's no in-kernel users of the kmap interfaces yet this isn't a
103922851890Sopenharmony_ci+	 * real problem.
104022851890Sopenharmony_ci+	 *
104122851890Sopenharmony_ci+	 * Returns:
104222851890Sopenharmony_ci+	 *
104322851890Sopenharmony_ci+	 * 0 on success or a negative error code on failure. This can for
104422851890Sopenharmony_ci+	 * example fail when the backing storage can't be allocated. Can also
104522851890Sopenharmony_ci+	 * return -ERESTARTSYS or -EINTR when the call has been interrupted and
104622851890Sopenharmony_ci+	 * needs to be restarted.
104722851890Sopenharmony_ci+	 */
104822851890Sopenharmony_ci+	int (*begin_cpu_access_partial)(struct dma_buf *dmabuf,
104922851890Sopenharmony_ci+					enum dma_data_direction,
105022851890Sopenharmony_ci+					unsigned int offset, unsigned int len);
105122851890Sopenharmony_ci+
105222851890Sopenharmony_ci 	/**
105322851890Sopenharmony_ci 	 * @end_cpu_access:
105422851890Sopenharmony_ci 	 *
105522851890Sopenharmony_ci@@ -228,6 +263,28 @@ struct dma_buf_ops {
105622851890Sopenharmony_ci 	 */
105722851890Sopenharmony_ci 	int (*end_cpu_access)(struct dma_buf *, enum dma_data_direction);
105822851890Sopenharmony_ci 
105922851890Sopenharmony_ci+	/**
106022851890Sopenharmony_ci+	 * @end_cpu_access_partial:
106122851890Sopenharmony_ci+	 *
106222851890Sopenharmony_ci+	 * This is called from dma_buf_end_cpu_access_partial() when the
106322851890Sopenharmony_ci+	 * importer is done accessing the CPU. The exporter can use to limit
106422851890Sopenharmony_ci+	 * cache flushing to only the range specefied and to unpin any
106522851890Sopenharmony_ci+	 * resources pinned in @begin_cpu_access_umapped.
106622851890Sopenharmony_ci+	 * The result of any dma_buf kmap calls after end_cpu_access_partial is
106722851890Sopenharmony_ci+	 * undefined.
106822851890Sopenharmony_ci+	 *
106922851890Sopenharmony_ci+	 * This callback is optional.
107022851890Sopenharmony_ci+	 *
107122851890Sopenharmony_ci+	 * Returns:
107222851890Sopenharmony_ci+	 *
107322851890Sopenharmony_ci+	 * 0 on success or a negative error code on failure. Can return
107422851890Sopenharmony_ci+	 * -ERESTARTSYS or -EINTR when the call has been interrupted and needs
107522851890Sopenharmony_ci+	 * to be restarted.
107622851890Sopenharmony_ci+	 */
107722851890Sopenharmony_ci+	int (*end_cpu_access_partial)(struct dma_buf *dmabuf,
107822851890Sopenharmony_ci+				      enum dma_data_direction,
107922851890Sopenharmony_ci+				      unsigned int offset, unsigned int len);
108022851890Sopenharmony_ci+
108122851890Sopenharmony_ci 	/**
108222851890Sopenharmony_ci 	 * @mmap:
108322851890Sopenharmony_ci 	 *
108422851890Sopenharmony_ci@@ -267,6 +324,35 @@ struct dma_buf_ops {
108522851890Sopenharmony_ci 
108622851890Sopenharmony_ci 	void *(*vmap)(struct dma_buf *);
108722851890Sopenharmony_ci 	void (*vunmap)(struct dma_buf *, void *vaddr);
108822851890Sopenharmony_ci+
108922851890Sopenharmony_ci+	/**
109022851890Sopenharmony_ci+	 * @get_uuid
109122851890Sopenharmony_ci+	 *
109222851890Sopenharmony_ci+	 * This is called by dma_buf_get_uuid to get the UUID which identifies
109322851890Sopenharmony_ci+	 * the buffer to virtio devices.
109422851890Sopenharmony_ci+	 *
109522851890Sopenharmony_ci+	 * This callback is optional.
109622851890Sopenharmony_ci+	 *
109722851890Sopenharmony_ci+	 * Returns:
109822851890Sopenharmony_ci+	 *
109922851890Sopenharmony_ci+	 * 0 on success or a negative error code on failure. On success uuid
110022851890Sopenharmony_ci+	 * will be populated with the buffer's UUID.
110122851890Sopenharmony_ci+	 */
110222851890Sopenharmony_ci+	int (*get_uuid)(struct dma_buf *dmabuf, uuid_t *uuid);
110322851890Sopenharmony_ci+
110422851890Sopenharmony_ci+	/**
110522851890Sopenharmony_ci+	 * @get_flags:
110622851890Sopenharmony_ci+	 *
110722851890Sopenharmony_ci+	 * This is called by dma_buf_get_flags and is used to get the buffer's
110822851890Sopenharmony_ci+	 * flags.
110922851890Sopenharmony_ci+	 * This callback is optional.
111022851890Sopenharmony_ci+	 *
111122851890Sopenharmony_ci+	 * Returns:
111222851890Sopenharmony_ci+	 *
111322851890Sopenharmony_ci+	 * 0 on success or a negative error code on failure. On success flags
111422851890Sopenharmony_ci+	 * will be populated with the buffer's flags.
111522851890Sopenharmony_ci+	 */
111622851890Sopenharmony_ci+	int (*get_flags)(struct dma_buf *dmabuf, unsigned long *flags);
111722851890Sopenharmony_ci };
111822851890Sopenharmony_ci 
111922851890Sopenharmony_ci /**
112022851890Sopenharmony_ci@@ -297,6 +383,9 @@ struct dma_buf_ops {
112122851890Sopenharmony_ci  * @sysfs_entry: for exposing information about this buffer in sysfs.
112222851890Sopenharmony_ci  * The attachment_uid member of @sysfs_entry is protected by dma_resv lock
112322851890Sopenharmony_ci  * and is incremented on each attach.
112422851890Sopenharmony_ci+ * @mmap_count: number of times buffer has been mmapped.
112522851890Sopenharmony_ci+ * @exp_vm_ops: the vm ops provided by the buffer exporter.
112622851890Sopenharmony_ci+ * @vm_ops: the overridden vm_ops used to track mmap_count of the buffer.
112722851890Sopenharmony_ci  *
112822851890Sopenharmony_ci  * This represents a shared buffer, created by calling dma_buf_export(). The
112922851890Sopenharmony_ci  * userspace representation is a normal file descriptor, which can be created by
113022851890Sopenharmony_ci@@ -341,7 +430,12 @@ struct dma_buf {
113122851890Sopenharmony_ci 	struct dma_buf_sysfs_entry {
113222851890Sopenharmony_ci 		struct kobject kobj;
113322851890Sopenharmony_ci 		struct dma_buf *dmabuf;
113422851890Sopenharmony_ci+		unsigned int attachment_uid;
113522851890Sopenharmony_ci+		struct kset *attach_stats_kset;
113622851890Sopenharmony_ci 	} *sysfs_entry;
113722851890Sopenharmony_ci+	int mmap_count;
113822851890Sopenharmony_ci+	const struct vm_operations_struct *exp_vm_ops;
113922851890Sopenharmony_ci+	struct vm_operations_struct vm_ops;
114022851890Sopenharmony_ci #endif
114122851890Sopenharmony_ci };
114222851890Sopenharmony_ci 
114322851890Sopenharmony_ci@@ -392,6 +486,9 @@ struct dma_buf_attach_ops {
114422851890Sopenharmony_ci  * @importer_ops: importer operations for this attachment, if provided
114522851890Sopenharmony_ci  * dma_buf_map/unmap_attachment() must be called with the dma_resv lock held.
114622851890Sopenharmony_ci  * @importer_priv: importer specific attachment data.
114722851890Sopenharmony_ci+ * @dma_map_attrs: DMA attributes to be used when the exporter maps the buffer
114822851890Sopenharmony_ci+ * through dma_buf_map_attachment.
114922851890Sopenharmony_ci+ * @sysfs_entry: For exposing information about this attachment in sysfs.
115022851890Sopenharmony_ci  *
115122851890Sopenharmony_ci  * This structure holds the attachment information between the dma_buf buffer
115222851890Sopenharmony_ci  * and its user device(s). The list contains one attachment struct per device
115322851890Sopenharmony_ci@@ -412,6 +509,14 @@ struct dma_buf_attachment {
115422851890Sopenharmony_ci 	const struct dma_buf_attach_ops *importer_ops;
115522851890Sopenharmony_ci 	void *importer_priv;
115622851890Sopenharmony_ci 	void *priv;
115722851890Sopenharmony_ci+	unsigned long dma_map_attrs;
115822851890Sopenharmony_ci+#ifdef CONFIG_DMABUF_SYSFS_STATS
115922851890Sopenharmony_ci+	/* for sysfs stats */
116022851890Sopenharmony_ci+	struct dma_buf_attach_sysfs_entry {
116122851890Sopenharmony_ci+		struct kobject kobj;
116222851890Sopenharmony_ci+		unsigned int map_counter;
116322851890Sopenharmony_ci+	} *sysfs_entry;
116422851890Sopenharmony_ci+#endif
116522851890Sopenharmony_ci };
116622851890Sopenharmony_ci 
116722851890Sopenharmony_ci /**
116822851890Sopenharmony_ci@@ -489,6 +594,9 @@ dma_buf_attachment_is_dynamic(struct dma_buf_attachment *attach)
116922851890Sopenharmony_ci 	return !!attach->importer_ops;
117022851890Sopenharmony_ci }
117122851890Sopenharmony_ci 
117222851890Sopenharmony_ci+int get_each_dmabuf(int (*callback)(const struct dma_buf *dmabuf,
117322851890Sopenharmony_ci+		    void *private), void *private);
117422851890Sopenharmony_ci+int is_dma_buf_file(struct file *file);
117522851890Sopenharmony_ci struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
117622851890Sopenharmony_ci 					  struct device *dev);
117722851890Sopenharmony_ci struct dma_buf_attachment *
117822851890Sopenharmony_ci@@ -513,13 +621,21 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *, struct sg_table *,
117922851890Sopenharmony_ci void dma_buf_move_notify(struct dma_buf *dma_buf);
118022851890Sopenharmony_ci int dma_buf_begin_cpu_access(struct dma_buf *dma_buf,
118122851890Sopenharmony_ci 			     enum dma_data_direction dir);
118222851890Sopenharmony_ci+int dma_buf_begin_cpu_access_partial(struct dma_buf *dma_buf,
118322851890Sopenharmony_ci+				     enum dma_data_direction dir,
118422851890Sopenharmony_ci+				     unsigned int offset, unsigned int len);
118522851890Sopenharmony_ci int dma_buf_end_cpu_access(struct dma_buf *dma_buf,
118622851890Sopenharmony_ci 			   enum dma_data_direction dir);
118722851890Sopenharmony_ci+int dma_buf_end_cpu_access_partial(struct dma_buf *dma_buf,
118822851890Sopenharmony_ci+				     enum dma_data_direction dir,
118922851890Sopenharmony_ci+				     unsigned int offset, unsigned int len);
119022851890Sopenharmony_ci 
119122851890Sopenharmony_ci int dma_buf_mmap(struct dma_buf *, struct vm_area_struct *,
119222851890Sopenharmony_ci 		 unsigned long);
119322851890Sopenharmony_ci void *dma_buf_vmap(struct dma_buf *);
119422851890Sopenharmony_ci void dma_buf_vunmap(struct dma_buf *, void *vaddr);
119522851890Sopenharmony_ci+int dma_buf_get_flags(struct dma_buf *dmabuf, unsigned long *flags);
119622851890Sopenharmony_ci+int dma_buf_get_uuid(struct dma_buf *dmabuf, uuid_t *uuid);
119722851890Sopenharmony_ci 
119822851890Sopenharmony_ci #ifdef CONFIG_DMABUF_PROCESS_INFO
119922851890Sopenharmony_ci /**
120022851890Sopenharmony_cidiff --git a/include/linux/dma-fence.h b/include/linux/dma-fence.h
120122851890Sopenharmony_ciindex 09e23adb3..9f12efaaa 100644
120222851890Sopenharmony_ci--- a/include/linux/dma-fence.h
120322851890Sopenharmony_ci+++ b/include/linux/dma-fence.h
120422851890Sopenharmony_ci@@ -372,6 +372,9 @@ static inline void __dma_fence_might_wait(void) {}
120522851890Sopenharmony_ci 
120622851890Sopenharmony_ci int dma_fence_signal(struct dma_fence *fence);
120722851890Sopenharmony_ci int dma_fence_signal_locked(struct dma_fence *fence);
120822851890Sopenharmony_ci+int dma_fence_signal_timestamp(struct dma_fence *fence, ktime_t timestamp);
120922851890Sopenharmony_ci+int dma_fence_signal_timestamp_locked(struct dma_fence *fence,
121022851890Sopenharmony_ci+				      ktime_t timestamp);
121122851890Sopenharmony_ci signed long dma_fence_default_wait(struct dma_fence *fence,
121222851890Sopenharmony_ci 				   bool intr, signed long timeout);
121322851890Sopenharmony_ci int dma_fence_add_callback(struct dma_fence *fence,
121422851890Sopenharmony_cidiff --git a/include/linux/dma-heap.h b/include/linux/dma-heap.h
121522851890Sopenharmony_ciindex 83b8cfb2d..e8f0e92c2 100644
121622851890Sopenharmony_ci--- a/include/linux/dma-heap.h
121722851890Sopenharmony_ci+++ b/include/linux/dma-heap.h
121822851890Sopenharmony_ci@@ -16,15 +16,17 @@ struct dma_heap;
121922851890Sopenharmony_ci 
122022851890Sopenharmony_ci /**
122122851890Sopenharmony_ci  * struct dma_heap_ops - ops to operate on a given heap
122222851890Sopenharmony_ci- * @allocate:		allocate dmabuf and return fd
122322851890Sopenharmony_ci+ * @allocate:		allocate dmabuf and return struct dma_buf ptr
122422851890Sopenharmony_ci+ * @get_pool_size:	if heap maintains memory pools, get pool size in bytes
122522851890Sopenharmony_ci  *
122622851890Sopenharmony_ci- * allocate returns dmabuf fd  on success, -errno on error.
122722851890Sopenharmony_ci+ * allocate returns dmabuf on success, ERR_PTR(-errno) on error.
122822851890Sopenharmony_ci  */
122922851890Sopenharmony_ci struct dma_heap_ops {
123022851890Sopenharmony_ci-	int (*allocate)(struct dma_heap *heap,
123122851890Sopenharmony_ci+	struct dma_buf *(*allocate)(struct dma_heap *heap,
123222851890Sopenharmony_ci 			unsigned long len,
123322851890Sopenharmony_ci 			unsigned long fd_flags,
123422851890Sopenharmony_ci 			unsigned long heap_flags);
123522851890Sopenharmony_ci+	long (*get_pool_size)(struct dma_heap *heap);
123622851890Sopenharmony_ci };
123722851890Sopenharmony_ci 
123822851890Sopenharmony_ci /**
123922851890Sopenharmony_ci@@ -50,6 +52,15 @@ struct dma_heap_export_info {
124022851890Sopenharmony_ci  */
124122851890Sopenharmony_ci void *dma_heap_get_drvdata(struct dma_heap *heap);
124222851890Sopenharmony_ci 
124322851890Sopenharmony_ci+/**
124422851890Sopenharmony_ci+ * dma_heap_get_dev() - get device struct for the heap
124522851890Sopenharmony_ci+ * @heap: DMA-Heap to retrieve device struct from
124622851890Sopenharmony_ci+ *
124722851890Sopenharmony_ci+ * Returns:
124822851890Sopenharmony_ci+ * The device struct for the heap.
124922851890Sopenharmony_ci+ */
125022851890Sopenharmony_ci+struct device *dma_heap_get_dev(struct dma_heap *heap);
125122851890Sopenharmony_ci+
125222851890Sopenharmony_ci /**
125322851890Sopenharmony_ci  * dma_heap_get_name() - get heap name
125422851890Sopenharmony_ci  * @heap: DMA-Heap to retrieve private data for
125522851890Sopenharmony_ci@@ -65,4 +76,49 @@ const char *dma_heap_get_name(struct dma_heap *heap);
125622851890Sopenharmony_ci  */
125722851890Sopenharmony_ci struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info);
125822851890Sopenharmony_ci 
125922851890Sopenharmony_ci+/**
126022851890Sopenharmony_ci+ * dma_heap_put - drops a reference to a dmabuf heaps, potentially freeing it
126122851890Sopenharmony_ci+ * @heap:		heap pointer
126222851890Sopenharmony_ci+ */
126322851890Sopenharmony_ci+void dma_heap_put(struct dma_heap *heap);
126422851890Sopenharmony_ci+
126522851890Sopenharmony_ci+/**
126622851890Sopenharmony_ci+ * dma_heap_find - Returns the registered dma_heap with the specified name
126722851890Sopenharmony_ci+ * @name: Name of the heap to find
126822851890Sopenharmony_ci+ *
126922851890Sopenharmony_ci+ * NOTE: dma_heaps returned from this function MUST be released
127022851890Sopenharmony_ci+ * using dma_heap_put() when the user is done.
127122851890Sopenharmony_ci+ */
127222851890Sopenharmony_ci+struct dma_heap *dma_heap_find(const char *name);
127322851890Sopenharmony_ci+
127422851890Sopenharmony_ci+/**
127522851890Sopenharmony_ci+ * dma_heap_buffer_alloc - Allocate dma-buf from a dma_heap
127622851890Sopenharmony_ci+ * @heap:	dma_heap to allocate from
127722851890Sopenharmony_ci+ * @len:	size to allocate
127822851890Sopenharmony_ci+ * @fd_flags:	flags to set on returned dma-buf fd
127922851890Sopenharmony_ci+ * @heap_flags:	flags to pass to the dma heap
128022851890Sopenharmony_ci+ *
128122851890Sopenharmony_ci+ * This is for internal dma-buf allocations only.
128222851890Sopenharmony_ci+ */
128322851890Sopenharmony_ci+struct dma_buf *dma_heap_buffer_alloc(struct dma_heap *heap, size_t len,
128422851890Sopenharmony_ci+				      unsigned int fd_flags,
128522851890Sopenharmony_ci+				      unsigned int heap_flags);
128622851890Sopenharmony_ci+
128722851890Sopenharmony_ci+/** dma_heap_buffer_free - Free dma_buf allocated by dma_heap_buffer_alloc
128822851890Sopenharmony_ci+ * @dma_buf:	dma_buf to free
128922851890Sopenharmony_ci+ *
129022851890Sopenharmony_ci+ * This is really only a simple wrapper to dma_buf_put()
129122851890Sopenharmony_ci+ */
129222851890Sopenharmony_ci+void dma_heap_buffer_free(struct dma_buf *);
129322851890Sopenharmony_ci+
129422851890Sopenharmony_ci+/**
129522851890Sopenharmony_ci+ * dma_heap_bufferfd_alloc - Allocate dma-buf fd from a dma_heap
129622851890Sopenharmony_ci+ * @heap:	dma_heap to allocate from
129722851890Sopenharmony_ci+ * @len:	size to allocate
129822851890Sopenharmony_ci+ * @fd_flags:	flags to set on returned dma-buf fd
129922851890Sopenharmony_ci+ * @heap_flags:	flags to pass to the dma heap
130022851890Sopenharmony_ci+ */
130122851890Sopenharmony_ci+int dma_heap_bufferfd_alloc(struct dma_heap *heap, size_t len,
130222851890Sopenharmony_ci+			    unsigned int fd_flags,
130322851890Sopenharmony_ci+			    unsigned int heap_flags);
130422851890Sopenharmony_ci #endif /* _DMA_HEAPS_H */
130522851890Sopenharmony_cidiff --git a/include/linux/dma-iommu.h b/include/linux/dma-iommu.h
130622851890Sopenharmony_ciindex 2112f21f7..f51561eda 100644
130722851890Sopenharmony_ci--- a/include/linux/dma-iommu.h
130822851890Sopenharmony_ci+++ b/include/linux/dma-iommu.h
130922851890Sopenharmony_ci@@ -37,6 +37,11 @@ void iommu_dma_compose_msi_msg(struct msi_desc *desc,
131022851890Sopenharmony_ci 
131122851890Sopenharmony_ci void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list);
131222851890Sopenharmony_ci 
131322851890Sopenharmony_ci+int iommu_dma_reserve_iova(struct device *dev, dma_addr_t base,
131422851890Sopenharmony_ci+			   u64 size);
131522851890Sopenharmony_ci+
131622851890Sopenharmony_ci+int iommu_dma_enable_best_fit_algo(struct device *dev);
131722851890Sopenharmony_ci+
131822851890Sopenharmony_ci #else /* CONFIG_IOMMU_DMA */
131922851890Sopenharmony_ci 
132022851890Sopenharmony_ci struct iommu_domain;
132122851890Sopenharmony_ci@@ -78,5 +83,16 @@ static inline void iommu_dma_get_resv_regions(struct device *dev, struct list_he
132222851890Sopenharmony_ci {
132322851890Sopenharmony_ci }
132422851890Sopenharmony_ci 
132522851890Sopenharmony_ci+static inline int iommu_dma_reserve_iova(struct device *dev, dma_addr_t base,
132622851890Sopenharmony_ci+					 u64 size)
132722851890Sopenharmony_ci+{
132822851890Sopenharmony_ci+	return -ENODEV;
132922851890Sopenharmony_ci+}
133022851890Sopenharmony_ci+
133122851890Sopenharmony_ci+static inline int iommu_dma_enable_best_fit_algo(struct device *dev)
133222851890Sopenharmony_ci+{
133322851890Sopenharmony_ci+	return -ENODEV;
133422851890Sopenharmony_ci+}
133522851890Sopenharmony_ci+
133622851890Sopenharmony_ci #endif	/* CONFIG_IOMMU_DMA */
133722851890Sopenharmony_ci #endif	/* __DMA_IOMMU_H */
133822851890Sopenharmony_cidiff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h
133922851890Sopenharmony_ciindex a5f89fc4d..a3ff9280f 100644
134022851890Sopenharmony_ci--- a/include/linux/dma-map-ops.h
134122851890Sopenharmony_ci+++ b/include/linux/dma-map-ops.h
134222851890Sopenharmony_ci@@ -258,6 +258,14 @@ void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,
134322851890Sopenharmony_ci #define pgprot_dmacoherent(prot)	pgprot_noncached(prot)
134422851890Sopenharmony_ci #endif
134522851890Sopenharmony_ci 
134622851890Sopenharmony_ci+/*
134722851890Sopenharmony_ci+ * If there is no system cache pgprot, then fallback to dmacoherent
134822851890Sopenharmony_ci+ * pgprot, as the expectation is that the device is not coherent.
134922851890Sopenharmony_ci+ */
135022851890Sopenharmony_ci+#ifndef pgprot_syscached
135122851890Sopenharmony_ci+#define pgprot_syscached(prot)		pgprot_dmacoherent(prot)
135222851890Sopenharmony_ci+#endif
135322851890Sopenharmony_ci+
135422851890Sopenharmony_ci pgprot_t dma_pgprot(struct device *dev, pgprot_t prot, unsigned long attrs);
135522851890Sopenharmony_ci #else
135622851890Sopenharmony_ci static inline pgprot_t dma_pgprot(struct device *dev, pgprot_t prot,
135722851890Sopenharmony_cidiff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
135822851890Sopenharmony_ciindex a7d70cdee..7270f12e2 100644
135922851890Sopenharmony_ci--- a/include/linux/dma-mapping.h
136022851890Sopenharmony_ci+++ b/include/linux/dma-mapping.h
136122851890Sopenharmony_ci@@ -61,6 +61,23 @@
136222851890Sopenharmony_ci  */
136322851890Sopenharmony_ci #define DMA_ATTR_PRIVILEGED		(1UL << 9)
136422851890Sopenharmony_ci 
136522851890Sopenharmony_ci+/*
136622851890Sopenharmony_ci+ * DMA_ATTR_SYS_CACHE_ONLY: used to indicate that the buffer should be mapped
136722851890Sopenharmony_ci+ * with the correct memory attributes so that it can be cached in the system
136822851890Sopenharmony_ci+ * or last level cache. This is useful for buffers that are being mapped for
136922851890Sopenharmony_ci+ * devices that are non-coherent, but can use the system cache.
137022851890Sopenharmony_ci+ */
137122851890Sopenharmony_ci+#define DMA_ATTR_SYS_CACHE_ONLY		(1UL << 10)
137222851890Sopenharmony_ci+
137322851890Sopenharmony_ci+/*
137422851890Sopenharmony_ci+ * DMA_ATTR_SYS_CACHE_ONLY_NWA: used to indicate that the buffer should be
137522851890Sopenharmony_ci+ * mapped with the correct memory attributes so that it can be cached in the
137622851890Sopenharmony_ci+ * system or last level cache, with a no write allocate cache policy. This is
137722851890Sopenharmony_ci+ * useful for buffers that are being mapped for devices that are non-coherent,
137822851890Sopenharmony_ci+ * but can use the system cache.
137922851890Sopenharmony_ci+ */
138022851890Sopenharmony_ci+#define DMA_ATTR_SYS_CACHE_ONLY_NWA	(1UL << 11)
138122851890Sopenharmony_ci+
138222851890Sopenharmony_ci /*
138322851890Sopenharmony_ci  * A dma_addr_t can hold any valid DMA or bus address for the platform.  It can
138422851890Sopenharmony_ci  * be given to a device to use as a DMA source or target.  It is specific to a
138522851890Sopenharmony_cidiff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
138622851890Sopenharmony_ciindex dd357a747..493a047ed 100644
138722851890Sopenharmony_ci--- a/include/linux/dmaengine.h
138822851890Sopenharmony_ci+++ b/include/linux/dmaengine.h
138922851890Sopenharmony_ci@@ -418,6 +418,9 @@ enum dma_slave_buswidth {
139022851890Sopenharmony_ci  * @slave_id: Slave requester id. Only valid for slave channels. The dma
139122851890Sopenharmony_ci  * slave peripheral will have unique id as dma requester which need to be
139222851890Sopenharmony_ci  * pass as slave config.
139322851890Sopenharmony_ci+ * @peripheral_config: peripheral configuration for programming peripheral
139422851890Sopenharmony_ci+ * for dmaengine transfer
139522851890Sopenharmony_ci+ * @peripheral_size: peripheral configuration buffer size
139622851890Sopenharmony_ci  *
139722851890Sopenharmony_ci  * This struct is passed in as configuration data to a DMA engine
139822851890Sopenharmony_ci  * in order to set up a certain channel for DMA transport at runtime.
139922851890Sopenharmony_ci@@ -443,6 +446,8 @@ struct dma_slave_config {
140022851890Sopenharmony_ci 	u32 dst_port_window_size;
140122851890Sopenharmony_ci 	bool device_fc;
140222851890Sopenharmony_ci 	unsigned int slave_id;
140322851890Sopenharmony_ci+	void *peripheral_config;
140422851890Sopenharmony_ci+	size_t peripheral_size;
140522851890Sopenharmony_ci };
140622851890Sopenharmony_ci 
140722851890Sopenharmony_ci /**
140822851890Sopenharmony_cidiff --git a/include/linux/energy_model.h b/include/linux/energy_model.h
140922851890Sopenharmony_ciindex 5f04a2b35..9ca1ea02f 100644
141022851890Sopenharmony_ci--- a/include/linux/energy_model.h
141122851890Sopenharmony_ci+++ b/include/linux/energy_model.h
141222851890Sopenharmony_ci@@ -29,6 +29,8 @@ struct em_perf_state {
141322851890Sopenharmony_ci  * em_perf_domain - Performance domain
141422851890Sopenharmony_ci  * @table:		List of performance states, in ascending order
141522851890Sopenharmony_ci  * @nr_perf_states:	Number of performance states
141622851890Sopenharmony_ci+ * @milliwatts:		Flag indicating the power values are in milli-Watts
141722851890Sopenharmony_ci+ *			or some other scale.
141822851890Sopenharmony_ci  * @cpus:		Cpumask covering the CPUs of the domain. It's here
141922851890Sopenharmony_ci  *			for performance reasons to avoid potential cache
142022851890Sopenharmony_ci  *			misses during energy calculations in the scheduler
142122851890Sopenharmony_ci@@ -43,6 +45,7 @@ struct em_perf_state {
142222851890Sopenharmony_ci struct em_perf_domain {
142322851890Sopenharmony_ci 	struct em_perf_state *table;
142422851890Sopenharmony_ci 	int nr_perf_states;
142522851890Sopenharmony_ci+	int milliwatts;
142622851890Sopenharmony_ci 	unsigned long cpus[];
142722851890Sopenharmony_ci };
142822851890Sopenharmony_ci 
142922851890Sopenharmony_ci@@ -95,7 +98,8 @@ struct em_data_callback {
143022851890Sopenharmony_ci struct em_perf_domain *em_cpu_get(int cpu);
143122851890Sopenharmony_ci struct em_perf_domain *em_pd_get(struct device *dev);
143222851890Sopenharmony_ci int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states,
143322851890Sopenharmony_ci-				struct em_data_callback *cb, cpumask_t *span);
143422851890Sopenharmony_ci+				struct em_data_callback *cb, cpumask_t *span,
143522851890Sopenharmony_ci+				bool milliwatts);
143622851890Sopenharmony_ci void em_dev_unregister_perf_domain(struct device *dev);
143722851890Sopenharmony_ci 
143822851890Sopenharmony_ci /**
143922851890Sopenharmony_ci@@ -119,6 +123,9 @@ static inline unsigned long em_cpu_energy(struct em_perf_domain *pd,
144022851890Sopenharmony_ci 	struct em_perf_state *ps;
144122851890Sopenharmony_ci 	int i, cpu;
144222851890Sopenharmony_ci 
144322851890Sopenharmony_ci+	if (!sum_util)
144422851890Sopenharmony_ci+		return 0;
144522851890Sopenharmony_ci+
144622851890Sopenharmony_ci 	/*
144722851890Sopenharmony_ci 	 * In order to predict the performance state, map the utilization of
144822851890Sopenharmony_ci 	 * the most utilized CPU of the performance domain to a requested
144922851890Sopenharmony_ci@@ -202,7 +209,8 @@ struct em_data_callback {};
145022851890Sopenharmony_ci 
145122851890Sopenharmony_ci static inline
145222851890Sopenharmony_ci int em_dev_register_perf_domain(struct device *dev, unsigned int nr_states,
145322851890Sopenharmony_ci-				struct em_data_callback *cb, cpumask_t *span)
145422851890Sopenharmony_ci+				struct em_data_callback *cb, cpumask_t *span,
145522851890Sopenharmony_ci+				bool milliwatts)
145622851890Sopenharmony_ci {
145722851890Sopenharmony_ci 	return -EINVAL;
145822851890Sopenharmony_ci }
145922851890Sopenharmony_cidiff --git a/include/linux/extcon.h b/include/linux/extcon.h
146022851890Sopenharmony_ciindex 0c19010da..9c4ff7f7d 100644
146122851890Sopenharmony_ci--- a/include/linux/extcon.h
146222851890Sopenharmony_ci+++ b/include/linux/extcon.h
146322851890Sopenharmony_ci@@ -37,6 +37,7 @@
146422851890Sopenharmony_ci /* USB external connector */
146522851890Sopenharmony_ci #define EXTCON_USB		1
146622851890Sopenharmony_ci #define EXTCON_USB_HOST		2
146722851890Sopenharmony_ci+#define EXTCON_USB_VBUS_EN	3
146822851890Sopenharmony_ci 
146922851890Sopenharmony_ci /*
147022851890Sopenharmony_ci  * Charging external connector
147122851890Sopenharmony_cidiff --git a/include/linux/freezer.h b/include/linux/freezer.h
147222851890Sopenharmony_ciindex 27828145c..f753c307b 100644
147322851890Sopenharmony_ci--- a/include/linux/freezer.h
147422851890Sopenharmony_ci+++ b/include/linux/freezer.h
147522851890Sopenharmony_ci@@ -27,6 +27,11 @@ static inline bool frozen(struct task_struct *p)
147622851890Sopenharmony_ci 	return p->flags & PF_FROZEN;
147722851890Sopenharmony_ci }
147822851890Sopenharmony_ci 
147922851890Sopenharmony_ci+static inline bool frozen_or_skipped(struct task_struct *p)
148022851890Sopenharmony_ci+{
148122851890Sopenharmony_ci+	return p->flags & (PF_FROZEN | PF_FREEZER_SKIP);
148222851890Sopenharmony_ci+}
148322851890Sopenharmony_ci+
148422851890Sopenharmony_ci extern bool freezing_slow_path(struct task_struct *p);
148522851890Sopenharmony_ci 
148622851890Sopenharmony_ci /*
148722851890Sopenharmony_ci@@ -270,6 +275,7 @@ static inline int freezable_schedule_hrtimeout_range(ktime_t *expires,
148822851890Sopenharmony_ci 
148922851890Sopenharmony_ci #else /* !CONFIG_FREEZER */
149022851890Sopenharmony_ci static inline bool frozen(struct task_struct *p) { return false; }
149122851890Sopenharmony_ci+static inline bool frozen_or_skipped(struct task_struct *p) { return false; }
149222851890Sopenharmony_ci static inline bool freezing(struct task_struct *p) { return false; }
149322851890Sopenharmony_ci static inline void __thaw_task(struct task_struct *t) {}
149422851890Sopenharmony_ci 
149522851890Sopenharmony_cidiff --git a/include/linux/iommu.h b/include/linux/iommu.h
149622851890Sopenharmony_ciindex e90c267e7..f94cfde78 100644
149722851890Sopenharmony_ci--- a/include/linux/iommu.h
149822851890Sopenharmony_ci+++ b/include/linux/iommu.h
149922851890Sopenharmony_ci@@ -31,6 +31,26 @@
150022851890Sopenharmony_ci  * if the IOMMU page table format is equivalent.
150122851890Sopenharmony_ci  */
150222851890Sopenharmony_ci #define IOMMU_PRIV	(1 << 5)
150322851890Sopenharmony_ci+/*
150422851890Sopenharmony_ci+ * Non-coherent masters can use this page protection flag to set cacheable
150522851890Sopenharmony_ci+ * memory attributes for only a transparent outer level of cache, also known as
150622851890Sopenharmony_ci+ * the last-level or system cache.
150722851890Sopenharmony_ci+ */
150822851890Sopenharmony_ci+#define IOMMU_SYS_CACHE_ONLY	(1 << 6)
150922851890Sopenharmony_ci+/*
151022851890Sopenharmony_ci+ * Non-coherent masters can use this page protection flag to set cacheable
151122851890Sopenharmony_ci+ * memory attributes with a no write allocation cache policy for only a
151222851890Sopenharmony_ci+ * transparent outer level of cache, also known as the last-level or system
151322851890Sopenharmony_ci+ * cache.
151422851890Sopenharmony_ci+ */
151522851890Sopenharmony_ci+#define IOMMU_SYS_CACHE_ONLY_NWA (1 << 7)
151622851890Sopenharmony_ci+
151722851890Sopenharmony_ci+#ifdef CONFIG_NO_GKI
151822851890Sopenharmony_ci+
151922851890Sopenharmony_ci+/* For shoting entire IOMMU tlb once */
152022851890Sopenharmony_ci+#define IOMMU_TLB_SHOT_ENTIRE	(1 << 8)
152122851890Sopenharmony_ci+
152222851890Sopenharmony_ci+#endif
152322851890Sopenharmony_ci 
152422851890Sopenharmony_ci struct iommu_ops;
152522851890Sopenharmony_ci struct iommu_group;
152622851890Sopenharmony_ci@@ -190,7 +210,12 @@ struct iommu_iotlb_gather {
152722851890Sopenharmony_ci  * @attach_dev: attach device to an iommu domain
152822851890Sopenharmony_ci  * @detach_dev: detach device from an iommu domain
152922851890Sopenharmony_ci  * @map: map a physically contiguous memory region to an iommu domain
153022851890Sopenharmony_ci+ * @map_pages: map a physically contiguous set of pages of the same size to
153122851890Sopenharmony_ci+ *             an iommu domain.
153222851890Sopenharmony_ci+ * @map_sg: map a scatter-gather list of physically contiguous chunks to
153322851890Sopenharmony_ci+ *          an iommu domain.
153422851890Sopenharmony_ci  * @unmap: unmap a physically contiguous memory region from an iommu domain
153522851890Sopenharmony_ci+ * @unmap_pages: unmap a number of pages of the same size from an iommu domain
153622851890Sopenharmony_ci  * @flush_iotlb_all: Synchronously flush all hardware TLBs for this domain
153722851890Sopenharmony_ci  * @iotlb_sync_map: Sync mappings created recently using @map to the hardware
153822851890Sopenharmony_ci  * @iotlb_sync: Flush all queued ranges from the hardware TLBs and empty flush
153922851890Sopenharmony_ci@@ -241,10 +266,20 @@ struct iommu_ops {
154022851890Sopenharmony_ci 	void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
154122851890Sopenharmony_ci 	int (*map)(struct iommu_domain *domain, unsigned long iova,
154222851890Sopenharmony_ci 		   phys_addr_t paddr, size_t size, int prot, gfp_t gfp);
154322851890Sopenharmony_ci+	int (*map_pages)(struct iommu_domain *domain, unsigned long iova,
154422851890Sopenharmony_ci+			 phys_addr_t paddr, size_t pgsize, size_t pgcount,
154522851890Sopenharmony_ci+			 int prot, gfp_t gfp, size_t *mapped);
154622851890Sopenharmony_ci+	int (*map_sg)(struct iommu_domain *domain, unsigned long iova,
154722851890Sopenharmony_ci+		      struct scatterlist *sg, unsigned int nents, int prot,
154822851890Sopenharmony_ci+		      gfp_t gfp, size_t *mapped);
154922851890Sopenharmony_ci 	size_t (*unmap)(struct iommu_domain *domain, unsigned long iova,
155022851890Sopenharmony_ci 		     size_t size, struct iommu_iotlb_gather *iotlb_gather);
155122851890Sopenharmony_ci+	size_t (*unmap_pages)(struct iommu_domain *domain, unsigned long iova,
155222851890Sopenharmony_ci+			      size_t pgsize, size_t pgcount,
155322851890Sopenharmony_ci+			      struct iommu_iotlb_gather *iotlb_gather);
155422851890Sopenharmony_ci 	void (*flush_iotlb_all)(struct iommu_domain *domain);
155522851890Sopenharmony_ci-	void (*iotlb_sync_map)(struct iommu_domain *domain);
155622851890Sopenharmony_ci+	void (*iotlb_sync_map)(struct iommu_domain *domain, unsigned long iova,
155722851890Sopenharmony_ci+			       size_t size);
155822851890Sopenharmony_ci 	void (*iotlb_sync)(struct iommu_domain *domain,
155922851890Sopenharmony_ci 			   struct iommu_iotlb_gather *iotlb_gather);
156022851890Sopenharmony_ci 	phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova);
156122851890Sopenharmony_ci@@ -561,6 +596,8 @@ static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain,
156222851890Sopenharmony_ci extern struct iommu_group *pci_device_group(struct device *dev);
156322851890Sopenharmony_ci /* Generic device grouping function */
156422851890Sopenharmony_ci extern struct iommu_group *generic_device_group(struct device *dev);
156522851890Sopenharmony_ci+extern void rk_iommu_mask_irq(struct device *dev);
156622851890Sopenharmony_ci+extern void rk_iommu_unmask_irq(struct device *dev);
156722851890Sopenharmony_ci /* FSL-MC device grouping function */
156822851890Sopenharmony_ci struct iommu_group *fsl_mc_device_group(struct device *dev);
156922851890Sopenharmony_ci 
157022851890Sopenharmony_ci@@ -1069,6 +1106,14 @@ static inline struct iommu_fwspec *dev_iommu_fwspec_get(struct device *dev)
157122851890Sopenharmony_ci {
157222851890Sopenharmony_ci 	return NULL;
157322851890Sopenharmony_ci }
157422851890Sopenharmony_ci+
157522851890Sopenharmony_ci+static inline void rk_iommu_mask_irq(struct device *dev)
157622851890Sopenharmony_ci+{
157722851890Sopenharmony_ci+}
157822851890Sopenharmony_ci+
157922851890Sopenharmony_ci+static inline void rk_iommu_unmask_irq(struct device *dev)
158022851890Sopenharmony_ci+{
158122851890Sopenharmony_ci+}
158222851890Sopenharmony_ci #endif /* CONFIG_IOMMU_API */
158322851890Sopenharmony_ci 
158422851890Sopenharmony_ci /**
158522851890Sopenharmony_cidiff --git a/include/linux/iova.h b/include/linux/iova.h
158622851890Sopenharmony_ciindex a0637abff..58713bb72 100644
158722851890Sopenharmony_ci--- a/include/linux/iova.h
158822851890Sopenharmony_ci+++ b/include/linux/iova.h
158922851890Sopenharmony_ci@@ -95,6 +95,7 @@ struct iova_domain {
159022851890Sopenharmony_ci 						   flush-queues */
159122851890Sopenharmony_ci 	atomic_t fq_timer_on;			/* 1 when timer is active, 0
159222851890Sopenharmony_ci 						   when not */
159322851890Sopenharmony_ci+	bool best_fit;
159422851890Sopenharmony_ci };
159522851890Sopenharmony_ci 
159622851890Sopenharmony_ci static inline unsigned long iova_size(struct iova *iova)
159722851890Sopenharmony_cidiff --git a/include/linux/irqchip/arm-gic-v3.h b/include/linux/irqchip/arm-gic-v3.h
159822851890Sopenharmony_ciindex f6d092fdb..ffb0a8705 100644
159922851890Sopenharmony_ci--- a/include/linux/irqchip/arm-gic-v3.h
160022851890Sopenharmony_ci+++ b/include/linux/irqchip/arm-gic-v3.h
160122851890Sopenharmony_ci@@ -708,6 +708,8 @@ static inline bool gic_enable_sre(void)
160222851890Sopenharmony_ci 	return !!(val & ICC_SRE_EL1_SRE);
160322851890Sopenharmony_ci }
160422851890Sopenharmony_ci 
160522851890Sopenharmony_ci+void gic_resume(void);
160622851890Sopenharmony_ci+
160722851890Sopenharmony_ci #endif
160822851890Sopenharmony_ci 
160922851890Sopenharmony_ci #endif
161022851890Sopenharmony_cidiff --git a/include/linux/irqchip/arm-gic-v4.h b/include/linux/irqchip/arm-gic-v4.h
161122851890Sopenharmony_ciindex 6976b8331..943c3411c 100644
161222851890Sopenharmony_ci--- a/include/linux/irqchip/arm-gic-v4.h
161322851890Sopenharmony_ci+++ b/include/linux/irqchip/arm-gic-v4.h
161422851890Sopenharmony_ci@@ -39,6 +39,8 @@ struct its_vpe {
161522851890Sopenharmony_ci 	irq_hw_number_t		vpe_db_lpi;
161622851890Sopenharmony_ci 	/* VPE resident */
161722851890Sopenharmony_ci 	bool			resident;
161822851890Sopenharmony_ci+	/* VPT parse complete */
161922851890Sopenharmony_ci+	bool			ready;
162022851890Sopenharmony_ci 	union {
162122851890Sopenharmony_ci 		/* GICv4.0 implementations */
162222851890Sopenharmony_ci 		struct {
162322851890Sopenharmony_ci@@ -104,6 +106,7 @@ enum its_vcpu_info_cmd_type {
162422851890Sopenharmony_ci 	PROP_UPDATE_AND_INV_VLPI,
162522851890Sopenharmony_ci 	SCHEDULE_VPE,
162622851890Sopenharmony_ci 	DESCHEDULE_VPE,
162722851890Sopenharmony_ci+	COMMIT_VPE,
162822851890Sopenharmony_ci 	INVALL_VPE,
162922851890Sopenharmony_ci 	PROP_UPDATE_VSGI,
163022851890Sopenharmony_ci };
163122851890Sopenharmony_ci@@ -129,6 +132,7 @@ int its_alloc_vcpu_irqs(struct its_vm *vm);
163222851890Sopenharmony_ci void its_free_vcpu_irqs(struct its_vm *vm);
163322851890Sopenharmony_ci int its_make_vpe_resident(struct its_vpe *vpe, bool g0en, bool g1en);
163422851890Sopenharmony_ci int its_make_vpe_non_resident(struct its_vpe *vpe, bool db);
163522851890Sopenharmony_ci+int its_commit_vpe(struct its_vpe *vpe);
163622851890Sopenharmony_ci int its_invall_vpe(struct its_vpe *vpe);
163722851890Sopenharmony_ci int its_map_vlpi(int irq, struct its_vlpi_map *map);
163822851890Sopenharmony_ci int its_get_vlpi(int irq, struct its_vlpi_map *map);
163922851890Sopenharmony_cidiff --git a/include/linux/memblock.h b/include/linux/memblock.h
164022851890Sopenharmony_ciindex 3baea2ef3..2b770134c 100644
164122851890Sopenharmony_ci--- a/include/linux/memblock.h
164222851890Sopenharmony_ci+++ b/include/linux/memblock.h
164322851890Sopenharmony_ci@@ -25,6 +25,10 @@ extern unsigned long max_pfn;
164422851890Sopenharmony_ci  */
164522851890Sopenharmony_ci extern unsigned long long max_possible_pfn;
164622851890Sopenharmony_ci 
164722851890Sopenharmony_ci+#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT
164822851890Sopenharmony_ci+extern int defer_free_memblock(void *unused);
164922851890Sopenharmony_ci+#endif
165022851890Sopenharmony_ci+
165122851890Sopenharmony_ci /**
165222851890Sopenharmony_ci  * enum memblock_flags - definition of memory region attributes
165322851890Sopenharmony_ci  * @MEMBLOCK_NONE: no special request
165422851890Sopenharmony_ci@@ -404,13 +408,13 @@ void *memblock_alloc_try_nid(phys_addr_t size, phys_addr_t align,
165522851890Sopenharmony_ci 			     phys_addr_t min_addr, phys_addr_t max_addr,
165622851890Sopenharmony_ci 			     int nid);
165722851890Sopenharmony_ci 
165822851890Sopenharmony_ci-static inline void * __init memblock_alloc(phys_addr_t size,  phys_addr_t align)
165922851890Sopenharmony_ci+static __always_inline void *memblock_alloc(phys_addr_t size, phys_addr_t align)
166022851890Sopenharmony_ci {
166122851890Sopenharmony_ci 	return memblock_alloc_try_nid(size, align, MEMBLOCK_LOW_LIMIT,
166222851890Sopenharmony_ci 				      MEMBLOCK_ALLOC_ACCESSIBLE, NUMA_NO_NODE);
166322851890Sopenharmony_ci }
166422851890Sopenharmony_ci 
166522851890Sopenharmony_ci-static inline void * __init memblock_alloc_raw(phys_addr_t size,
166622851890Sopenharmony_ci+static inline void *memblock_alloc_raw(phys_addr_t size,
166722851890Sopenharmony_ci 					       phys_addr_t align)
166822851890Sopenharmony_ci {
166922851890Sopenharmony_ci 	return memblock_alloc_try_nid_raw(size, align, MEMBLOCK_LOW_LIMIT,
167022851890Sopenharmony_ci@@ -418,7 +422,7 @@ static inline void * __init memblock_alloc_raw(phys_addr_t size,
167122851890Sopenharmony_ci 					  NUMA_NO_NODE);
167222851890Sopenharmony_ci }
167322851890Sopenharmony_ci 
167422851890Sopenharmony_ci-static inline void * __init memblock_alloc_from(phys_addr_t size,
167522851890Sopenharmony_ci+static inline void *memblock_alloc_from(phys_addr_t size,
167622851890Sopenharmony_ci 						phys_addr_t align,
167722851890Sopenharmony_ci 						phys_addr_t min_addr)
167822851890Sopenharmony_ci {
167922851890Sopenharmony_ci@@ -426,33 +430,33 @@ static inline void * __init memblock_alloc_from(phys_addr_t size,
168022851890Sopenharmony_ci 				      MEMBLOCK_ALLOC_ACCESSIBLE, NUMA_NO_NODE);
168122851890Sopenharmony_ci }
168222851890Sopenharmony_ci 
168322851890Sopenharmony_ci-static inline void * __init memblock_alloc_low(phys_addr_t size,
168422851890Sopenharmony_ci+static inline void *memblock_alloc_low(phys_addr_t size,
168522851890Sopenharmony_ci 					       phys_addr_t align)
168622851890Sopenharmony_ci {
168722851890Sopenharmony_ci 	return memblock_alloc_try_nid(size, align, MEMBLOCK_LOW_LIMIT,
168822851890Sopenharmony_ci 				      ARCH_LOW_ADDRESS_LIMIT, NUMA_NO_NODE);
168922851890Sopenharmony_ci }
169022851890Sopenharmony_ci 
169122851890Sopenharmony_ci-static inline void * __init memblock_alloc_node(phys_addr_t size,
169222851890Sopenharmony_ci+static inline void *memblock_alloc_node(phys_addr_t size,
169322851890Sopenharmony_ci 						phys_addr_t align, int nid)
169422851890Sopenharmony_ci {
169522851890Sopenharmony_ci 	return memblock_alloc_try_nid(size, align, MEMBLOCK_LOW_LIMIT,
169622851890Sopenharmony_ci 				      MEMBLOCK_ALLOC_ACCESSIBLE, nid);
169722851890Sopenharmony_ci }
169822851890Sopenharmony_ci 
169922851890Sopenharmony_ci-static inline void __init memblock_free_early(phys_addr_t base,
170022851890Sopenharmony_ci+static inline void memblock_free_early(phys_addr_t base,
170122851890Sopenharmony_ci 					      phys_addr_t size)
170222851890Sopenharmony_ci {
170322851890Sopenharmony_ci 	memblock_free(base, size);
170422851890Sopenharmony_ci }
170522851890Sopenharmony_ci 
170622851890Sopenharmony_ci-static inline void __init memblock_free_early_nid(phys_addr_t base,
170722851890Sopenharmony_ci+static inline void memblock_free_early_nid(phys_addr_t base,
170822851890Sopenharmony_ci 						  phys_addr_t size, int nid)
170922851890Sopenharmony_ci {
171022851890Sopenharmony_ci 	memblock_free(base, size);
171122851890Sopenharmony_ci }
171222851890Sopenharmony_ci 
171322851890Sopenharmony_ci-static inline void __init memblock_free_late(phys_addr_t base, phys_addr_t size)
171422851890Sopenharmony_ci+static inline void memblock_free_late(phys_addr_t base, phys_addr_t size)
171522851890Sopenharmony_ci {
171622851890Sopenharmony_ci 	__memblock_free_late(base, size);
171722851890Sopenharmony_ci }
171822851890Sopenharmony_ci@@ -460,7 +464,7 @@ static inline void __init memblock_free_late(phys_addr_t base, phys_addr_t size)
171922851890Sopenharmony_ci /*
172022851890Sopenharmony_ci  * Set the allocation direction to bottom-up or top-down.
172122851890Sopenharmony_ci  */
172222851890Sopenharmony_ci-static inline void __init memblock_set_bottom_up(bool enable)
172322851890Sopenharmony_ci+static inline __init void memblock_set_bottom_up(bool enable)
172422851890Sopenharmony_ci {
172522851890Sopenharmony_ci 	memblock.bottom_up = enable;
172622851890Sopenharmony_ci }
172722851890Sopenharmony_ci@@ -470,7 +474,7 @@ static inline void __init memblock_set_bottom_up(bool enable)
172822851890Sopenharmony_ci  * if this is true, that said, memblock will allocate memory
172922851890Sopenharmony_ci  * in bottom-up direction.
173022851890Sopenharmony_ci  */
173122851890Sopenharmony_ci-static inline bool memblock_bottom_up(void)
173222851890Sopenharmony_ci+static inline __init bool memblock_bottom_up(void)
173322851890Sopenharmony_ci {
173422851890Sopenharmony_ci 	return memblock.bottom_up;
173522851890Sopenharmony_ci }
173622851890Sopenharmony_cidiff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h
173722851890Sopenharmony_ciindex e07f6e61c..7cdc5dfa4 100644
173822851890Sopenharmony_ci--- a/include/linux/mfd/rk808.h
173922851890Sopenharmony_ci+++ b/include/linux/mfd/rk808.h
174022851890Sopenharmony_ci@@ -113,6 +113,235 @@ enum rk808_reg {
174122851890Sopenharmony_ci #define RK808_INT_STS_MSK_REG2	0x4f
174222851890Sopenharmony_ci #define RK808_IO_POL_REG	0x50
174322851890Sopenharmony_ci 
174422851890Sopenharmony_ci+/* RK816 */
174522851890Sopenharmony_ci+enum rk816_reg {
174622851890Sopenharmony_ci+	RK816_ID_DCDC1,
174722851890Sopenharmony_ci+	RK816_ID_DCDC2,
174822851890Sopenharmony_ci+	RK816_ID_DCDC3,
174922851890Sopenharmony_ci+	RK816_ID_DCDC4,
175022851890Sopenharmony_ci+	RK816_ID_LDO1,
175122851890Sopenharmony_ci+	RK816_ID_LDO2,
175222851890Sopenharmony_ci+	RK816_ID_LDO3,
175322851890Sopenharmony_ci+	RK816_ID_LDO4,
175422851890Sopenharmony_ci+	RK816_ID_LDO5,
175522851890Sopenharmony_ci+	RK816_ID_LDO6,
175622851890Sopenharmony_ci+};
175722851890Sopenharmony_ci+
175822851890Sopenharmony_ci+/*VERSION REGISTER*/
175922851890Sopenharmony_ci+#define RK816_CHIP_NAME_REG			0x17
176022851890Sopenharmony_ci+#define RK816_CHIP_VER_REG			0x18
176122851890Sopenharmony_ci+#define RK816_OTP_VER_REG			0x19
176222851890Sopenharmony_ci+#define RK816_NUM_REGULATORS			10
176322851890Sopenharmony_ci+
176422851890Sopenharmony_ci+/*POWER ON/OFF REGISTER*/
176522851890Sopenharmony_ci+#define RK816_VB_MON_REG			0x21
176622851890Sopenharmony_ci+#define RK816_THERMAL_REG			0x22
176722851890Sopenharmony_ci+#define RK816_PWRON_LP_INT_TIME_REG		0x47
176822851890Sopenharmony_ci+#define RK816_PWRON_DB_REG			0x48
176922851890Sopenharmony_ci+#define RK816_DEV_CTRL_REG			0x4B
177022851890Sopenharmony_ci+#define RK816_ON_SOURCE_REG			0xAE
177122851890Sopenharmony_ci+#define RK816_OFF_SOURCE_REG			0xAF
177222851890Sopenharmony_ci+
177322851890Sopenharmony_ci+/*POWER CHANNELS ENABLE REGISTER*/
177422851890Sopenharmony_ci+#define RK816_DCDC_EN_REG1			0x23
177522851890Sopenharmony_ci+#define RK816_DCDC_EN_REG2			0x24
177622851890Sopenharmony_ci+#define RK816_SLP_DCDC_EN_REG			0x25
177722851890Sopenharmony_ci+#define RK816_SLP_LDO_EN_REG			0x26
177822851890Sopenharmony_ci+#define RK816_LDO_EN_REG1			0x27
177922851890Sopenharmony_ci+#define RK816_LDO_EN_REG2			0x28
178022851890Sopenharmony_ci+
178122851890Sopenharmony_ci+/*BUCK AND LDO CONFIG REGISTER*/
178222851890Sopenharmony_ci+#define RK816_BUCK1_CONFIG_REG			0x2E
178322851890Sopenharmony_ci+#define RK816_BUCK1_ON_VSEL_REG			0x2F
178422851890Sopenharmony_ci+#define RK816_BUCK1_SLP_VSEL_REG		0x30
178522851890Sopenharmony_ci+#define RK816_BUCK2_CONFIG_REG			0x32
178622851890Sopenharmony_ci+#define RK816_BUCK2_ON_VSEL_REG			0x33
178722851890Sopenharmony_ci+#define RK816_BUCK2_SLP_VSEL_REG		0x34
178822851890Sopenharmony_ci+#define RK816_BUCK3_CONFIG_REG			0x36
178922851890Sopenharmony_ci+#define RK816_BUCK4_CONFIG_REG			0x37
179022851890Sopenharmony_ci+#define RK816_BUCK4_ON_VSEL_REG			0x38
179122851890Sopenharmony_ci+#define RK816_BUCK4_SLP_VSEL_REG		0x39
179222851890Sopenharmony_ci+#define RK816_LDO1_ON_VSEL_REG			0x3B
179322851890Sopenharmony_ci+#define RK816_LDO1_SLP_VSEL_REG			0x3C
179422851890Sopenharmony_ci+#define RK816_LDO2_ON_VSEL_REG			0x3D
179522851890Sopenharmony_ci+#define RK816_LDO2_SLP_VSEL_REG			0x3E
179622851890Sopenharmony_ci+#define RK816_LDO3_ON_VSEL_REG			0x3F
179722851890Sopenharmony_ci+#define RK816_LDO3_SLP_VSEL_REG			0x40
179822851890Sopenharmony_ci+#define RK816_LDO4_ON_VSEL_REG			0x41
179922851890Sopenharmony_ci+#define RK816_LDO4_SLP_VSEL_REG			0x42
180022851890Sopenharmony_ci+#define RK816_LDO5_ON_VSEL_REG			0x43
180122851890Sopenharmony_ci+#define RK816_LDO5_SLP_VSEL_REG			0x44
180222851890Sopenharmony_ci+#define RK816_LDO6_ON_VSEL_REG			0x45
180322851890Sopenharmony_ci+#define RK816_LDO6_SLP_VSEL_REG			0x46
180422851890Sopenharmony_ci+#define RK816_GPIO_IO_POL_REG			0x50
180522851890Sopenharmony_ci+
180622851890Sopenharmony_ci+/*CHARGER BOOST AND OTG REGISTER*/
180722851890Sopenharmony_ci+#define RK816_OTG_BUCK_LDO_CONFIG_REG           0x2A
180822851890Sopenharmony_ci+#define RK816_CHRG_CONFIG_REG                   0x2B
180922851890Sopenharmony_ci+#define RK816_BOOST_ON_VESL_REG                 0x54
181022851890Sopenharmony_ci+#define RK816_BOOST_SLP_VSEL_REG                0x55
181122851890Sopenharmony_ci+#define RK816_CHRG_BOOST_CONFIG_REG             0x9A
181222851890Sopenharmony_ci+#define RK816_SUP_STS_REG                       0xA0
181322851890Sopenharmony_ci+#define RK816_USB_CTRL_REG                      0xA1
181422851890Sopenharmony_ci+#define RK816_CHRG_CTRL_REG1                    0xA3
181522851890Sopenharmony_ci+#define RK816_CHRG_CTRL_REG2                    0xA4
181622851890Sopenharmony_ci+#define RK816_CHRG_CTRL_REG3                    0xA5
181722851890Sopenharmony_ci+#define RK816_BAT_CTRL_REG                      0xA6
181822851890Sopenharmony_ci+#define RK816_BAT_HTS_TS_REG                    0xA8
181922851890Sopenharmony_ci+#define RK816_BAT_LTS_TS_REG                    0xA9
182022851890Sopenharmony_ci+
182122851890Sopenharmony_ci+#define RK816_TS_CTRL_REG			0xAC
182222851890Sopenharmony_ci+#define RK816_ADC_CTRL_REG			0xAD
182322851890Sopenharmony_ci+#define RK816_GGCON_REG				0xB0
182422851890Sopenharmony_ci+#define RK816_GGSTS_REG				0xB1
182522851890Sopenharmony_ci+#define RK816_ZERO_CUR_ADC_REGH			0xB2
182622851890Sopenharmony_ci+#define RK816_ZERO_CUR_ADC_REGL			0xB3
182722851890Sopenharmony_ci+#define RK816_GASCNT_CAL_REG3			0xB4
182822851890Sopenharmony_ci+#define RK816_GASCNT_CAL_REG2			0xB5
182922851890Sopenharmony_ci+#define RK816_GASCNT_CAL_REG1			0xB6
183022851890Sopenharmony_ci+#define RK816_GASCNT_CAL_REG0			0xB7
183122851890Sopenharmony_ci+#define RK816_GASCNT_REG3			0xB8
183222851890Sopenharmony_ci+#define RK816_GASCNT_REG2			0xB9
183322851890Sopenharmony_ci+#define RK816_GASCNT_REG1			0xBA
183422851890Sopenharmony_ci+#define RK816_GASCNT_REG0			0xBB
183522851890Sopenharmony_ci+#define RK816_BAT_CUR_AVG_REGH			0xBC
183622851890Sopenharmony_ci+#define RK816_BAT_CUR_AVG_REGL			0xBD
183722851890Sopenharmony_ci+#define RK816_TS_ADC_REGH			0xBE
183822851890Sopenharmony_ci+#define RK816_TS_ADC_REGL			0xBF
183922851890Sopenharmony_ci+#define RK816_USB_ADC_REGH			0xC0
184022851890Sopenharmony_ci+#define RK816_USB_ADC_REGL			0xC1
184122851890Sopenharmony_ci+#define RK816_BAT_OCV_REGH			0xC2
184222851890Sopenharmony_ci+#define RK816_BAT_OCV_REGL			0xC3
184322851890Sopenharmony_ci+#define RK816_BAT_VOL_REGH			0xC4
184422851890Sopenharmony_ci+#define RK816_BAT_VOL_REGL			0xC5
184522851890Sopenharmony_ci+#define RK816_RELAX_ENTRY_THRES_REGH		0xC6
184622851890Sopenharmony_ci+#define RK816_RELAX_ENTRY_THRES_REGL		0xC7
184722851890Sopenharmony_ci+#define RK816_RELAX_EXIT_THRES_REGH		0xC8
184822851890Sopenharmony_ci+#define RK816_RELAX_EXIT_THRES_REGL		0xC9
184922851890Sopenharmony_ci+#define RK816_RELAX_VOL1_REGH			0xCA
185022851890Sopenharmony_ci+#define RK816_RELAX_VOL1_REGL			0xCB
185122851890Sopenharmony_ci+#define RK816_RELAX_VOL2_REGH			0xCC
185222851890Sopenharmony_ci+#define RK816_RELAX_VOL2_REGL			0xCD
185322851890Sopenharmony_ci+#define RK816_RELAX_CUR1_REGH			0xCE
185422851890Sopenharmony_ci+#define RK816_RELAX_CUR1_REGL			0xCF
185522851890Sopenharmony_ci+#define RK816_RELAX_CUR2_REGH			0xD0
185622851890Sopenharmony_ci+#define RK816_RELAX_CUR2_REGL			0xD1
185722851890Sopenharmony_ci+#define RK816_CAL_OFFSET_REGH			0xD2
185822851890Sopenharmony_ci+#define RK816_CAL_OFFSET_REGL			0xD3
185922851890Sopenharmony_ci+#define RK816_NON_ACT_TIMER_CNT_REG		0xD4
186022851890Sopenharmony_ci+#define RK816_VCALIB0_REGH			0xD5
186122851890Sopenharmony_ci+#define RK816_VCALIB0_REGL			0xD6
186222851890Sopenharmony_ci+#define RK816_VCALIB1_REGH			0xD7
186322851890Sopenharmony_ci+#define RK816_VCALIB1_REGL			0xD8
186422851890Sopenharmony_ci+#define RK816_FCC_GASCNT_REG3			0xD9
186522851890Sopenharmony_ci+#define RK816_FCC_GASCNT_REG2			0xDA
186622851890Sopenharmony_ci+#define RK816_FCC_GASCNT_REG1			0xDB
186722851890Sopenharmony_ci+#define RK816_FCC_GASCNT_REG0			0xDC
186822851890Sopenharmony_ci+#define RK816_IOFFSET_REGH			0xDD
186922851890Sopenharmony_ci+#define RK816_IOFFSET_REGL			0xDE
187022851890Sopenharmony_ci+#define RK816_SLEEP_CON_SAMP_CUR_REG		0xDF
187122851890Sopenharmony_ci+
187222851890Sopenharmony_ci+/*DATA REGISTER*/
187322851890Sopenharmony_ci+#define RK816_SOC_REG				0xE0
187422851890Sopenharmony_ci+#define RK816_REMAIN_CAP_REG3			0xE1
187522851890Sopenharmony_ci+#define RK816_REMAIN_CAP_REG2			0xE2
187622851890Sopenharmony_ci+#define RK816_REMAIN_CAP_REG1			0xE3
187722851890Sopenharmony_ci+#define RK816_REMAIN_CAP_REG0			0xE4
187822851890Sopenharmony_ci+#define RK816_UPDATE_LEVE_REG			0xE5
187922851890Sopenharmony_ci+#define RK816_NEW_FCC_REG3			0xE6
188022851890Sopenharmony_ci+#define RK816_NEW_FCC_REG2			0xE7
188122851890Sopenharmony_ci+#define RK816_NEW_FCC_REG1			0xE8
188222851890Sopenharmony_ci+#define RK816_NEW_FCC_REG0			0xE9
188322851890Sopenharmony_ci+#define RK816_NON_ACT_TIMER_CNT_REG_SAVE	0xEA
188422851890Sopenharmony_ci+#define RK816_OCV_VOL_VALID_REG			0xEB
188522851890Sopenharmony_ci+#define RK816_REBOOT_CNT_REG			0xEC
188622851890Sopenharmony_ci+#define RK816_PCB_IOFFSET_REG			0xED
188722851890Sopenharmony_ci+#define RK816_MISC_MARK_REG			0xEE
188822851890Sopenharmony_ci+#define RK816_HALT_CNT_REG			0xEF
188922851890Sopenharmony_ci+#define RK816_CALC_REST_REGH			0xF0
189022851890Sopenharmony_ci+#define RK816_CALC_REST_REGL			0xF1
189122851890Sopenharmony_ci+#define DATA18_REG				0xF2
189222851890Sopenharmony_ci+
189322851890Sopenharmony_ci+/*INTERRUPT REGISTER*/
189422851890Sopenharmony_ci+#define RK816_INT_STS_REG1			0x49
189522851890Sopenharmony_ci+#define RK816_INT_STS_MSK_REG1			0x4A
189622851890Sopenharmony_ci+#define RK816_INT_STS_REG2			0x4C
189722851890Sopenharmony_ci+#define RK816_INT_STS_MSK_REG2			0x4D
189822851890Sopenharmony_ci+#define RK816_INT_STS_REG3			0x4E
189922851890Sopenharmony_ci+#define RK816_INT_STS_MSK_REG3			0x4F
190022851890Sopenharmony_ci+#define RK816_GPIO_IO_POL_REG			0x50
190122851890Sopenharmony_ci+
190222851890Sopenharmony_ci+#define RK816_DATA18_REG			0xF2
190322851890Sopenharmony_ci+
190422851890Sopenharmony_ci+/* IRQ Definitions */
190522851890Sopenharmony_ci+#define RK816_IRQ_PWRON_FALL			0
190622851890Sopenharmony_ci+#define RK816_IRQ_PWRON_RISE			1
190722851890Sopenharmony_ci+#define RK816_IRQ_VB_LOW			2
190822851890Sopenharmony_ci+#define RK816_IRQ_PWRON				3
190922851890Sopenharmony_ci+#define RK816_IRQ_PWRON_LP			4
191022851890Sopenharmony_ci+#define RK816_IRQ_HOTDIE			5
191122851890Sopenharmony_ci+#define RK816_IRQ_RTC_ALARM			6
191222851890Sopenharmony_ci+#define RK816_IRQ_RTC_PERIOD			7
191322851890Sopenharmony_ci+#define RK816_IRQ_USB_OV			8
191422851890Sopenharmony_ci+#define RK816_IRQ_PLUG_IN			9
191522851890Sopenharmony_ci+#define RK816_IRQ_PLUG_OUT			10
191622851890Sopenharmony_ci+#define RK816_IRQ_CHG_OK			11
191722851890Sopenharmony_ci+#define RK816_IRQ_CHG_TE			12
191822851890Sopenharmony_ci+#define RK816_IRQ_CHG_TS			13
191922851890Sopenharmony_ci+#define RK816_IRQ_CHG_CVTLIM			14
192022851890Sopenharmony_ci+#define RK816_IRQ_DISCHG_ILIM			15
192122851890Sopenharmony_ci+
192222851890Sopenharmony_ci+#define RK816_IRQ_PWRON_FALL_MSK		BIT(5)
192322851890Sopenharmony_ci+#define RK816_IRQ_PWRON_RISE_MSK		BIT(6)
192422851890Sopenharmony_ci+#define RK816_IRQ_VB_LOW_MSK			BIT(1)
192522851890Sopenharmony_ci+#define RK816_IRQ_PWRON_MSK			BIT(2)
192622851890Sopenharmony_ci+#define RK816_IRQ_PWRON_LP_MSK			BIT(3)
192722851890Sopenharmony_ci+#define RK816_IRQ_HOTDIE_MSK			BIT(4)
192822851890Sopenharmony_ci+#define RK816_IRQ_RTC_ALARM_MSK			BIT(5)
192922851890Sopenharmony_ci+#define RK816_IRQ_RTC_PERIOD_MSK		BIT(6)
193022851890Sopenharmony_ci+#define RK816_IRQ_USB_OV_MSK			BIT(7)
193122851890Sopenharmony_ci+#define RK816_IRQ_PLUG_IN_MSK			BIT(0)
193222851890Sopenharmony_ci+#define RK816_IRQ_PLUG_OUT_MSK			BIT(1)
193322851890Sopenharmony_ci+#define RK816_IRQ_CHG_OK_MSK			BIT(2)
193422851890Sopenharmony_ci+#define RK816_IRQ_CHG_TE_MSK			BIT(3)
193522851890Sopenharmony_ci+#define RK816_IRQ_CHG_TS_MSK			BIT(4)
193622851890Sopenharmony_ci+#define RK816_IRQ_CHG_CVTLIM_MSK		BIT(6)
193722851890Sopenharmony_ci+#define RK816_IRQ_DISCHG_ILIM_MSK		BIT(7)
193822851890Sopenharmony_ci+
193922851890Sopenharmony_ci+#define RK816_VBAT_LOW_2V8			0x00
194022851890Sopenharmony_ci+#define RK816_VBAT_LOW_2V9			0x01
194122851890Sopenharmony_ci+#define RK816_VBAT_LOW_3V0			0x02
194222851890Sopenharmony_ci+#define RK816_VBAT_LOW_3V1			0x03
194322851890Sopenharmony_ci+#define RK816_VBAT_LOW_3V2			0x04
194422851890Sopenharmony_ci+#define RK816_VBAT_LOW_3V3			0x05
194522851890Sopenharmony_ci+#define RK816_VBAT_LOW_3V4			0x06
194622851890Sopenharmony_ci+#define RK816_VBAT_LOW_3V5			0x07
194722851890Sopenharmony_ci+#define RK816_PWR_FALL_INT_STATUS		(0x1 << 5)
194822851890Sopenharmony_ci+#define RK816_PWR_RISE_INT_STATUS		(0x1 << 6)
194922851890Sopenharmony_ci+#define RK816_ALARM_INT_STATUS			(0x1 << 5)
195022851890Sopenharmony_ci+#define EN_VBAT_LOW_IRQ				(0x1 << 4)
195122851890Sopenharmony_ci+#define VBAT_LOW_ACT_MASK			(0x1 << 4)
195222851890Sopenharmony_ci+#define RTC_TIMER_ALARM_INT_MSK			(0x3 << 2)
195322851890Sopenharmony_ci+#define RTC_TIMER_ALARM_INT_DIS			(0x0 << 2)
195422851890Sopenharmony_ci+#define RTC_PERIOD_ALARM_INT_MSK		(0x3 << 5)
195522851890Sopenharmony_ci+#define RTC_PERIOD_ALARM_INT_ST			(0x3 << 5)
195622851890Sopenharmony_ci+#define RTC_PERIOD_ALARM_INT_DIS		(0x3 << 5)
195722851890Sopenharmony_ci+#define RTC_PERIOD_ALARM_INT_EN			(0x9f)
195822851890Sopenharmony_ci+#define REG_WRITE_MSK				0xff
195922851890Sopenharmony_ci+#define BUCK4_MAX_ILIMIT			0x2c
196022851890Sopenharmony_ci+#define BUCK_RATE_MSK				(0x3 << 3)
196122851890Sopenharmony_ci+#define BUCK_RATE_12_5MV_US			(0x2 << 3)
196222851890Sopenharmony_ci+#define ALL_INT_FLAGS_ST			0xff
196322851890Sopenharmony_ci+#define PLUGIN_OUT_INT_EN			0xfc
196422851890Sopenharmony_ci+#define RK816_PWRON_FALL_RISE_INT_EN		0x9f
196522851890Sopenharmony_ci+#define BUCK1_2_IMAX_MAX			(0x3 << 6)
196622851890Sopenharmony_ci+#define BUCK3_4_IMAX_MAX			(0x3 << 3)
196722851890Sopenharmony_ci+#define BOOST_DISABLE				((0x1 << 5) | (0x0 << 1))
196822851890Sopenharmony_ci+#define BUCK4_VRP_3PERCENT			0xc0
196922851890Sopenharmony_ci+#define RK816_BUCK_DVS_CONFIRM			(0x1 << 7)
197022851890Sopenharmony_ci+#define RK816_TYPE_ES2				0x05
197122851890Sopenharmony_ci+#define RK816_CHIP_VERSION_MASK			0x0f
197222851890Sopenharmony_ci+
197322851890Sopenharmony_ci /* RK818 */
197422851890Sopenharmony_ci #define RK818_DCDC1			0
197522851890Sopenharmony_ci #define RK818_LDO1			4
197622851890Sopenharmony_ci@@ -138,6 +367,8 @@ enum rk818_reg {
197722851890Sopenharmony_ci 	RK818_ID_OTG_SWITCH,
197822851890Sopenharmony_ci };
197922851890Sopenharmony_ci 
198022851890Sopenharmony_ci+#define RK818_VB_MON_REG		0x21
198122851890Sopenharmony_ci+#define RK818_THERMAL_REG		0x22
198222851890Sopenharmony_ci #define RK818_DCDC_EN_REG		0x23
198322851890Sopenharmony_ci #define RK818_LDO_EN_REG		0x24
198422851890Sopenharmony_ci #define RK818_SLEEP_SET_OFF_REG1	0x25
198522851890Sopenharmony_ci@@ -190,7 +421,84 @@ enum rk818_reg {
198622851890Sopenharmony_ci #define RK818_BOOST_LDO9_SLP_VSEL_REG	0x55
198722851890Sopenharmony_ci #define RK818_BOOST_CTRL_REG		0x56
198822851890Sopenharmony_ci #define RK818_DCDC_ILMAX		0x90
198922851890Sopenharmony_ci+#define RK818_CHRG_COMP_REG		0x9a
199022851890Sopenharmony_ci+#define RK818_SUP_STS_REG		0xa0
199122851890Sopenharmony_ci #define RK818_USB_CTRL_REG		0xa1
199222851890Sopenharmony_ci+#define RK818_CHRG_CTRL_REG1		0xa3
199322851890Sopenharmony_ci+#define RK818_CHRG_CTRL_REG2		0xa4
199422851890Sopenharmony_ci+#define RK818_CHRG_CTRL_REG3		0xa5
199522851890Sopenharmony_ci+#define RK818_BAT_CTRL_REG		0xa6
199622851890Sopenharmony_ci+#define RK818_BAT_HTS_TS1_REG		0xa8
199722851890Sopenharmony_ci+#define RK818_BAT_LTS_TS1_REG		0xa9
199822851890Sopenharmony_ci+#define RK818_BAT_HTS_TS2_REG		0xaa
199922851890Sopenharmony_ci+#define RK818_BAT_LTS_TS2_REG		0xab
200022851890Sopenharmony_ci+#define RK818_TS_CTRL_REG		0xac
200122851890Sopenharmony_ci+#define RK818_ADC_CTRL_REG		0xad
200222851890Sopenharmony_ci+#define RK818_ON_SOURCE_REG		0xae
200322851890Sopenharmony_ci+#define RK818_OFF_SOURCE_REG		0xaf
200422851890Sopenharmony_ci+#define RK818_GGCON_REG			0xb0
200522851890Sopenharmony_ci+#define RK818_GGSTS_REG			0xb1
200622851890Sopenharmony_ci+#define RK818_FRAME_SMP_INTERV_REG	0xb2
200722851890Sopenharmony_ci+#define RK818_AUTO_SLP_CUR_THR_REG	0xb3
200822851890Sopenharmony_ci+#define RK818_GASCNT_CAL_REG3		0xb4
200922851890Sopenharmony_ci+#define RK818_GASCNT_CAL_REG2		0xb5
201022851890Sopenharmony_ci+#define RK818_GASCNT_CAL_REG1		0xb6
201122851890Sopenharmony_ci+#define RK818_GASCNT_CAL_REG0		0xb7
201222851890Sopenharmony_ci+#define RK818_GASCNT3_REG		0xb8
201322851890Sopenharmony_ci+#define RK818_GASCNT2_REG		0xb9
201422851890Sopenharmony_ci+#define RK818_GASCNT1_REG		0xba
201522851890Sopenharmony_ci+#define RK818_GASCNT0_REG		0xbb
201622851890Sopenharmony_ci+#define RK818_BAT_CUR_AVG_REGH		0xbc
201722851890Sopenharmony_ci+#define RK818_BAT_CUR_AVG_REGL		0xbd
201822851890Sopenharmony_ci+#define RK818_TS1_ADC_REGH		0xbe
201922851890Sopenharmony_ci+#define RK818_TS1_ADC_REGL		0xbf
202022851890Sopenharmony_ci+#define RK818_TS2_ADC_REGH		0xc0
202122851890Sopenharmony_ci+#define RK818_TS2_ADC_REGL		0xc1
202222851890Sopenharmony_ci+#define RK818_BAT_OCV_REGH		0xc2
202322851890Sopenharmony_ci+#define RK818_BAT_OCV_REGL		0xc3
202422851890Sopenharmony_ci+#define RK818_BAT_VOL_REGH		0xc4
202522851890Sopenharmony_ci+#define RK818_BAT_VOL_REGL		0xc5
202622851890Sopenharmony_ci+#define RK818_RELAX_ENTRY_THRES_REGH	0xc6
202722851890Sopenharmony_ci+#define RK818_RELAX_ENTRY_THRES_REGL	0xc7
202822851890Sopenharmony_ci+#define RK818_RELAX_EXIT_THRES_REGH	0xc8
202922851890Sopenharmony_ci+#define RK818_RELAX_EXIT_THRES_REGL	0xc9
203022851890Sopenharmony_ci+#define RK818_RELAX_VOL1_REGH		0xca
203122851890Sopenharmony_ci+#define RK818_RELAX_VOL1_REGL		0xcb
203222851890Sopenharmony_ci+#define RK818_RELAX_VOL2_REGH		0xcc
203322851890Sopenharmony_ci+#define RK818_RELAX_VOL2_REGL		0xcd
203422851890Sopenharmony_ci+#define RK818_BAT_CUR_R_CALC_REGH	0xce
203522851890Sopenharmony_ci+#define RK818_BAT_CUR_R_CALC_REGL	0xcf
203622851890Sopenharmony_ci+#define RK818_BAT_VOL_R_CALC_REGH	0xd0
203722851890Sopenharmony_ci+#define RK818_BAT_VOL_R_CALC_REGL	0xd1
203822851890Sopenharmony_ci+#define RK818_CAL_OFFSET_REGH		0xd2
203922851890Sopenharmony_ci+#define RK818_CAL_OFFSET_REGL		0xd3
204022851890Sopenharmony_ci+#define RK818_NON_ACT_TIMER_CNT_REG	0xd4
204122851890Sopenharmony_ci+#define RK818_VCALIB0_REGH		0xd5
204222851890Sopenharmony_ci+#define RK818_VCALIB0_REGL		0xd6
204322851890Sopenharmony_ci+#define RK818_VCALIB1_REGH		0xd7
204422851890Sopenharmony_ci+#define RK818_VCALIB1_REGL		0xd8
204522851890Sopenharmony_ci+#define RK818_IOFFSET_REGH		0xdd
204622851890Sopenharmony_ci+#define RK818_IOFFSET_REGL		0xde
204722851890Sopenharmony_ci+#define RK818_SOC_REG			0xe0
204822851890Sopenharmony_ci+#define RK818_REMAIN_CAP_REG3		0xe1
204922851890Sopenharmony_ci+#define RK818_REMAIN_CAP_REG2		0xe2
205022851890Sopenharmony_ci+#define RK818_REMAIN_CAP_REG1		0xe3
205122851890Sopenharmony_ci+#define RK818_REMAIN_CAP_REG0		0xe4
205222851890Sopenharmony_ci+#define RK818_UPDAT_LEVE_REG		0xe5
205322851890Sopenharmony_ci+#define RK818_NEW_FCC_REG3		0xe6
205422851890Sopenharmony_ci+#define RK818_NEW_FCC_REG2		0xe7
205522851890Sopenharmony_ci+#define RK818_NEW_FCC_REG1		0xe8
205622851890Sopenharmony_ci+#define RK818_NEW_FCC_REG0		0xe9
205722851890Sopenharmony_ci+#define RK818_NON_ACT_TIMER_CNT_SAVE_REG	0xea
205822851890Sopenharmony_ci+#define RK818_OCV_VOL_VALID_REG		0xeb
205922851890Sopenharmony_ci+#define RK818_REBOOT_CNT_REG		0xec
206022851890Sopenharmony_ci+#define RK818_POFFSET_REG		0xed
206122851890Sopenharmony_ci+#define RK818_MISC_MARK_REG		0xee
206222851890Sopenharmony_ci+#define RK818_HALT_CNT_REG		0xef
206322851890Sopenharmony_ci+#define RK818_CALC_REST_REGH		0xf0
206422851890Sopenharmony_ci+#define RK818_CALC_REST_REGL		0xf1
206522851890Sopenharmony_ci+#define RK818_SAVE_DATA19		0xf2
206622851890Sopenharmony_ci+#define RK818_NUM_REGULATOR		17
206722851890Sopenharmony_ci 
206822851890Sopenharmony_ci #define RK818_H5V_EN			BIT(0)
206922851890Sopenharmony_ci #define RK818_REF_RDY_CTRL		BIT(1)
207022851890Sopenharmony_ci@@ -255,14 +563,22 @@ enum rk805_reg {
207122851890Sopenharmony_ci #define RK805_PWRON_FALL_RISE_INT_MSK	0x81
207222851890Sopenharmony_ci 
207322851890Sopenharmony_ci /* RK805 IRQ Definitions */
207422851890Sopenharmony_ci-#define RK805_IRQ_PWRON_RISE		0
207522851890Sopenharmony_ci #define RK805_IRQ_VB_LOW		1
207622851890Sopenharmony_ci #define RK805_IRQ_PWRON			2
207722851890Sopenharmony_ci #define RK805_IRQ_PWRON_LP		3
207822851890Sopenharmony_ci #define RK805_IRQ_HOTDIE		4
207922851890Sopenharmony_ci #define RK805_IRQ_RTC_ALARM		5
208022851890Sopenharmony_ci #define RK805_IRQ_RTC_PERIOD		6
208122851890Sopenharmony_ci-#define RK805_IRQ_PWRON_FALL		7
208222851890Sopenharmony_ci+
208322851890Sopenharmony_ci+/*
208422851890Sopenharmony_ci+ * When PMIC irq occurs, regmap-irq.c will traverse all PMIC child
208522851890Sopenharmony_ci+ * interrupts from low index 0 to high index, we give fall interrupt
208622851890Sopenharmony_ci+ * high priority to be called earlier than rise, so that it can be
208722851890Sopenharmony_ci+ * override by late rise event. This can helps to solve key release
208822851890Sopenharmony_ci+ * glitch which make a wrongly fall event immediately after rise.
208922851890Sopenharmony_ci+ */
209022851890Sopenharmony_ci+#define RK805_IRQ_PWRON_FALL		0
209122851890Sopenharmony_ci+#define RK805_IRQ_PWRON_RISE		7
209222851890Sopenharmony_ci 
209322851890Sopenharmony_ci #define RK805_IRQ_PWRON_RISE_MSK	BIT(0)
209422851890Sopenharmony_ci #define RK805_IRQ_VB_LOW_MSK		BIT(1)
209522851890Sopenharmony_ci@@ -289,6 +605,16 @@ enum rk805_reg {
209622851890Sopenharmony_ci #define RK805_INT_ALARM_EN		(1 << 3)
209722851890Sopenharmony_ci #define RK805_INT_TIMER_EN		(1 << 2)
209822851890Sopenharmony_ci 
209922851890Sopenharmony_ci+#define RK805_SLP_LDO_EN_OFFSET		-1
210022851890Sopenharmony_ci+#define RK805_SLP_DCDC_EN_OFFSET	2
210122851890Sopenharmony_ci+
210222851890Sopenharmony_ci+#define RK805_RAMP_RATE_OFFSET		3
210322851890Sopenharmony_ci+#define RK805_RAMP_RATE_MASK		(3 << RK805_RAMP_RATE_OFFSET)
210422851890Sopenharmony_ci+#define RK805_RAMP_RATE_3MV_PER_US	(0 << RK805_RAMP_RATE_OFFSET)
210522851890Sopenharmony_ci+#define RK805_RAMP_RATE_6MV_PER_US	(1 << RK805_RAMP_RATE_OFFSET)
210622851890Sopenharmony_ci+#define RK805_RAMP_RATE_12_5MV_PER_US	(2 << RK805_RAMP_RATE_OFFSET)
210722851890Sopenharmony_ci+#define RK805_RAMP_RATE_25MV_PER_US	(3 << RK805_RAMP_RATE_OFFSET)
210822851890Sopenharmony_ci+
210922851890Sopenharmony_ci /* RK808 IRQ Definitions */
211022851890Sopenharmony_ci #define RK808_IRQ_VOUT_LO	0
211122851890Sopenharmony_ci #define RK808_IRQ_VB_LO		1
211222851890Sopenharmony_ci@@ -348,6 +674,107 @@ enum rk805_reg {
211322851890Sopenharmony_ci 
211422851890Sopenharmony_ci #define RK818_NUM_IRQ		16
211522851890Sopenharmony_ci 
211622851890Sopenharmony_ci+/*RK818_DCDC_EN_REG*/
211722851890Sopenharmony_ci+#define BUCK1_EN_MASK		BIT(0)
211822851890Sopenharmony_ci+#define BUCK2_EN_MASK		BIT(1)
211922851890Sopenharmony_ci+#define BUCK3_EN_MASK		BIT(2)
212022851890Sopenharmony_ci+#define BUCK4_EN_MASK		BIT(3)
212122851890Sopenharmony_ci+#define BOOST_EN_MASK		BIT(4)
212222851890Sopenharmony_ci+#define LDO9_EN_MASK		BIT(5)
212322851890Sopenharmony_ci+#define SWITCH_EN_MASK		BIT(6)
212422851890Sopenharmony_ci+#define OTG_EN_MASK		BIT(7)
212522851890Sopenharmony_ci+
212622851890Sopenharmony_ci+#define BUCK1_EN_ENABLE		BIT(0)
212722851890Sopenharmony_ci+#define BUCK2_EN_ENABLE		BIT(1)
212822851890Sopenharmony_ci+#define BUCK3_EN_ENABLE		BIT(2)
212922851890Sopenharmony_ci+#define BUCK4_EN_ENABLE		BIT(3)
213022851890Sopenharmony_ci+#define BOOST_EN_ENABLE		BIT(4)
213122851890Sopenharmony_ci+#define LDO9_EN_ENABLE		BIT(5)
213222851890Sopenharmony_ci+#define SWITCH_EN_ENABLE	BIT(6)
213322851890Sopenharmony_ci+#define OTG_EN_ENABLE		BIT(7)
213422851890Sopenharmony_ci+
213522851890Sopenharmony_ci+#define BUCK1_SLP_SET_MASK	BIT(0)
213622851890Sopenharmony_ci+#define BUCK2_SLP_SET_MASK	BIT(1)
213722851890Sopenharmony_ci+#define BUCK3_SLP_SET_MASK	BIT(2)
213822851890Sopenharmony_ci+#define BUCK4_SLP_SET_MASK	BIT(3)
213922851890Sopenharmony_ci+#define BOOST_SLP_SET_MASK	BIT(4)
214022851890Sopenharmony_ci+#define LDO9_SLP_SET_MASK	BIT(5)
214122851890Sopenharmony_ci+#define SWITCH_SLP_SET_MASK	BIT(6)
214222851890Sopenharmony_ci+#define OTG_SLP_SET_MASK	BIT(7)
214322851890Sopenharmony_ci+
214422851890Sopenharmony_ci+#define BUCK1_SLP_SET_OFF	BIT(0)
214522851890Sopenharmony_ci+#define BUCK2_SLP_SET_OFF	BIT(1)
214622851890Sopenharmony_ci+#define BUCK3_SLP_SET_OFF	BIT(2)
214722851890Sopenharmony_ci+#define BUCK4_SLP_SET_OFF	BIT(3)
214822851890Sopenharmony_ci+#define BOOST_SLP_SET_OFF	BIT(4)
214922851890Sopenharmony_ci+#define LDO9_SLP_SET_OFF	BIT(5)
215022851890Sopenharmony_ci+#define SWITCH_SLP_SET_OFF	BIT(6)
215122851890Sopenharmony_ci+#define OTG_SLP_SET_OFF		BIT(7)
215222851890Sopenharmony_ci+#define OTG_BOOST_SLP_OFF	(BOOST_SLP_SET_OFF | OTG_SLP_SET_OFF)
215322851890Sopenharmony_ci+
215422851890Sopenharmony_ci+#define BUCK1_SLP_SET_ON	BIT(0)
215522851890Sopenharmony_ci+#define BUCK2_SLP_SET_ON	BIT(1)
215622851890Sopenharmony_ci+#define BUCK3_SLP_SET_ON	BIT(2)
215722851890Sopenharmony_ci+#define BUCK4_SLP_SET_ON	BIT(3)
215822851890Sopenharmony_ci+#define BOOST_SLP_SET_ON	BIT(4)
215922851890Sopenharmony_ci+#define LDO9_SLP_SET_ON		BIT(5)
216022851890Sopenharmony_ci+#define SWITCH_SLP_SET_ON	BIT(6)
216122851890Sopenharmony_ci+#define OTG_SLP_SET_ON		BIT(7)
216222851890Sopenharmony_ci+
216322851890Sopenharmony_ci+#define VOUT_LO_MASK		BIT(0)
216422851890Sopenharmony_ci+#define VB_LO_MASK		BIT(1)
216522851890Sopenharmony_ci+#define PWRON_MASK		BIT(2)
216622851890Sopenharmony_ci+#define PWRON_LP_MASK		BIT(3)
216722851890Sopenharmony_ci+#define HOTDIE_MASK		BIT(4)
216822851890Sopenharmony_ci+#define RTC_ALARM_MASK		BIT(5)
216922851890Sopenharmony_ci+#define RTC_PERIOD_MASK		BIT(6)
217022851890Sopenharmony_ci+#define USB_OV_MASK		BIT(7)
217122851890Sopenharmony_ci+
217222851890Sopenharmony_ci+#define VOUT_LO_DISABLE		BIT(0)
217322851890Sopenharmony_ci+#define VB_LO_DISABLE		BIT(1)
217422851890Sopenharmony_ci+#define PWRON_DISABLE		BIT(2)
217522851890Sopenharmony_ci+#define PWRON_LP_DISABLE	BIT(3)
217622851890Sopenharmony_ci+#define HOTDIE_DISABLE		BIT(4)
217722851890Sopenharmony_ci+#define RTC_ALARM_DISABLE	BIT(5)
217822851890Sopenharmony_ci+#define RTC_PERIOD_DISABLE	BIT(6)
217922851890Sopenharmony_ci+#define USB_OV_INT_DISABLE	BIT(7)
218022851890Sopenharmony_ci+
218122851890Sopenharmony_ci+#define VOUT_LO_ENABLE		(0 << 0)
218222851890Sopenharmony_ci+#define VB_LO_ENABLE		(0 << 1)
218322851890Sopenharmony_ci+#define PWRON_ENABLE		(0 << 2)
218422851890Sopenharmony_ci+#define PWRON_LP_ENABLE		(0 << 3)
218522851890Sopenharmony_ci+#define HOTDIE_ENABLE		(0 << 4)
218622851890Sopenharmony_ci+#define RTC_ALARM_ENABLE	(0 << 5)
218722851890Sopenharmony_ci+#define RTC_PERIOD_ENABLE	(0 << 6)
218822851890Sopenharmony_ci+#define USB_OV_INT_ENABLE	(0 << 7)
218922851890Sopenharmony_ci+
219022851890Sopenharmony_ci+#define PLUG_IN_MASK		BIT(0)
219122851890Sopenharmony_ci+#define PLUG_OUT_MASK		BIT(1)
219222851890Sopenharmony_ci+#define CHGOK_MASK		BIT(2)
219322851890Sopenharmony_ci+#define CHGTE_MASK		BIT(3)
219422851890Sopenharmony_ci+#define CHGTS1_MASK		BIT(4)
219522851890Sopenharmony_ci+#define TS2_MASK		BIT(5)
219622851890Sopenharmony_ci+#define CHG_CVTLIM_MASK		BIT(6)
219722851890Sopenharmony_ci+#define DISCHG_ILIM_MASK	BIT(7)
219822851890Sopenharmony_ci+
219922851890Sopenharmony_ci+#define PLUG_IN_DISABLE		BIT(0)
220022851890Sopenharmony_ci+#define PLUG_OUT_DISABLE	BIT(1)
220122851890Sopenharmony_ci+#define CHGOK_DISABLE		BIT(2)
220222851890Sopenharmony_ci+#define CHGTE_DISABLE		BIT(3)
220322851890Sopenharmony_ci+#define CHGTS1_DISABLE		BIT(4)
220422851890Sopenharmony_ci+#define TS2_DISABLE		BIT(5)
220522851890Sopenharmony_ci+#define CHG_CVTLIM_DISABLE	BIT(6)
220622851890Sopenharmony_ci+#define DISCHG_ILIM_DISABLE	BIT(7)
220722851890Sopenharmony_ci+
220822851890Sopenharmony_ci+#define PLUG_IN_ENABLE		BIT(0)
220922851890Sopenharmony_ci+#define PLUG_OUT_ENABLE		BIT(1)
221022851890Sopenharmony_ci+#define CHGOK_ENABLE		BIT(2)
221122851890Sopenharmony_ci+#define CHGTE_ENABLE		BIT(3)
221222851890Sopenharmony_ci+#define CHGTS1_ENABLE		BIT(4)
221322851890Sopenharmony_ci+#define TS2_ENABLE		BIT(5)
221422851890Sopenharmony_ci+#define CHG_CVTLIM_ENABLE	BIT(6)
221522851890Sopenharmony_ci+#define DISCHG_ILIM_ENABLE	BIT(7)
221622851890Sopenharmony_ci+
221722851890Sopenharmony_ci #define RK808_VBAT_LOW_2V8	0x00
221822851890Sopenharmony_ci #define RK808_VBAT_LOW_2V9	0x01
221922851890Sopenharmony_ci #define RK808_VBAT_LOW_3V0	0x02
222022851890Sopenharmony_ci@@ -381,7 +808,10 @@ enum rk805_reg {
222122851890Sopenharmony_ci 
222222851890Sopenharmony_ci #define VOUT_LO_INT	BIT(0)
222322851890Sopenharmony_ci #define CLK32KOUT2_EN	BIT(0)
222422851890Sopenharmony_ci+#define CLK32KOUT2_FUNC		(0 << 1)
222522851890Sopenharmony_ci+#define CLK32KOUT2_FUNC_MASK	BIT(1)
222622851890Sopenharmony_ci 
222722851890Sopenharmony_ci+#define TEMP105C			0x08
222822851890Sopenharmony_ci #define TEMP115C			0x0c
222922851890Sopenharmony_ci #define TEMP_HOTDIE_MSK			0x0c
223022851890Sopenharmony_ci #define SLP_SD_MSK			(0x3 << 2)
223122851890Sopenharmony_ci@@ -391,6 +821,7 @@ enum rk805_reg {
223222851890Sopenharmony_ci #define PWM_MODE_MSK			BIT(7)
223322851890Sopenharmony_ci #define FPWM_MODE			BIT(7)
223422851890Sopenharmony_ci #define AUTO_PWM_MODE			0
223522851890Sopenharmony_ci+#define REGS_WMSK			0xf0
223622851890Sopenharmony_ci 
223722851890Sopenharmony_ci enum rk817_reg_id {
223822851890Sopenharmony_ci 	RK817_ID_DCDC1 = 0,
223922851890Sopenharmony_ci@@ -436,6 +867,10 @@ enum rk809_reg_id {
224022851890Sopenharmony_ci #define RK817_RTC_INT_REG		0xf
224122851890Sopenharmony_ci #define RK817_RTC_COMP_LSB_REG		0x10
224222851890Sopenharmony_ci #define RK817_RTC_COMP_MSB_REG		0x11
224322851890Sopenharmony_ci+#define RK817_ADC_CONFIG0		0x50
224422851890Sopenharmony_ci+#define RK817_CURE_ADC_K0		0xb0
224522851890Sopenharmony_ci+#define RK817_POWER_EN_SAVE0            0x99
224622851890Sopenharmony_ci+#define RK817_POWER_EN_SAVE1            0xa4
224722851890Sopenharmony_ci 
224822851890Sopenharmony_ci #define RK817_POWER_EN_REG(i)		(0xb1 + (i))
224922851890Sopenharmony_ci #define RK817_POWER_SLP_EN_REG(i)	(0xb5 + (i))
225022851890Sopenharmony_ci@@ -462,6 +897,9 @@ enum rk809_reg_id {
225122851890Sopenharmony_ci #define RK817_LDO_ON_VSEL_REG(idx)	(0xcc + (idx) * 2)
225222851890Sopenharmony_ci #define RK817_BOOST_OTG_CFG		(0xde)
225322851890Sopenharmony_ci 
225422851890Sopenharmony_ci+#define RK817_CHRG_OUT			0xe4
225522851890Sopenharmony_ci+#define RK817_CHRG_IN			0xe5
225622851890Sopenharmony_ci+#define RK817_CHRG_STS			0xeb
225722851890Sopenharmony_ci #define RK817_ID_MSB			0xed
225822851890Sopenharmony_ci #define RK817_ID_LSB			0xee
225922851890Sopenharmony_ci 
226022851890Sopenharmony_ci@@ -609,16 +1047,27 @@ enum {
226122851890Sopenharmony_ci 	RK805_ID = 0x8050,
226222851890Sopenharmony_ci 	RK808_ID = 0x0000,
226322851890Sopenharmony_ci 	RK809_ID = 0x8090,
226422851890Sopenharmony_ci+	RK816_ID = 0x8160,
226522851890Sopenharmony_ci 	RK817_ID = 0x8170,
226622851890Sopenharmony_ci 	RK818_ID = 0x8180,
226722851890Sopenharmony_ci };
226822851890Sopenharmony_ci 
226922851890Sopenharmony_ci+struct rk808_pin_info {
227022851890Sopenharmony_ci+	struct pinctrl *p;
227122851890Sopenharmony_ci+	struct pinctrl_state *reset;
227222851890Sopenharmony_ci+	struct pinctrl_state *power_off;
227322851890Sopenharmony_ci+	struct pinctrl_state *sleep;
227422851890Sopenharmony_ci+};
227522851890Sopenharmony_ci+
227622851890Sopenharmony_ci struct rk808 {
227722851890Sopenharmony_ci 	struct i2c_client		*i2c;
227822851890Sopenharmony_ci 	struct regmap_irq_chip_data	*irq_data;
227922851890Sopenharmony_ci+	struct regmap_irq_chip_data	*battery_irq_data;
228022851890Sopenharmony_ci 	struct regmap			*regmap;
228122851890Sopenharmony_ci 	long				variant;
228222851890Sopenharmony_ci 	const struct regmap_config	*regmap_cfg;
228322851890Sopenharmony_ci 	const struct regmap_irq_chip	*regmap_irq_chip;
228422851890Sopenharmony_ci+	void				(*pm_pwroff_prep_fn)(void);
228522851890Sopenharmony_ci+	struct rk808_pin_info *pins;
228622851890Sopenharmony_ci };
228722851890Sopenharmony_ci #endif /* __LINUX_REGULATOR_RK808_H */
228822851890Sopenharmony_cidiff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
228922851890Sopenharmony_ciindex 40d7e98fc..819f6119d 100644
229022851890Sopenharmony_ci--- a/include/linux/mmc/host.h
229122851890Sopenharmony_ci+++ b/include/linux/mmc/host.h
229222851890Sopenharmony_ci@@ -141,6 +141,7 @@ struct mmc_host_ops {
229322851890Sopenharmony_ci 
229422851890Sopenharmony_ci 	/* Check if the card is pulling dat[0:3] low */
229522851890Sopenharmony_ci 	int	(*card_busy)(struct mmc_host *host);
229622851890Sopenharmony_ci+	int     (*set_sdio_status)(struct mmc_host *host, int val);
229722851890Sopenharmony_ci 
229822851890Sopenharmony_ci 	/* The tuning command opcode value is different for SD and eMMC cards */
229922851890Sopenharmony_ci 	int	(*execute_tuning)(struct mmc_host *host, u32 opcode);
230022851890Sopenharmony_ci@@ -483,6 +484,9 @@ void mmc_free_host(struct mmc_host *);
230122851890Sopenharmony_ci int mmc_of_parse(struct mmc_host *host);
230222851890Sopenharmony_ci int mmc_of_parse_voltage(struct device_node *np, u32 *mask);
230322851890Sopenharmony_ci 
230422851890Sopenharmony_ci+extern struct mmc_host *primary_sdio_host;
230522851890Sopenharmony_ci+int mmc_host_rescan(struct mmc_host *host, int val, int is_cap_sdio_irq);
230622851890Sopenharmony_ci+
230722851890Sopenharmony_ci static inline void *mmc_priv(struct mmc_host *host)
230822851890Sopenharmony_ci {
230922851890Sopenharmony_ci 	return (void *)host->private;
231022851890Sopenharmony_cidiff --git a/include/linux/mmu_context.h b/include/linux/mmu_context.h
231122851890Sopenharmony_ciindex 03dee12d2..bc4ac3c52 100644
231222851890Sopenharmony_ci--- a/include/linux/mmu_context.h
231322851890Sopenharmony_ci+++ b/include/linux/mmu_context.h
231422851890Sopenharmony_ci@@ -14,4 +14,12 @@
231522851890Sopenharmony_ci static inline void leave_mm(int cpu) { }
231622851890Sopenharmony_ci #endif
231722851890Sopenharmony_ci 
231822851890Sopenharmony_ci+/*
231922851890Sopenharmony_ci+ * CPUs that are capable of running task @p. By default, we assume a sane,
232022851890Sopenharmony_ci+ * homogeneous system. Must contain at least one active CPU.
232122851890Sopenharmony_ci+ */
232222851890Sopenharmony_ci+#ifndef task_cpu_possible_mask
232322851890Sopenharmony_ci+# define task_cpu_possible_mask(p)	cpu_possible_mask
232422851890Sopenharmony_ci+#endif
232522851890Sopenharmony_ci+
232622851890Sopenharmony_ci #endif
232722851890Sopenharmony_cidiff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
232822851890Sopenharmony_ciindex 81a55e974..aefa0b0bc 100644
232922851890Sopenharmony_ci--- a/include/linux/power_supply.h
233022851890Sopenharmony_ci+++ b/include/linux/power_supply.h
233122851890Sopenharmony_ci@@ -49,6 +49,12 @@ enum {
233222851890Sopenharmony_ci 	POWER_SUPPLY_CHARGE_TYPE_ADAPTIVE,	/* dynamically adjusted speed */
233322851890Sopenharmony_ci 	POWER_SUPPLY_CHARGE_TYPE_CUSTOM,	/* use CHARGE_CONTROL_* props */
233422851890Sopenharmony_ci 	POWER_SUPPLY_CHARGE_TYPE_LONGLIFE,	/* slow speed, longer life */
233522851890Sopenharmony_ci+
233622851890Sopenharmony_ci+	/*
233722851890Sopenharmony_ci+	 * force to 50 to minimize the chances of userspace binary
233822851890Sopenharmony_ci+	 * incompatibility on newer upstream kernels
233922851890Sopenharmony_ci+	 */
234022851890Sopenharmony_ci+	POWER_SUPPLY_CHARGE_TYPE_TAPER = 50,	/* charging in CV phase */
234122851890Sopenharmony_ci };
234222851890Sopenharmony_ci 
234322851890Sopenharmony_ci enum {
234422851890Sopenharmony_ci@@ -386,12 +392,22 @@ extern void power_supply_put(struct power_supply *psy);
234522851890Sopenharmony_ci #ifdef CONFIG_OF
234622851890Sopenharmony_ci extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
234722851890Sopenharmony_ci 							const char *property);
234822851890Sopenharmony_ci+extern int power_supply_get_by_phandle_array(struct device_node *np,
234922851890Sopenharmony_ci+					     const char *property,
235022851890Sopenharmony_ci+					     struct power_supply **psy,
235122851890Sopenharmony_ci+					     ssize_t size);
235222851890Sopenharmony_ci extern struct power_supply *devm_power_supply_get_by_phandle(
235322851890Sopenharmony_ci 				    struct device *dev, const char *property);
235422851890Sopenharmony_ci #else /* !CONFIG_OF */
235522851890Sopenharmony_ci static inline struct power_supply *
235622851890Sopenharmony_ci power_supply_get_by_phandle(struct device_node *np, const char *property)
235722851890Sopenharmony_ci { return NULL; }
235822851890Sopenharmony_ci+static inline int
235922851890Sopenharmony_ci+power_supply_get_by_phandle_array(struct device_node *np,
236022851890Sopenharmony_ci+				  const char *property,
236122851890Sopenharmony_ci+				  struct power_supply **psy,
236222851890Sopenharmony_ci+				  int size)
236322851890Sopenharmony_ci+{ return 0; }
236422851890Sopenharmony_ci static inline struct power_supply *
236522851890Sopenharmony_ci devm_power_supply_get_by_phandle(struct device *dev, const char *property)
236622851890Sopenharmony_ci { return NULL; }
236722851890Sopenharmony_ci@@ -426,9 +442,16 @@ static inline int power_supply_is_system_supplied(void) { return -ENOSYS; }
236822851890Sopenharmony_ci extern int power_supply_get_property(struct power_supply *psy,
236922851890Sopenharmony_ci 			    enum power_supply_property psp,
237022851890Sopenharmony_ci 			    union power_supply_propval *val);
237122851890Sopenharmony_ci+#if IS_ENABLED(CONFIG_POWER_SUPPLY)
237222851890Sopenharmony_ci extern int power_supply_set_property(struct power_supply *psy,
237322851890Sopenharmony_ci 			    enum power_supply_property psp,
237422851890Sopenharmony_ci 			    const union power_supply_propval *val);
237522851890Sopenharmony_ci+#else
237622851890Sopenharmony_ci+static inline int power_supply_set_property(struct power_supply *psy,
237722851890Sopenharmony_ci+			    enum power_supply_property psp,
237822851890Sopenharmony_ci+			    const union power_supply_propval *val)
237922851890Sopenharmony_ci+{ return 0; }
238022851890Sopenharmony_ci+#endif
238122851890Sopenharmony_ci extern int power_supply_property_is_writeable(struct power_supply *psy,
238222851890Sopenharmony_ci 					enum power_supply_property psp);
238322851890Sopenharmony_ci extern void power_supply_external_power_changed(struct power_supply *psy);
238422851890Sopenharmony_cidiff --git a/include/linux/psi_types.h b/include/linux/psi_types.h
238522851890Sopenharmony_ciindex 17d74f62c..541b45881 100644
238622851890Sopenharmony_ci--- a/include/linux/psi_types.h
238722851890Sopenharmony_ci+++ b/include/linux/psi_types.h
238822851890Sopenharmony_ci@@ -154,6 +154,7 @@ struct psi_group {
238922851890Sopenharmony_ci 	struct timer_list poll_timer;
239022851890Sopenharmony_ci 	wait_queue_head_t poll_wait;
239122851890Sopenharmony_ci 	atomic_t poll_wakeup;
239222851890Sopenharmony_ci+	atomic_t poll_scheduled;
239322851890Sopenharmony_ci 
239422851890Sopenharmony_ci 	/* Protects data used by the monitor */
239522851890Sopenharmony_ci 	struct mutex trigger_lock;
239622851890Sopenharmony_cidiff --git a/include/linux/pwm.h b/include/linux/pwm.h
239722851890Sopenharmony_ciindex a13ff383f..6b2a7fb80 100644
239822851890Sopenharmony_ci--- a/include/linux/pwm.h
239922851890Sopenharmony_ci+++ b/include/linux/pwm.h
240022851890Sopenharmony_ci@@ -59,6 +59,9 @@ struct pwm_state {
240122851890Sopenharmony_ci 	u64 period;
240222851890Sopenharmony_ci 	u64 duty_cycle;
240322851890Sopenharmony_ci 	enum pwm_polarity polarity;
240422851890Sopenharmony_ci+#ifdef CONFIG_PWM_ROCKCHIP_ONESHOT
240522851890Sopenharmony_ci+	u64 oneshot_count;
240622851890Sopenharmony_ci+#endif /* CONFIG_PWM_ROCKCHIP_ONESHOT */
240722851890Sopenharmony_ci 	bool enabled;
240822851890Sopenharmony_ci };
240922851890Sopenharmony_ci 
241022851890Sopenharmony_cidiff --git a/include/linux/reboot.h b/include/linux/reboot.h
241122851890Sopenharmony_ciindex 3734cd8f3..1c8d7856c 100644
241222851890Sopenharmony_ci--- a/include/linux/reboot.h
241322851890Sopenharmony_ci+++ b/include/linux/reboot.h
241422851890Sopenharmony_ci@@ -49,6 +49,26 @@ extern int register_restart_handler(struct notifier_block *);
241522851890Sopenharmony_ci extern int unregister_restart_handler(struct notifier_block *);
241622851890Sopenharmony_ci extern void do_kernel_restart(char *cmd);
241722851890Sopenharmony_ci 
241822851890Sopenharmony_ci+#ifdef CONFIG_NO_GKI
241922851890Sopenharmony_ci+extern int register_pre_restart_handler(struct notifier_block *nb);
242022851890Sopenharmony_ci+extern int unregister_pre_restart_handler(struct notifier_block *nb);
242122851890Sopenharmony_ci+extern void do_kernel_pre_restart(char *cmd);
242222851890Sopenharmony_ci+#else
242322851890Sopenharmony_ci+static inline int register_pre_restart_handler(struct notifier_block *nb)
242422851890Sopenharmony_ci+{
242522851890Sopenharmony_ci+	return 0;
242622851890Sopenharmony_ci+}
242722851890Sopenharmony_ci+
242822851890Sopenharmony_ci+static inline int unregister_pre_restart_handler(struct notifier_block *nb)
242922851890Sopenharmony_ci+{
243022851890Sopenharmony_ci+	return 0;
243122851890Sopenharmony_ci+}
243222851890Sopenharmony_ci+
243322851890Sopenharmony_ci+static inline void do_kernel_pre_restart(char *cmd)
243422851890Sopenharmony_ci+{
243522851890Sopenharmony_ci+}
243622851890Sopenharmony_ci+#endif
243722851890Sopenharmony_ci+
243822851890Sopenharmony_ci /*
243922851890Sopenharmony_ci  * Architecture-specific implementations of sys_reboot commands.
244022851890Sopenharmony_ci  */
244122851890Sopenharmony_cidiff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
244222851890Sopenharmony_ciindex 11cade737..d7c77ee37 100644
244322851890Sopenharmony_ci--- a/include/linux/regulator/driver.h
244422851890Sopenharmony_ci+++ b/include/linux/regulator/driver.h
244522851890Sopenharmony_ci@@ -223,6 +223,8 @@ enum regulator_type {
244622851890Sopenharmony_ci  * @name: Identifying name for the regulator.
244722851890Sopenharmony_ci  * @supply_name: Identifying the regulator supply
244822851890Sopenharmony_ci  * @of_match: Name used to identify regulator in DT.
244922851890Sopenharmony_ci+ * @of_match_full_name: A flag to indicate that the of_match string, if
245022851890Sopenharmony_ci+ *			present, should be matched against the node full_name.
245122851890Sopenharmony_ci  * @regulators_node: Name of node containing regulator definitions in DT.
245222851890Sopenharmony_ci  * @of_parse_cb: Optional callback called only if of_match is present.
245322851890Sopenharmony_ci  *               Will be called for each regulator parsed from DT, during
245422851890Sopenharmony_ci@@ -314,6 +316,7 @@ struct regulator_desc {
245522851890Sopenharmony_ci 	const char *name;
245622851890Sopenharmony_ci 	const char *supply_name;
245722851890Sopenharmony_ci 	const char *of_match;
245822851890Sopenharmony_ci+	bool of_match_full_name;
245922851890Sopenharmony_ci 	const char *regulators_node;
246022851890Sopenharmony_ci 	int (*of_parse_cb)(struct device_node *,
246122851890Sopenharmony_ci 			    const struct regulator_desc *,
246222851890Sopenharmony_cidiff --git a/include/linux/regulator/fan53555.h b/include/linux/regulator/fan53555.h
246322851890Sopenharmony_ciindex ce8df2186..e8703b6fc 100644
246422851890Sopenharmony_ci--- a/include/linux/regulator/fan53555.h
246522851890Sopenharmony_ci+++ b/include/linux/regulator/fan53555.h
246622851890Sopenharmony_ci@@ -52,6 +52,8 @@ struct fan53555_platform_data {
246722851890Sopenharmony_ci 	unsigned int slew_rate;
246822851890Sopenharmony_ci 	/* Sleep VSEL ID */
246922851890Sopenharmony_ci 	unsigned int sleep_vsel_id;
247022851890Sopenharmony_ci+	int limit_volt;
247122851890Sopenharmony_ci+	struct gpio_desc *vsel_gpio;
247222851890Sopenharmony_ci };
247322851890Sopenharmony_ci 
247422851890Sopenharmony_ci #endif /* __FAN53555_H__ */
247522851890Sopenharmony_cidiff --git a/include/linux/sched.h b/include/linux/sched.h
247622851890Sopenharmony_ciindex 3dca22f2a..ef9d4a196 100644
247722851890Sopenharmony_ci--- a/include/linux/sched.h
247822851890Sopenharmony_ci+++ b/include/linux/sched.h
247922851890Sopenharmony_ci@@ -1356,7 +1356,7 @@ struct task_struct {
248022851890Sopenharmony_ci 	u64				timer_slack_ns;
248122851890Sopenharmony_ci 	u64				default_timer_slack_ns;
248222851890Sopenharmony_ci 
248322851890Sopenharmony_ci-#ifdef CONFIG_KASAN
248422851890Sopenharmony_ci+#if defined(CONFIG_KASAN_GENERIC) || defined(CONFIG_KASAN_SW_TAGS)
248522851890Sopenharmony_ci 	unsigned int			kasan_depth;
248622851890Sopenharmony_ci #endif
248722851890Sopenharmony_ci 
248822851890Sopenharmony_cidiff --git a/include/linux/sched/hotplug.h b/include/linux/sched/hotplug.h
248922851890Sopenharmony_ciindex 9a62ffdd2..89fb9b027 100644
249022851890Sopenharmony_ci--- a/include/linux/sched/hotplug.h
249122851890Sopenharmony_ci+++ b/include/linux/sched/hotplug.h
249222851890Sopenharmony_ci@@ -8,7 +8,11 @@
249322851890Sopenharmony_ci 
249422851890Sopenharmony_ci extern int sched_cpu_starting(unsigned int cpu);
249522851890Sopenharmony_ci extern int sched_cpu_activate(unsigned int cpu);
249622851890Sopenharmony_ci+extern int sched_cpus_activate(struct cpumask *cpus);
249722851890Sopenharmony_ci extern int sched_cpu_deactivate(unsigned int cpu);
249822851890Sopenharmony_ci+extern int sched_cpus_deactivate_nosync(struct cpumask *cpus);
249922851890Sopenharmony_ci+extern int sched_cpu_drain_rq(unsigned int cpu);
250022851890Sopenharmony_ci+extern void sched_cpu_drain_rq_wait(unsigned int cpu);
250122851890Sopenharmony_ci 
250222851890Sopenharmony_ci #ifdef CONFIG_HOTPLUG_CPU
250322851890Sopenharmony_ci extern int sched_cpu_dying(unsigned int cpu);
250422851890Sopenharmony_cidiff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolation.h
250522851890Sopenharmony_ciindex 22420b45b..cc9f393e2 100644
250622851890Sopenharmony_ci--- a/include/linux/sched/isolation.h
250722851890Sopenharmony_ci+++ b/include/linux/sched/isolation.h
250822851890Sopenharmony_ci@@ -28,25 +28,10 @@ extern void __init housekeeping_init(void);
250922851890Sopenharmony_ci 
251022851890Sopenharmony_ci #else
251122851890Sopenharmony_ci 
251222851890Sopenharmony_ci-#ifdef CONFIG_CPU_ISOLATION_OPT
251322851890Sopenharmony_ci-static inline int housekeeping_any_cpu(enum hk_flags flags)
251422851890Sopenharmony_ci-{
251522851890Sopenharmony_ci-	cpumask_t available;
251622851890Sopenharmony_ci-	int cpu;
251722851890Sopenharmony_ci-
251822851890Sopenharmony_ci-	cpumask_andnot(&available, cpu_online_mask, cpu_isolated_mask);
251922851890Sopenharmony_ci-	cpu = cpumask_any(&available);
252022851890Sopenharmony_ci-	if (cpu >= nr_cpu_ids)
252122851890Sopenharmony_ci-		cpu = smp_processor_id();
252222851890Sopenharmony_ci-
252322851890Sopenharmony_ci-	return cpu;
252422851890Sopenharmony_ci-}
252522851890Sopenharmony_ci-#else
252622851890Sopenharmony_ci static inline int housekeeping_any_cpu(enum hk_flags flags)
252722851890Sopenharmony_ci {
252822851890Sopenharmony_ci 	return smp_processor_id();
252922851890Sopenharmony_ci }
253022851890Sopenharmony_ci-#endif
253122851890Sopenharmony_ci 
253222851890Sopenharmony_ci static inline const struct cpumask *housekeeping_cpumask(enum hk_flags flags)
253322851890Sopenharmony_ci {
253422851890Sopenharmony_ci@@ -69,11 +54,7 @@ static inline bool housekeeping_cpu(int cpu, enum hk_flags flags)
253522851890Sopenharmony_ci 	if (static_branch_unlikely(&housekeeping_overridden))
253622851890Sopenharmony_ci 		return housekeeping_test_cpu(cpu, flags);
253722851890Sopenharmony_ci #endif
253822851890Sopenharmony_ci-#ifdef CONFIG_CPU_ISOLATION_OPT
253922851890Sopenharmony_ci-	return !cpu_isolated(cpu);
254022851890Sopenharmony_ci-#else
254122851890Sopenharmony_ci 	return true;
254222851890Sopenharmony_ci-#endif
254322851890Sopenharmony_ci }
254422851890Sopenharmony_ci 
254522851890Sopenharmony_ci #endif /* _LINUX_SCHED_ISOLATION_H */
254622851890Sopenharmony_cidiff --git a/include/linux/sched/wake_q.h b/include/linux/sched/wake_q.h
254722851890Sopenharmony_ciindex 26a2013ac..1e05e5669 100644
254822851890Sopenharmony_ci--- a/include/linux/sched/wake_q.h
254922851890Sopenharmony_ci+++ b/include/linux/sched/wake_q.h
255022851890Sopenharmony_ci@@ -38,6 +38,7 @@
255122851890Sopenharmony_ci struct wake_q_head {
255222851890Sopenharmony_ci 	struct wake_q_node *first;
255322851890Sopenharmony_ci 	struct wake_q_node **lastp;
255422851890Sopenharmony_ci+	int count;
255522851890Sopenharmony_ci };
255622851890Sopenharmony_ci 
255722851890Sopenharmony_ci #define WAKE_Q_TAIL ((struct wake_q_node *) 0x01)
255822851890Sopenharmony_ci@@ -49,6 +50,7 @@ static inline void wake_q_init(struct wake_q_head *head)
255922851890Sopenharmony_ci {
256022851890Sopenharmony_ci 	head->first = WAKE_Q_TAIL;
256122851890Sopenharmony_ci 	head->lastp = &head->first;
256222851890Sopenharmony_ci+	head->count = 0;
256322851890Sopenharmony_ci }
256422851890Sopenharmony_ci 
256522851890Sopenharmony_ci static inline bool wake_q_empty(struct wake_q_head *head)
256622851890Sopenharmony_cidiff --git a/include/linux/sched/xacct.h b/include/linux/sched/xacct.h
256722851890Sopenharmony_ciindex c078f0a94..9544c9d9d 100644
256822851890Sopenharmony_ci--- a/include/linux/sched/xacct.h
256922851890Sopenharmony_ci+++ b/include/linux/sched/xacct.h
257022851890Sopenharmony_ci@@ -28,6 +28,11 @@ static inline void inc_syscw(struct task_struct *tsk)
257122851890Sopenharmony_ci {
257222851890Sopenharmony_ci 	tsk->ioac.syscw++;
257322851890Sopenharmony_ci }
257422851890Sopenharmony_ci+
257522851890Sopenharmony_ci+static inline void inc_syscfs(struct task_struct *tsk)
257622851890Sopenharmony_ci+{
257722851890Sopenharmony_ci+	tsk->ioac.syscfs++;
257822851890Sopenharmony_ci+}
257922851890Sopenharmony_ci #else
258022851890Sopenharmony_ci static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
258122851890Sopenharmony_ci {
258222851890Sopenharmony_ci@@ -44,6 +49,10 @@ static inline void inc_syscr(struct task_struct *tsk)
258322851890Sopenharmony_ci static inline void inc_syscw(struct task_struct *tsk)
258422851890Sopenharmony_ci {
258522851890Sopenharmony_ci }
258622851890Sopenharmony_ci+
258722851890Sopenharmony_ci+static inline void inc_syscfs(struct task_struct *tsk)
258822851890Sopenharmony_ci+{
258922851890Sopenharmony_ci+}
259022851890Sopenharmony_ci #endif
259122851890Sopenharmony_ci 
259222851890Sopenharmony_ci #endif /* _LINUX_SCHED_XACCT_H */
259322851890Sopenharmony_cidiff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
259422851890Sopenharmony_ciindex b56e1dedc..ba4246721 100644
259522851890Sopenharmony_ci--- a/include/linux/stmmac.h
259622851890Sopenharmony_ci+++ b/include/linux/stmmac.h
259722851890Sopenharmony_ci@@ -183,6 +183,7 @@ struct plat_stmmacenet_data {
259822851890Sopenharmony_ci 	void (*serdes_powerdown)(struct net_device *ndev, void *priv);
259922851890Sopenharmony_ci 	int (*init)(struct platform_device *pdev, void *priv);
260022851890Sopenharmony_ci 	void (*exit)(struct platform_device *pdev, void *priv);
260122851890Sopenharmony_ci+	void (*get_eth_addr)(void *priv, unsigned char *addr);
260222851890Sopenharmony_ci 	struct mac_device_info *(*setup)(void *priv);
260322851890Sopenharmony_ci 	void *bsp_priv;
260422851890Sopenharmony_ci 	struct clk *stmmac_clk;
260522851890Sopenharmony_cidiff --git a/include/linux/thermal.h b/include/linux/thermal.h
260622851890Sopenharmony_ciindex 176d9454e..aa4b4114b 100644
260722851890Sopenharmony_ci--- a/include/linux/thermal.h
260822851890Sopenharmony_ci+++ b/include/linux/thermal.h
260922851890Sopenharmony_ci@@ -399,6 +399,7 @@ void thermal_cdev_update(struct thermal_cooling_device *);
261022851890Sopenharmony_ci void thermal_notify_framework(struct thermal_zone_device *, int);
261122851890Sopenharmony_ci int thermal_zone_device_enable(struct thermal_zone_device *tz);
261222851890Sopenharmony_ci int thermal_zone_device_disable(struct thermal_zone_device *tz);
261322851890Sopenharmony_ci+int thermal_zone_device_is_enabled(struct thermal_zone_device *tz);
261422851890Sopenharmony_ci #else
261522851890Sopenharmony_ci static inline struct thermal_zone_device *thermal_zone_device_register(
261622851890Sopenharmony_ci 	const char *type, int trips, int mask, void *devdata,
261722851890Sopenharmony_ci@@ -453,6 +454,10 @@ static inline int thermal_zone_device_enable(struct thermal_zone_device *tz)
261822851890Sopenharmony_ci 
261922851890Sopenharmony_ci static inline int thermal_zone_device_disable(struct thermal_zone_device *tz)
262022851890Sopenharmony_ci { return -ENODEV; }
262122851890Sopenharmony_ci+
262222851890Sopenharmony_ci+static inline int
262322851890Sopenharmony_ci+thermal_zone_device_is_enabled(struct thermal_zone_device *tz)
262422851890Sopenharmony_ci+{ return -ENODEV; }
262522851890Sopenharmony_ci #endif /* CONFIG_THERMAL */
262622851890Sopenharmony_ci 
262722851890Sopenharmony_ci #endif /* __THERMAL_H__ */
262822851890Sopenharmony_cidiff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h
262922851890Sopenharmony_ciindex ead8c9a47..899c84e7c 100644
263022851890Sopenharmony_ci--- a/include/linux/usb/audio-v2.h
263122851890Sopenharmony_ci+++ b/include/linux/usb/audio-v2.h
263222851890Sopenharmony_ci@@ -168,6 +168,20 @@ struct uac2_effect_unit_descriptor {
263322851890Sopenharmony_ci 	__u8 bmaControls[]; /* variable length */
263422851890Sopenharmony_ci } __attribute__((packed));
263522851890Sopenharmony_ci 
263622851890Sopenharmony_ci+#define UAC2_DT_FEATURE_UNIT_SIZE(ch)		(6 + ((ch) + 1) * 4)
263722851890Sopenharmony_ci+
263822851890Sopenharmony_ci+/* As above, but more useful for defining your own descriptors: */
263922851890Sopenharmony_ci+#define DECLARE_UAC2_FEATURE_UNIT_DESCRIPTOR(ch)		\
264022851890Sopenharmony_ci+struct uac2_feature_unit_descriptor_##ch {			\
264122851890Sopenharmony_ci+	__u8  bLength;						\
264222851890Sopenharmony_ci+	__u8  bDescriptorType;					\
264322851890Sopenharmony_ci+	__u8  bDescriptorSubtype;				\
264422851890Sopenharmony_ci+	__u8  bUnitID;						\
264522851890Sopenharmony_ci+	__u8  bSourceID;					\
264622851890Sopenharmony_ci+	__le32 bmaControls[ch + 1];				\
264722851890Sopenharmony_ci+	__u8  iFeature;						\
264822851890Sopenharmony_ci+} __attribute__((packed))
264922851890Sopenharmony_ci+
265022851890Sopenharmony_ci /* 4.9.2 Class-Specific AS Interface Descriptor */
265122851890Sopenharmony_ci 
265222851890Sopenharmony_ci struct uac2_as_header_descriptor {
265322851890Sopenharmony_ci@@ -331,6 +345,9 @@ struct uac2_interrupt_data_msg {
265422851890Sopenharmony_ci #define UAC2_FU_OVERFLOW		0x0f
265522851890Sopenharmony_ci #define UAC2_FU_LATENCY			0x10
265622851890Sopenharmony_ci 
265722851890Sopenharmony_ci+#define UAC2_CONTROL_BIT_RO(CS)		(0x01 << (((CS) - 1) << 1))
265822851890Sopenharmony_ci+#define UAC2_CONTROL_BIT_RW(CS)		(0x03 << (((CS) - 1) << 1))
265922851890Sopenharmony_ci+
266022851890Sopenharmony_ci /* A.17.8.1 Parametric Equalizer Section Effect Unit Control Selectors */
266122851890Sopenharmony_ci #define UAC2_PE_UNDEFINED		0x00
266222851890Sopenharmony_ci #define UAC2_PE_ENABLE			0x01
266322851890Sopenharmony_cidiff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h
266422851890Sopenharmony_ciindex 170acd500..646cb0a8d 100644
266522851890Sopenharmony_ci--- a/include/linux/usb/audio.h
266622851890Sopenharmony_ci+++ b/include/linux/usb/audio.h
266722851890Sopenharmony_ci@@ -31,6 +31,7 @@ struct usb_audio_control {
266822851890Sopenharmony_ci 	int data[5];
266922851890Sopenharmony_ci 	int (*set)(struct usb_audio_control *con, u8 cmd, int value);
267022851890Sopenharmony_ci 	int (*get)(struct usb_audio_control *con, u8 cmd);
267122851890Sopenharmony_ci+	void *context;
267222851890Sopenharmony_ci };
267322851890Sopenharmony_ci 
267422851890Sopenharmony_ci struct usb_audio_control_selector {
267522851890Sopenharmony_cidiff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
267622851890Sopenharmony_ciindex a2d229ab6..4d352204e 100644
267722851890Sopenharmony_ci--- a/include/linux/usb/composite.h
267822851890Sopenharmony_ci+++ b/include/linux/usb/composite.h
267922851890Sopenharmony_ci@@ -525,6 +525,8 @@ extern struct usb_string *usb_gstrings_attach(struct usb_composite_dev *cdev,
268022851890Sopenharmony_ci extern int usb_string_ids_n(struct usb_composite_dev *c, unsigned n);
268122851890Sopenharmony_ci 
268222851890Sopenharmony_ci extern void composite_disconnect(struct usb_gadget *gadget);
268322851890Sopenharmony_ci+extern void composite_reset(struct usb_gadget *gadget);
268422851890Sopenharmony_ci+
268522851890Sopenharmony_ci extern int composite_setup(struct usb_gadget *gadget,
268622851890Sopenharmony_ci 		const struct usb_ctrlrequest *ctrl);
268722851890Sopenharmony_ci extern void composite_suspend(struct usb_gadget *gadget);
268822851890Sopenharmony_ci@@ -590,6 +592,7 @@ struct usb_function_instance {
268922851890Sopenharmony_ci 	struct config_group group;
269022851890Sopenharmony_ci 	struct list_head cfs_list;
269122851890Sopenharmony_ci 	struct usb_function_driver *fd;
269222851890Sopenharmony_ci+	struct usb_function *f;
269322851890Sopenharmony_ci 	int (*set_inst_name)(struct usb_function_instance *inst,
269422851890Sopenharmony_ci 			      const char *name);
269522851890Sopenharmony_ci 	void (*free_func_inst)(struct usb_function_instance *inst);
269622851890Sopenharmony_cidiff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
269722851890Sopenharmony_ciindex e7351d64f..a15700a40 100644
269822851890Sopenharmony_ci--- a/include/linux/usb/gadget.h
269922851890Sopenharmony_ci+++ b/include/linux/usb/gadget.h
270022851890Sopenharmony_ci@@ -217,6 +217,7 @@ struct usb_ep_caps {
270122851890Sopenharmony_ci  *	enabled and remains valid until the endpoint is disabled.
270222851890Sopenharmony_ci  * @comp_desc: In case of SuperSpeed support, this is the endpoint companion
270322851890Sopenharmony_ci  *	descriptor that is used to configure the endpoint
270422851890Sopenharmony_ci+ * @transfer_type: Used to specify transfer type of EP.
270522851890Sopenharmony_ci  *
270622851890Sopenharmony_ci  * the bus controller driver lists all the general purpose endpoints in
270722851890Sopenharmony_ci  * gadget->ep_list.  the control endpoint (gadget->ep0) is not in that list,
270822851890Sopenharmony_ci@@ -240,6 +241,9 @@ struct usb_ep {
270922851890Sopenharmony_ci 	u8			address;
271022851890Sopenharmony_ci 	const struct usb_endpoint_descriptor	*desc;
271122851890Sopenharmony_ci 	const struct usb_ss_ep_comp_descriptor	*comp_desc;
271222851890Sopenharmony_ci+#if defined(CONFIG_ARCH_ROCKCHIP) && defined(CONFIG_NO_GKI)
271322851890Sopenharmony_ci+	u8			transfer_type;
271422851890Sopenharmony_ci+#endif
271522851890Sopenharmony_ci };
271622851890Sopenharmony_ci 
271722851890Sopenharmony_ci /*-------------------------------------------------------------------------*/
271822851890Sopenharmony_ci@@ -323,6 +327,8 @@ struct usb_gadget_ops {
271922851890Sopenharmony_ci 			struct usb_gadget_driver *);
272022851890Sopenharmony_ci 	int	(*udc_stop)(struct usb_gadget *);
272122851890Sopenharmony_ci 	void	(*udc_set_speed)(struct usb_gadget *, enum usb_device_speed);
272222851890Sopenharmony_ci+	void	(*udc_set_ssp_rate)(struct usb_gadget *gadget,
272322851890Sopenharmony_ci+			enum usb_ssp_rate rate);
272422851890Sopenharmony_ci 	struct usb_ep *(*match_ep)(struct usb_gadget *,
272522851890Sopenharmony_ci 			struct usb_endpoint_descriptor *,
272622851890Sopenharmony_ci 			struct usb_ss_ep_comp_descriptor *);
272722851890Sopenharmony_ci@@ -339,6 +345,10 @@ struct usb_gadget_ops {
272822851890Sopenharmony_ci  * @speed: Speed of current connection to USB host.
272922851890Sopenharmony_ci  * @max_speed: Maximal speed the UDC can handle.  UDC must support this
273022851890Sopenharmony_ci  *      and all slower speeds.
273122851890Sopenharmony_ci+ * @ssp_rate: Current connected SuperSpeed Plus signaling rate and lane count.
273222851890Sopenharmony_ci+ * @max_ssp_rate: Maximum SuperSpeed Plus signaling rate and lane count the UDC
273322851890Sopenharmony_ci+ *	can handle. The UDC must support this and all slower speeds and lower
273422851890Sopenharmony_ci+ *	number of lanes.
273522851890Sopenharmony_ci  * @state: the state we are now (attached, suspended, configured, etc)
273622851890Sopenharmony_ci  * @name: Identifies the controller hardware type.  Used in diagnostics
273722851890Sopenharmony_ci  *	and sometimes configuration.
273822851890Sopenharmony_ci@@ -406,6 +416,11 @@ struct usb_gadget {
273922851890Sopenharmony_ci 	struct list_head		ep_list;	/* of usb_ep */
274022851890Sopenharmony_ci 	enum usb_device_speed		speed;
274122851890Sopenharmony_ci 	enum usb_device_speed		max_speed;
274222851890Sopenharmony_ci+
274322851890Sopenharmony_ci+	/* USB SuperSpeed Plus only */
274422851890Sopenharmony_ci+	enum usb_ssp_rate		ssp_rate;
274522851890Sopenharmony_ci+	enum usb_ssp_rate		max_ssp_rate;
274622851890Sopenharmony_ci+
274722851890Sopenharmony_ci 	enum usb_device_state		state;
274822851890Sopenharmony_ci 	const char			*name;
274922851890Sopenharmony_ci 	struct device			dev;
275022851890Sopenharmony_cidiff --git a/include/linux/usb/pd.h b/include/linux/usb/pd.h
275122851890Sopenharmony_ciindex 433040ff8..96b7ff66f 100644
275222851890Sopenharmony_ci--- a/include/linux/usb/pd.h
275322851890Sopenharmony_ci+++ b/include/linux/usb/pd.h
275422851890Sopenharmony_ci@@ -225,6 +225,7 @@ enum pd_pdo_type {
275522851890Sopenharmony_ci #define PDO_FIXED_EXTPOWER		BIT(27) /* Externally powered */
275622851890Sopenharmony_ci #define PDO_FIXED_USB_COMM		BIT(26) /* USB communications capable */
275722851890Sopenharmony_ci #define PDO_FIXED_DATA_SWAP		BIT(25) /* Data role swap supported */
275822851890Sopenharmony_ci+#define PDO_FIXED_UNCHUNK_EXT		BIT(24) /* Unchunked Extended Message supported (Source) */
275922851890Sopenharmony_ci #define PDO_FIXED_FRS_CURR_MASK		(BIT(24) | BIT(23)) /* FR_Swap Current (Sink) */
276022851890Sopenharmony_ci #define PDO_FIXED_FRS_CURR_SHIFT	23
276122851890Sopenharmony_ci #define PDO_FIXED_VOLT_SHIFT		10	/* 50mV units */
276222851890Sopenharmony_ci@@ -466,6 +467,7 @@ static inline unsigned int rdo_max_power(u32 rdo)
276322851890Sopenharmony_ci #define PD_T_DRP_SRC		30
276422851890Sopenharmony_ci #define PD_T_PS_SOURCE_OFF	920
276522851890Sopenharmony_ci #define PD_T_PS_SOURCE_ON	480
276622851890Sopenharmony_ci+#define PD_T_PS_SOURCE_ON_PRS	450	/* 390 - 480ms */
276722851890Sopenharmony_ci #define PD_T_PS_HARD_RESET	30
276822851890Sopenharmony_ci #define PD_T_SRC_RECOVER	760
276922851890Sopenharmony_ci #define PD_T_SRC_RECOVER_MAX	1000
277022851890Sopenharmony_ci@@ -478,14 +480,19 @@ static inline unsigned int rdo_max_power(u32 rdo)
277122851890Sopenharmony_ci #define PD_T_NEWSRC		250	/* Maximum of 275ms */
277222851890Sopenharmony_ci #define PD_T_SWAP_SRC_START	20	/* Minimum of 20ms */
277322851890Sopenharmony_ci #define PD_T_BIST_CONT_MODE	50	/* 30 - 60 ms */
277422851890Sopenharmony_ci+#define PD_T_SINK_TX		16	/* 16 - 20 ms */
277522851890Sopenharmony_ci+#define PD_T_CHUNK_NOT_SUPP	42	/* 40 - 50 ms */
277622851890Sopenharmony_ci 
277722851890Sopenharmony_ci #define PD_T_DRP_TRY		100	/* 75 - 150 ms */
277822851890Sopenharmony_ci #define PD_T_DRP_TRYWAIT	600	/* 400 - 800 ms */
277922851890Sopenharmony_ci 
278022851890Sopenharmony_ci #define PD_T_CC_DEBOUNCE	200	/* 100 - 200 ms */
278122851890Sopenharmony_ci #define PD_T_PD_DEBOUNCE	20	/* 10 - 20 ms */
278222851890Sopenharmony_ci+#define PD_T_TRY_CC_DEBOUNCE	15	/* 10 - 20 ms */
278322851890Sopenharmony_ci 
278422851890Sopenharmony_ci #define PD_N_CAPS_COUNT		(PD_T_NO_RESPONSE / PD_T_SEND_SOURCE_CAP)
278522851890Sopenharmony_ci #define PD_N_HARD_RESET_COUNT	2
278622851890Sopenharmony_ci 
278722851890Sopenharmony_ci+#define PD_P_SNK_STDBY_MW	2500	/* 2500 mW */
278822851890Sopenharmony_ci+
278922851890Sopenharmony_ci #endif /* __LINUX_USB_PD_H */
279022851890Sopenharmony_cidiff --git a/include/linux/usb/pd_ext_sdb.h b/include/linux/usb/pd_ext_sdb.h
279122851890Sopenharmony_ciindex 0eb83ce19..b517ebc8f 100644
279222851890Sopenharmony_ci--- a/include/linux/usb/pd_ext_sdb.h
279322851890Sopenharmony_ci+++ b/include/linux/usb/pd_ext_sdb.h
279422851890Sopenharmony_ci@@ -24,8 +24,4 @@ enum usb_pd_ext_sdb_fields {
279522851890Sopenharmony_ci #define USB_PD_EXT_SDB_EVENT_OVP		BIT(3)
279622851890Sopenharmony_ci #define USB_PD_EXT_SDB_EVENT_CF_CV_MODE		BIT(4)
279722851890Sopenharmony_ci 
279822851890Sopenharmony_ci-#define USB_PD_EXT_SDB_PPS_EVENTS	(USB_PD_EXT_SDB_EVENT_OCP |	\
279922851890Sopenharmony_ci-					 USB_PD_EXT_SDB_EVENT_OTP |	\
280022851890Sopenharmony_ci-					 USB_PD_EXT_SDB_EVENT_OVP)
280122851890Sopenharmony_ci-
280222851890Sopenharmony_ci #endif /* __LINUX_USB_PD_EXT_SDB_H */
280322851890Sopenharmony_cidiff --git a/include/linux/usb/pd_vdo.h b/include/linux/usb/pd_vdo.h
280422851890Sopenharmony_ciindex 68bdc4e2f..7f5e330a6 100644
280522851890Sopenharmony_ci--- a/include/linux/usb/pd_vdo.h
280622851890Sopenharmony_ci+++ b/include/linux/usb/pd_vdo.h
280722851890Sopenharmony_ci@@ -21,22 +21,24 @@
280822851890Sopenharmony_ci  * ----------
280922851890Sopenharmony_ci  * <31:16>  :: SVID
281022851890Sopenharmony_ci  * <15>     :: VDM type ( 1b == structured, 0b == unstructured )
281122851890Sopenharmony_ci- * <14:13>  :: Structured VDM version (can only be 00 == 1.0 currently)
281222851890Sopenharmony_ci+ * <14:13>  :: Structured VDM version
281322851890Sopenharmony_ci  * <12:11>  :: reserved
281422851890Sopenharmony_ci  * <10:8>   :: object position (1-7 valid ... used for enter/exit mode only)
281522851890Sopenharmony_ci  * <7:6>    :: command type (SVDM only?)
281622851890Sopenharmony_ci  * <5>      :: reserved (SVDM), command type (UVDM)
281722851890Sopenharmony_ci  * <4:0>    :: command
281822851890Sopenharmony_ci  */
281922851890Sopenharmony_ci-#define VDO(vid, type, custom)				\
282022851890Sopenharmony_ci+#define VDO(vid, type, ver, custom)			\
282122851890Sopenharmony_ci 	(((vid) << 16) |				\
282222851890Sopenharmony_ci 	 ((type) << 15) |				\
282322851890Sopenharmony_ci+	 ((ver) << 13) |				\
282422851890Sopenharmony_ci 	 ((custom) & 0x7FFF))
282522851890Sopenharmony_ci 
282622851890Sopenharmony_ci #define VDO_SVDM_TYPE		(1 << 15)
282722851890Sopenharmony_ci #define VDO_SVDM_VERS(x)	((x) << 13)
282822851890Sopenharmony_ci #define VDO_OPOS(x)		((x) << 8)
282922851890Sopenharmony_ci #define VDO_CMDT(x)		((x) << 6)
283022851890Sopenharmony_ci+#define VDO_SVDM_VERS_MASK	VDO_SVDM_VERS(0x3)
283122851890Sopenharmony_ci #define VDO_OPOS_MASK		VDO_OPOS(0x7)
283222851890Sopenharmony_ci #define VDO_CMDT_MASK		VDO_CMDT(0x3)
283322851890Sopenharmony_ci 
283422851890Sopenharmony_ci@@ -74,6 +76,7 @@
283522851890Sopenharmony_ci 
283622851890Sopenharmony_ci #define PD_VDO_VID(vdo)		((vdo) >> 16)
283722851890Sopenharmony_ci #define PD_VDO_SVDM(vdo)	(((vdo) >> 15) & 1)
283822851890Sopenharmony_ci+#define PD_VDO_SVDM_VER(vdo)	(((vdo) >> 13) & 0x3)
283922851890Sopenharmony_ci #define PD_VDO_OPOS(vdo)	(((vdo) >> 8) & 0x7)
284022851890Sopenharmony_ci #define PD_VDO_CMD(vdo)		((vdo) & 0x1f)
284122851890Sopenharmony_ci #define PD_VDO_CMDT(vdo)	(((vdo) >> 6) & 0x3)
284222851890Sopenharmony_ci@@ -103,25 +106,50 @@
284322851890Sopenharmony_ci  * --------------------
284422851890Sopenharmony_ci  * <31>     :: data capable as a USB host
284522851890Sopenharmony_ci  * <30>     :: data capable as a USB device
284622851890Sopenharmony_ci- * <29:27>  :: product type
284722851890Sopenharmony_ci+ * <29:27>  :: product type (UFP / Cable / VPD)
284822851890Sopenharmony_ci  * <26>     :: modal operation supported (1b == yes)
284922851890Sopenharmony_ci- * <25:16>  :: Reserved, Shall be set to zero
285022851890Sopenharmony_ci+ * <25:23>  :: product type (DFP) (SVDM version 2.0+ only; set to zero in version 1.0)
285122851890Sopenharmony_ci+ * <22:21>  :: connector type (SVDM version 2.0+ only; set to zero in version 1.0)
285222851890Sopenharmony_ci+ * <20:16>  :: Reserved, Shall be set to zero
285322851890Sopenharmony_ci  * <15:0>   :: USB-IF assigned VID for this cable vendor
285422851890Sopenharmony_ci  */
285522851890Sopenharmony_ci+
285622851890Sopenharmony_ci+/* PD Rev2.0 definition */
285722851890Sopenharmony_ci #define IDH_PTYPE_UNDEF		0
285822851890Sopenharmony_ci+
285922851890Sopenharmony_ci+/* SOP Product Type (UFP) */
286022851890Sopenharmony_ci+#define IDH_PTYPE_NOT_UFP	0
286122851890Sopenharmony_ci #define IDH_PTYPE_HUB		1
286222851890Sopenharmony_ci #define IDH_PTYPE_PERIPH	2
286322851890Sopenharmony_ci+#define IDH_PTYPE_PSD		3
286422851890Sopenharmony_ci+#define IDH_PTYPE_AMA		5
286522851890Sopenharmony_ci+
286622851890Sopenharmony_ci+/* SOP' Product Type (Cable Plug / VPD) */
286722851890Sopenharmony_ci+#define IDH_PTYPE_NOT_CABLE	0
286822851890Sopenharmony_ci #define IDH_PTYPE_PCABLE	3
286922851890Sopenharmony_ci #define IDH_PTYPE_ACABLE	4
287022851890Sopenharmony_ci-#define IDH_PTYPE_AMA		5
287122851890Sopenharmony_ci+#define IDH_PTYPE_VPD		6
287222851890Sopenharmony_ci 
287322851890Sopenharmony_ci-#define VDO_IDH(usbh, usbd, ptype, is_modal, vid)		\
287422851890Sopenharmony_ci-	((usbh) << 31 | (usbd) << 30 | ((ptype) & 0x7) << 27	\
287522851890Sopenharmony_ci-	 | (is_modal) << 26 | ((vid) & 0xffff))
287622851890Sopenharmony_ci+/* SOP Product Type (DFP) */
287722851890Sopenharmony_ci+#define IDH_PTYPE_NOT_DFP	0
287822851890Sopenharmony_ci+#define IDH_PTYPE_DFP_HUB	1
287922851890Sopenharmony_ci+#define IDH_PTYPE_DFP_HOST	2
288022851890Sopenharmony_ci+#define IDH_PTYPE_DFP_PB	3
288122851890Sopenharmony_ci+
288222851890Sopenharmony_ci+/* ID Header Mask */
288322851890Sopenharmony_ci+#define IDH_DFP_MASK		GENMASK(25, 23)
288422851890Sopenharmony_ci+#define IDH_CONN_MASK		GENMASK(22, 21)
288522851890Sopenharmony_ci+
288622851890Sopenharmony_ci+#define VDO_IDH(usbh, usbd, ufp_cable, is_modal, dfp, conn, vid)		\
288722851890Sopenharmony_ci+	((usbh) << 31 | (usbd) << 30 | ((ufp_cable) & 0x7) << 27		\
288822851890Sopenharmony_ci+	 | (is_modal) << 26 | ((dfp) & 0x7) << 23 | ((conn) & 0x3) << 21	\
288922851890Sopenharmony_ci+	 | ((vid) & 0xffff))
289022851890Sopenharmony_ci 
289122851890Sopenharmony_ci #define PD_IDH_PTYPE(vdo)	(((vdo) >> 27) & 0x7)
289222851890Sopenharmony_ci #define PD_IDH_VID(vdo)		((vdo) & 0xffff)
289322851890Sopenharmony_ci #define PD_IDH_MODAL_SUPP(vdo)	((vdo) & (1 << 26))
289422851890Sopenharmony_ci+#define PD_IDH_DFP_PTYPE(vdo)	(((vdo) >> 23) & 0x7)
289522851890Sopenharmony_ci+#define PD_IDH_CONN_TYPE(vdo)	(((vdo) >> 21) & 0x3)
289622851890Sopenharmony_ci 
289722851890Sopenharmony_ci /*
289822851890Sopenharmony_ci  * Cert Stat VDO
289922851890Sopenharmony_ci@@ -129,6 +157,7 @@
290022851890Sopenharmony_ci  * <31:0>  : USB-IF assigned XID for this cable
290122851890Sopenharmony_ci  */
290222851890Sopenharmony_ci #define PD_CSTAT_XID(vdo)	(vdo)
290322851890Sopenharmony_ci+#define VDO_CERT(xid)		((xid) & 0xffffffff)
290422851890Sopenharmony_ci 
290522851890Sopenharmony_ci /*
290622851890Sopenharmony_ci  * Product VDO
290722851890Sopenharmony_ci@@ -140,77 +169,270 @@
290822851890Sopenharmony_ci #define PD_PRODUCT_PID(vdo)	(((vdo) >> 16) & 0xffff)
290922851890Sopenharmony_ci 
291022851890Sopenharmony_ci /*
291122851890Sopenharmony_ci- * UFP VDO1
291222851890Sopenharmony_ci+ * UFP VDO (PD Revision 3.0+ only)
291322851890Sopenharmony_ci  * --------
291422851890Sopenharmony_ci  * <31:29> :: UFP VDO version
291522851890Sopenharmony_ci  * <28>    :: Reserved
291622851890Sopenharmony_ci  * <27:24> :: Device capability
291722851890Sopenharmony_ci- * <23:6>  :: Reserved
291822851890Sopenharmony_ci+ * <23:22> :: Connector type (10b == receptacle, 11b == captive plug)
291922851890Sopenharmony_ci+ * <21:11> :: Reserved
292022851890Sopenharmony_ci+ * <10:8>  :: Vconn power (AMA only)
292122851890Sopenharmony_ci+ * <7>     :: Vconn required (AMA only, 0b == no, 1b == yes)
292222851890Sopenharmony_ci+ * <6>     :: Vbus required (AMA only, 0b == yes, 1b == no)
292322851890Sopenharmony_ci  * <5:3>   :: Alternate modes
292422851890Sopenharmony_ci  * <2:0>   :: USB highest speed
292522851890Sopenharmony_ci  */
292622851890Sopenharmony_ci-#define PD_VDO1_UFP_DEVCAP(vdo)	(((vdo) & GENMASK(27, 24)) >> 24)
292722851890Sopenharmony_ci+#define PD_VDO_UFP_DEVCAP(vdo)	(((vdo) & GENMASK(27, 24)) >> 24)
292822851890Sopenharmony_ci 
292922851890Sopenharmony_ci+/* UFP VDO Version */
293022851890Sopenharmony_ci+#define UFP_VDO_VER1_2		2
293122851890Sopenharmony_ci+
293222851890Sopenharmony_ci+/* Device Capability */
293322851890Sopenharmony_ci #define DEV_USB2_CAPABLE	BIT(0)
293422851890Sopenharmony_ci #define DEV_USB2_BILLBOARD	BIT(1)
293522851890Sopenharmony_ci #define DEV_USB3_CAPABLE	BIT(2)
293622851890Sopenharmony_ci #define DEV_USB4_CAPABLE	BIT(3)
293722851890Sopenharmony_ci 
293822851890Sopenharmony_ci+/* Connector Type */
293922851890Sopenharmony_ci+#define UFP_RECEPTACLE		2
294022851890Sopenharmony_ci+#define UFP_CAPTIVE		3
294122851890Sopenharmony_ci+
294222851890Sopenharmony_ci+/* Vconn Power (AMA only, set to AMA_VCONN_NOT_REQ if Vconn is not required) */
294322851890Sopenharmony_ci+#define AMA_VCONN_PWR_1W	0
294422851890Sopenharmony_ci+#define AMA_VCONN_PWR_1W5	1
294522851890Sopenharmony_ci+#define AMA_VCONN_PWR_2W	2
294622851890Sopenharmony_ci+#define AMA_VCONN_PWR_3W	3
294722851890Sopenharmony_ci+#define AMA_VCONN_PWR_4W	4
294822851890Sopenharmony_ci+#define AMA_VCONN_PWR_5W	5
294922851890Sopenharmony_ci+#define AMA_VCONN_PWR_6W	6
295022851890Sopenharmony_ci+
295122851890Sopenharmony_ci+/* Vconn Required (AMA only) */
295222851890Sopenharmony_ci+#define AMA_VCONN_NOT_REQ	0
295322851890Sopenharmony_ci+#define AMA_VCONN_REQ		1
295422851890Sopenharmony_ci+
295522851890Sopenharmony_ci+/* Vbus Required (AMA only) */
295622851890Sopenharmony_ci+#define AMA_VBUS_REQ		0
295722851890Sopenharmony_ci+#define AMA_VBUS_NOT_REQ	1
295822851890Sopenharmony_ci+
295922851890Sopenharmony_ci+/* Alternate Modes */
296022851890Sopenharmony_ci+#define UFP_ALTMODE_NOT_SUPP	0
296122851890Sopenharmony_ci+#define UFP_ALTMODE_TBT3	BIT(0)
296222851890Sopenharmony_ci+#define UFP_ALTMODE_RECFG	BIT(1)
296322851890Sopenharmony_ci+#define UFP_ALTMODE_NO_RECFG	BIT(2)
296422851890Sopenharmony_ci+
296522851890Sopenharmony_ci+/* USB Highest Speed */
296622851890Sopenharmony_ci+#define UFP_USB2_ONLY		0
296722851890Sopenharmony_ci+#define UFP_USB32_GEN1		1
296822851890Sopenharmony_ci+#define UFP_USB32_4_GEN2	2
296922851890Sopenharmony_ci+#define UFP_USB4_GEN3		3
297022851890Sopenharmony_ci+
297122851890Sopenharmony_ci+#define VDO_UFP(ver, cap, conn, vcpwr, vcr, vbr, alt, spd)			\
297222851890Sopenharmony_ci+	(((ver) & 0x7) << 29 | ((cap) & 0xf) << 24 | ((conn) & 0x3) << 22	\
297322851890Sopenharmony_ci+	 | ((vcpwr) & 0x7) << 8 | (vcr) << 7 | (vbr) << 6 | ((alt) & 0x7) << 3	\
297422851890Sopenharmony_ci+	 | ((spd) & 0x7))
297522851890Sopenharmony_ci+
297622851890Sopenharmony_ci /*
297722851890Sopenharmony_ci- * DFP VDO
297822851890Sopenharmony_ci+ * DFP VDO (PD Revision 3.0+ only)
297922851890Sopenharmony_ci  * --------
298022851890Sopenharmony_ci  * <31:29> :: DFP VDO version
298122851890Sopenharmony_ci  * <28:27> :: Reserved
298222851890Sopenharmony_ci  * <26:24> :: Host capability
298322851890Sopenharmony_ci- * <23:5>  :: Reserved
298422851890Sopenharmony_ci+ * <23:22> :: Connector type (10b == receptacle, 11b == captive plug)
298522851890Sopenharmony_ci+ * <21:5>  :: Reserved
298622851890Sopenharmony_ci  * <4:0>   :: Port number
298722851890Sopenharmony_ci  */
298822851890Sopenharmony_ci #define PD_VDO_DFP_HOSTCAP(vdo)	(((vdo) & GENMASK(26, 24)) >> 24)
298922851890Sopenharmony_ci 
299022851890Sopenharmony_ci+#define DFP_VDO_VER1_1		1
299122851890Sopenharmony_ci #define HOST_USB2_CAPABLE	BIT(0)
299222851890Sopenharmony_ci #define HOST_USB3_CAPABLE	BIT(1)
299322851890Sopenharmony_ci #define HOST_USB4_CAPABLE	BIT(2)
299422851890Sopenharmony_ci+#define DFP_RECEPTACLE		2
299522851890Sopenharmony_ci+#define DFP_CAPTIVE		3
299622851890Sopenharmony_ci+
299722851890Sopenharmony_ci+#define VDO_DFP(ver, cap, conn, pnum)						\
299822851890Sopenharmony_ci+	(((ver) & 0x7) << 29 | ((cap) & 0x7) << 24 | ((conn) & 0x3) << 22	\
299922851890Sopenharmony_ci+	 | ((pnum) & 0x1f))
300022851890Sopenharmony_ci 
300122851890Sopenharmony_ci /*
300222851890Sopenharmony_ci- * Cable VDO
300322851890Sopenharmony_ci+ * Cable VDO (for both Passive and Active Cable VDO in PD Rev2.0)
300422851890Sopenharmony_ci  * ---------
300522851890Sopenharmony_ci  * <31:28> :: Cable HW version
300622851890Sopenharmony_ci  * <27:24> :: Cable FW version
300722851890Sopenharmony_ci  * <23:20> :: Reserved, Shall be set to zero
300822851890Sopenharmony_ci- * <19:18> :: type-C to Type-A/B/C (00b == A, 01 == B, 10 == C)
300922851890Sopenharmony_ci- * <17>    :: Type-C to Plug/Receptacle (0b == plug, 1b == receptacle)
301022851890Sopenharmony_ci+ * <19:18> :: type-C to Type-A/B/C/Captive (00b == A, 01 == B, 10 == C, 11 == Captive)
301122851890Sopenharmony_ci+ * <17>    :: Reserved, Shall be set to zero
301222851890Sopenharmony_ci  * <16:13> :: cable latency (0001 == <10ns(~1m length))
301322851890Sopenharmony_ci  * <12:11> :: cable termination type (11b == both ends active VCONN req)
301422851890Sopenharmony_ci  * <10>    :: SSTX1 Directionality support (0b == fixed, 1b == cfgable)
301522851890Sopenharmony_ci  * <9>     :: SSTX2 Directionality support
301622851890Sopenharmony_ci  * <8>     :: SSRX1 Directionality support
301722851890Sopenharmony_ci  * <7>     :: SSRX2 Directionality support
301822851890Sopenharmony_ci- * <6:5>   :: Vbus current handling capability
301922851890Sopenharmony_ci+ * <6:5>   :: Vbus current handling capability (01b == 3A, 10b == 5A)
302022851890Sopenharmony_ci  * <4>     :: Vbus through cable (0b == no, 1b == yes)
302122851890Sopenharmony_ci  * <3>     :: SOP" controller present? (0b == no, 1b == yes)
302222851890Sopenharmony_ci  * <2:0>   :: USB SS Signaling support
302322851890Sopenharmony_ci+ *
302422851890Sopenharmony_ci+ * Passive Cable VDO (PD Rev3.0+)
302522851890Sopenharmony_ci+ * ---------
302622851890Sopenharmony_ci+ * <31:28> :: Cable HW version
302722851890Sopenharmony_ci+ * <27:24> :: Cable FW version
302822851890Sopenharmony_ci+ * <23:21> :: VDO version
302922851890Sopenharmony_ci+ * <20>    :: Reserved, Shall be set to zero
303022851890Sopenharmony_ci+ * <19:18> :: Type-C to Type-C/Captive (10b == C, 11b == Captive)
303122851890Sopenharmony_ci+ * <17>    :: Reserved, Shall be set to zero
303222851890Sopenharmony_ci+ * <16:13> :: cable latency (0001 == <10ns(~1m length))
303322851890Sopenharmony_ci+ * <12:11> :: cable termination type (10b == Vconn not req, 01b == Vconn req)
303422851890Sopenharmony_ci+ * <10:9>  :: Maximum Vbus voltage (00b == 20V, 01b == 30V, 10b == 40V, 11b == 50V)
303522851890Sopenharmony_ci+ * <8:7>   :: Reserved, Shall be set to zero
303622851890Sopenharmony_ci+ * <6:5>   :: Vbus current handling capability (01b == 3A, 10b == 5A)
303722851890Sopenharmony_ci+ * <4:3>   :: Reserved, Shall be set to zero
303822851890Sopenharmony_ci+ * <2:0>   :: USB highest speed
303922851890Sopenharmony_ci+ *
304022851890Sopenharmony_ci+ * Active Cable VDO 1 (PD Rev3.0+)
304122851890Sopenharmony_ci+ * ---------
304222851890Sopenharmony_ci+ * <31:28> :: Cable HW version
304322851890Sopenharmony_ci+ * <27:24> :: Cable FW version
304422851890Sopenharmony_ci+ * <23:21> :: VDO version
304522851890Sopenharmony_ci+ * <20>    :: Reserved, Shall be set to zero
304622851890Sopenharmony_ci+ * <19:18> :: Connector type (10b == C, 11b == Captive)
304722851890Sopenharmony_ci+ * <17>    :: Reserved, Shall be set to zero
304822851890Sopenharmony_ci+ * <16:13> :: cable latency (0001 == <10ns(~1m length))
304922851890Sopenharmony_ci+ * <12:11> :: cable termination type (10b == one end active, 11b == both ends active VCONN req)
305022851890Sopenharmony_ci+ * <10:9>  :: Maximum Vbus voltage (00b == 20V, 01b == 30V, 10b == 40V, 11b == 50V)
305122851890Sopenharmony_ci+ * <8>     :: SBU supported (0b == supported, 1b == not supported)
305222851890Sopenharmony_ci+ * <7>     :: SBU type (0b == passive, 1b == active)
305322851890Sopenharmony_ci+ * <6:5>   :: Vbus current handling capability (01b == 3A, 10b == 5A)
305422851890Sopenharmony_ci+ * <2:0>   :: USB highest speed
305522851890Sopenharmony_ci  */
305622851890Sopenharmony_ci+/* Cable VDO Version */
305722851890Sopenharmony_ci+#define CABLE_VDO_VER1_0	0
305822851890Sopenharmony_ci+#define CABLE_VDO_VER1_3	3
305922851890Sopenharmony_ci+
306022851890Sopenharmony_ci+/* Connector Type (_ATYPE and _BTYPE are for PD Rev2.0 only) */
306122851890Sopenharmony_ci #define CABLE_ATYPE		0
306222851890Sopenharmony_ci #define CABLE_BTYPE		1
306322851890Sopenharmony_ci #define CABLE_CTYPE		2
306422851890Sopenharmony_ci-#define CABLE_PLUG		0
306522851890Sopenharmony_ci-#define CABLE_RECEPTACLE	1
306622851890Sopenharmony_ci-#define CABLE_CURR_1A5		0
306722851890Sopenharmony_ci+#define CABLE_CAPTIVE		3
306822851890Sopenharmony_ci+
306922851890Sopenharmony_ci+/* Cable Latency */
307022851890Sopenharmony_ci+#define CABLE_LATENCY_1M	1
307122851890Sopenharmony_ci+#define CABLE_LATENCY_2M	2
307222851890Sopenharmony_ci+#define CABLE_LATENCY_3M	3
307322851890Sopenharmony_ci+#define CABLE_LATENCY_4M	4
307422851890Sopenharmony_ci+#define CABLE_LATENCY_5M	5
307522851890Sopenharmony_ci+#define CABLE_LATENCY_6M	6
307622851890Sopenharmony_ci+#define CABLE_LATENCY_7M	7
307722851890Sopenharmony_ci+#define CABLE_LATENCY_7M_PLUS	8
307822851890Sopenharmony_ci+
307922851890Sopenharmony_ci+/* Cable Termination Type */
308022851890Sopenharmony_ci+#define PCABLE_VCONN_NOT_REQ	0
308122851890Sopenharmony_ci+#define PCABLE_VCONN_REQ	1
308222851890Sopenharmony_ci+#define ACABLE_ONE_END		2
308322851890Sopenharmony_ci+#define ACABLE_BOTH_END		3
308422851890Sopenharmony_ci+
308522851890Sopenharmony_ci+/* Maximum Vbus Voltage */
308622851890Sopenharmony_ci+#define CABLE_MAX_VBUS_20V	0
308722851890Sopenharmony_ci+#define CABLE_MAX_VBUS_30V	1
308822851890Sopenharmony_ci+#define CABLE_MAX_VBUS_40V	2
308922851890Sopenharmony_ci+#define CABLE_MAX_VBUS_50V	3
309022851890Sopenharmony_ci+
309122851890Sopenharmony_ci+/* Active Cable SBU Supported/Type */
309222851890Sopenharmony_ci+#define ACABLE_SBU_SUPP		0
309322851890Sopenharmony_ci+#define ACABLE_SBU_NOT_SUPP	1
309422851890Sopenharmony_ci+#define ACABLE_SBU_PASSIVE	0
309522851890Sopenharmony_ci+#define ACABLE_SBU_ACTIVE	1
309622851890Sopenharmony_ci+
309722851890Sopenharmony_ci+/* Vbus Current Handling Capability */
309822851890Sopenharmony_ci+#define CABLE_CURR_DEF		0
309922851890Sopenharmony_ci #define CABLE_CURR_3A		1
310022851890Sopenharmony_ci #define CABLE_CURR_5A		2
310122851890Sopenharmony_ci+
310222851890Sopenharmony_ci+/* USB SuperSpeed Signaling Support (PD Rev2.0) */
310322851890Sopenharmony_ci #define CABLE_USBSS_U2_ONLY	0
310422851890Sopenharmony_ci #define CABLE_USBSS_U31_GEN1	1
310522851890Sopenharmony_ci #define CABLE_USBSS_U31_GEN2	2
310622851890Sopenharmony_ci-#define VDO_CABLE(hw, fw, cbl, gdr, lat, term, tx1d, tx2d, rx1d, rx2d, cur,\
310722851890Sopenharmony_ci-		  vps, sopp, usbss) \
310822851890Sopenharmony_ci-	(((hw) & 0x7) << 28 | ((fw) & 0x7) << 24 | ((cbl) & 0x3) << 18	\
310922851890Sopenharmony_ci-	 | (gdr) << 17 | ((lat) & 0x7) << 13 | ((term) & 0x3) << 11	\
311022851890Sopenharmony_ci-	 | (tx1d) << 10 | (tx2d) << 9 | (rx1d) << 8 | (rx2d) << 7	\
311122851890Sopenharmony_ci-	 | ((cur) & 0x3) << 5 | (vps) << 4 | (sopp) << 3		\
311222851890Sopenharmony_ci-	 | ((usbss) & 0x7))
311322851890Sopenharmony_ci+
311422851890Sopenharmony_ci+/* USB Highest Speed */
311522851890Sopenharmony_ci+#define CABLE_USB2_ONLY		0
311622851890Sopenharmony_ci+#define CABLE_USB32_GEN1	1
311722851890Sopenharmony_ci+#define CABLE_USB32_4_GEN2	2
311822851890Sopenharmony_ci+#define CABLE_USB4_GEN3		3
311922851890Sopenharmony_ci+
312022851890Sopenharmony_ci+#define VDO_CABLE(hw, fw, cbl, lat, term, tx1d, tx2d, rx1d, rx2d, cur, vps, sopp, usbss) \
312122851890Sopenharmony_ci+	(((hw) & 0x7) << 28 | ((fw) & 0x7) << 24 | ((cbl) & 0x3) << 18		\
312222851890Sopenharmony_ci+	 | ((lat) & 0x7) << 13 | ((term) & 0x3) << 11 | (tx1d) << 10		\
312322851890Sopenharmony_ci+	 | (tx2d) << 9 | (rx1d) << 8 | (rx2d) << 7 | ((cur) & 0x3) << 5		\
312422851890Sopenharmony_ci+	 | (vps) << 4 | (sopp) << 3 | ((usbss) & 0x7))
312522851890Sopenharmony_ci+#define VDO_PCABLE(hw, fw, ver, conn, lat, term, vbm, cur, spd)			\
312622851890Sopenharmony_ci+	(((hw) & 0xf) << 28 | ((fw) & 0xf) << 24 | ((ver) & 0x7) << 21		\
312722851890Sopenharmony_ci+	 | ((conn) & 0x3) << 18 | ((lat) & 0xf) << 13 | ((term) & 0x3) << 11	\
312822851890Sopenharmony_ci+	 | ((vbm) & 0x3) << 9 | ((cur) & 0x3) << 5 | ((spd) & 0x7))
312922851890Sopenharmony_ci+#define VDO_ACABLE1(hw, fw, ver, conn, lat, term, vbm, sbu, sbut, cur, vbt, sopp, spd) \
313022851890Sopenharmony_ci+	(((hw) & 0xf) << 28 | ((fw) & 0xf) << 24 | ((ver) & 0x7) << 21		\
313122851890Sopenharmony_ci+	 | ((conn) & 0x3) << 18	| ((lat) & 0xf) << 13 | ((term) & 0x3) << 11	\
313222851890Sopenharmony_ci+	 | ((vbm) & 0x3) << 9 | (sbu) << 8 | (sbut) << 7 | ((cur) & 0x3) << 5	\
313322851890Sopenharmony_ci+	 | (vbt) << 4 | (sopp) << 3 | ((spd) & 0x7))
313422851890Sopenharmony_ci+
313522851890Sopenharmony_ci+#define VDO_TYPEC_CABLE_TYPE(vdo)	(((vdo) >> 18) & 0x3)
313622851890Sopenharmony_ci+
313722851890Sopenharmony_ci+/*
313822851890Sopenharmony_ci+ * Active Cable VDO 2
313922851890Sopenharmony_ci+ * ---------
314022851890Sopenharmony_ci+ * <31:24> :: Maximum operating temperature
314122851890Sopenharmony_ci+ * <23:16> :: Shutdown temperature
314222851890Sopenharmony_ci+ * <15>    :: Reserved, Shall be set to zero
314322851890Sopenharmony_ci+ * <14:12> :: U3/CLd power
314422851890Sopenharmony_ci+ * <11>    :: U3 to U0 transition mode (0b == direct, 1b == through U3S)
314522851890Sopenharmony_ci+ * <10>    :: Physical connection (0b == copper, 1b == optical)
314622851890Sopenharmony_ci+ * <9>     :: Active element (0b == redriver, 1b == retimer)
314722851890Sopenharmony_ci+ * <8>     :: USB4 supported (0b == yes, 1b == no)
314822851890Sopenharmony_ci+ * <7:6>   :: USB2 hub hops consumed
314922851890Sopenharmony_ci+ * <5>     :: USB2 supported (0b == yes, 1b == no)
315022851890Sopenharmony_ci+ * <4>     :: USB3.2 supported (0b == yes, 1b == no)
315122851890Sopenharmony_ci+ * <3>     :: USB lanes supported (0b == one lane, 1b == two lanes)
315222851890Sopenharmony_ci+ * <2>     :: Optically isolated active cable (0b == no, 1b == yes)
315322851890Sopenharmony_ci+ * <1>     :: Reserved, Shall be set to zero
315422851890Sopenharmony_ci+ * <0>     :: USB gen (0b == gen1, 1b == gen2+)
315522851890Sopenharmony_ci+ */
315622851890Sopenharmony_ci+
315722851890Sopenharmony_ci+/* U3/CLd Power*/
315822851890Sopenharmony_ci+#define ACAB2_U3_CLD_10MW_PLUS	0
315922851890Sopenharmony_ci+#define ACAB2_U3_CLD_10MW	1
316022851890Sopenharmony_ci+#define ACAB2_U3_CLD_5MW	2
316122851890Sopenharmony_ci+#define ACAB2_U3_CLD_1MW	3
316222851890Sopenharmony_ci+#define ACAB2_U3_CLD_500UW	4
316322851890Sopenharmony_ci+#define ACAB2_U3_CLD_200UW	5
316422851890Sopenharmony_ci+#define ACAB2_U3_CLD_50UW	6
316522851890Sopenharmony_ci+
316622851890Sopenharmony_ci+/* Other Active Cable VDO 2 Fields */
316722851890Sopenharmony_ci+#define ACAB2_U3U0_DIRECT	0
316822851890Sopenharmony_ci+#define ACAB2_U3U0_U3S		1
316922851890Sopenharmony_ci+#define ACAB2_PHY_COPPER	0
317022851890Sopenharmony_ci+#define ACAB2_PHY_OPTICAL	1
317122851890Sopenharmony_ci+#define ACAB2_REDRIVER		0
317222851890Sopenharmony_ci+#define ACAB2_RETIMER		1
317322851890Sopenharmony_ci+#define ACAB2_USB4_SUPP		0
317422851890Sopenharmony_ci+#define ACAB2_USB4_NOT_SUPP	1
317522851890Sopenharmony_ci+#define ACAB2_USB2_SUPP		0
317622851890Sopenharmony_ci+#define ACAB2_USB2_NOT_SUPP	1
317722851890Sopenharmony_ci+#define ACAB2_USB32_SUPP	0
317822851890Sopenharmony_ci+#define ACAB2_USB32_NOT_SUPP	1
317922851890Sopenharmony_ci+#define ACAB2_LANES_ONE		0
318022851890Sopenharmony_ci+#define ACAB2_LANES_TWO		1
318122851890Sopenharmony_ci+#define ACAB2_OPT_ISO_NO	0
318222851890Sopenharmony_ci+#define ACAB2_OPT_ISO_YES	1
318322851890Sopenharmony_ci+#define ACAB2_GEN_1		0
318422851890Sopenharmony_ci+#define ACAB2_GEN_2_PLUS	1
318522851890Sopenharmony_ci+
318622851890Sopenharmony_ci+#define VDO_ACABLE2(mtemp, stemp, u3p, trans, phy, ele, u4, hops, u2, u32, lane, iso, gen)	\
318722851890Sopenharmony_ci+	(((mtemp) & 0xff) << 24 | ((stemp) & 0xff) << 16 | ((u3p) & 0x7) << 12	\
318822851890Sopenharmony_ci+	 | (trans) << 11 | (phy) << 10 | (ele) << 9 | (u4) << 8			\
318922851890Sopenharmony_ci+	 | ((hops) & 0x3) << 6 | (u2) << 5 | (u32) << 4 | (lane) << 3		\
319022851890Sopenharmony_ci+	 | (iso) << 2 | (gen))
319122851890Sopenharmony_ci 
319222851890Sopenharmony_ci /*
319322851890Sopenharmony_ci- * AMA VDO
319422851890Sopenharmony_ci+ * AMA VDO (PD Rev2.0)
319522851890Sopenharmony_ci  * ---------
319622851890Sopenharmony_ci  * <31:28> :: Cable HW version
319722851890Sopenharmony_ci  * <27:24> :: Cable FW version
319822851890Sopenharmony_ci@@ -233,18 +455,40 @@
319922851890Sopenharmony_ci #define PD_VDO_AMA_VCONN_REQ(vdo)	(((vdo) >> 4) & 1)
320022851890Sopenharmony_ci #define PD_VDO_AMA_VBUS_REQ(vdo)	(((vdo) >> 3) & 1)
320122851890Sopenharmony_ci 
320222851890Sopenharmony_ci-#define AMA_VCONN_PWR_1W	0
320322851890Sopenharmony_ci-#define AMA_VCONN_PWR_1W5	1
320422851890Sopenharmony_ci-#define AMA_VCONN_PWR_2W	2
320522851890Sopenharmony_ci-#define AMA_VCONN_PWR_3W	3
320622851890Sopenharmony_ci-#define AMA_VCONN_PWR_4W	4
320722851890Sopenharmony_ci-#define AMA_VCONN_PWR_5W	5
320822851890Sopenharmony_ci-#define AMA_VCONN_PWR_6W	6
320922851890Sopenharmony_ci #define AMA_USBSS_U2_ONLY	0
321022851890Sopenharmony_ci #define AMA_USBSS_U31_GEN1	1
321122851890Sopenharmony_ci #define AMA_USBSS_U31_GEN2	2
321222851890Sopenharmony_ci #define AMA_USBSS_BBONLY	3
321322851890Sopenharmony_ci 
321422851890Sopenharmony_ci+/*
321522851890Sopenharmony_ci+ * VPD VDO
321622851890Sopenharmony_ci+ * ---------
321722851890Sopenharmony_ci+ * <31:28> :: HW version
321822851890Sopenharmony_ci+ * <27:24> :: FW version
321922851890Sopenharmony_ci+ * <23:21> :: VDO version
322022851890Sopenharmony_ci+ * <20:17> :: Reserved, Shall be set to zero
322122851890Sopenharmony_ci+ * <16:15> :: Maximum Vbus voltage (00b == 20V, 01b == 30V, 10b == 40V, 11b == 50V)
322222851890Sopenharmony_ci+ * <14>    :: Charge through current support (0b == 3A, 1b == 5A)
322322851890Sopenharmony_ci+ * <13>    :: Reserved, Shall be set to zero
322422851890Sopenharmony_ci+ * <12:7>  :: Vbus impedance
322522851890Sopenharmony_ci+ * <6:1>   :: Ground impedance
322622851890Sopenharmony_ci+ * <0>     :: Charge through support (0b == no, 1b == yes)
322722851890Sopenharmony_ci+ */
322822851890Sopenharmony_ci+#define VPD_VDO_VER1_0		0
322922851890Sopenharmony_ci+#define VPD_MAX_VBUS_20V	0
323022851890Sopenharmony_ci+#define VPD_MAX_VBUS_30V	1
323122851890Sopenharmony_ci+#define VPD_MAX_VBUS_40V	2
323222851890Sopenharmony_ci+#define VPD_MAX_VBUS_50V	3
323322851890Sopenharmony_ci+#define VPDCT_CURR_3A		0
323422851890Sopenharmony_ci+#define VPDCT_CURR_5A		1
323522851890Sopenharmony_ci+#define VPDCT_NOT_SUPP		0
323622851890Sopenharmony_ci+#define VPDCT_SUPP		1
323722851890Sopenharmony_ci+
323822851890Sopenharmony_ci+#define VDO_VPD(hw, fw, ver, vbm, curr, vbi, gi, ct)			\
323922851890Sopenharmony_ci+	(((hw) & 0xf) << 28 | ((fw) & 0xf) << 24 | ((ver) & 0x7) << 21	\
324022851890Sopenharmony_ci+	 | ((vbm) & 0x3) << 15 | (curr) << 14 | ((vbi) & 0x3f) << 7	\
324122851890Sopenharmony_ci+	 | ((gi) & 0x3f) << 1 | (ct))
324222851890Sopenharmony_ci+
324322851890Sopenharmony_ci /*
324422851890Sopenharmony_ci  * SVDM Discover SVIDs request -> response
324522851890Sopenharmony_ci  *
324622851890Sopenharmony_cidiff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
324722851890Sopenharmony_ciindex 5e4c497f5..6567f7445 100644
324822851890Sopenharmony_ci--- a/include/linux/usb/quirks.h
324922851890Sopenharmony_ci+++ b/include/linux/usb/quirks.h
325022851890Sopenharmony_ci@@ -72,4 +72,7 @@
325122851890Sopenharmony_ci /* device has endpoints that should be ignored */
325222851890Sopenharmony_ci #define USB_QUIRK_ENDPOINT_IGNORE		BIT(15)
325322851890Sopenharmony_ci 
325422851890Sopenharmony_ci+/* device can't support auto suspend function */
325522851890Sopenharmony_ci+#define USB_QUIRK_AUTO_SUSPEND			BIT(16)
325622851890Sopenharmony_ci+
325722851890Sopenharmony_ci #endif /* __LINUX_USB_QUIRKS_H */
325822851890Sopenharmony_cidiff --git a/include/linux/usb/tcpm.h b/include/linux/usb/tcpm.h
325922851890Sopenharmony_ciindex 09762d26f..cb69546f8 100644
326022851890Sopenharmony_ci--- a/include/linux/usb/tcpm.h
326122851890Sopenharmony_ci+++ b/include/linux/usb/tcpm.h
326222851890Sopenharmony_ci@@ -19,6 +19,10 @@ enum typec_cc_status {
326322851890Sopenharmony_ci 	TYPEC_CC_RP_3_0,
326422851890Sopenharmony_ci };
326522851890Sopenharmony_ci 
326622851890Sopenharmony_ci+/* Collision Avoidance */
326722851890Sopenharmony_ci+#define SINK_TX_NG	TYPEC_CC_RP_1_5
326822851890Sopenharmony_ci+#define SINK_TX_OK	TYPEC_CC_RP_3_0
326922851890Sopenharmony_ci+
327022851890Sopenharmony_ci enum typec_cc_polarity {
327122851890Sopenharmony_ci 	TYPEC_POLARITY_CC1,
327222851890Sopenharmony_ci 	TYPEC_POLARITY_CC2,
327322851890Sopenharmony_ci@@ -62,6 +66,8 @@ enum tcpm_transmit_type {
327422851890Sopenharmony_ci  *		For example, some tcpcs may include BC1.2 charger detection
327522851890Sopenharmony_ci  *		and use that in this case.
327622851890Sopenharmony_ci  * @set_cc:	Called to set value of CC pins
327722851890Sopenharmony_ci+ * @apply_rc:	Optional; Needed to move TCPCI based chipset to APPLY_RC state
327822851890Sopenharmony_ci+ *		as stated by the TCPCI specification.
327922851890Sopenharmony_ci  * @get_cc:	Called to read current CC pin values
328022851890Sopenharmony_ci  * @set_polarity:
328122851890Sopenharmony_ci  *		Called to set polarity
328222851890Sopenharmony_ci@@ -83,6 +89,39 @@ enum tcpm_transmit_type {
328322851890Sopenharmony_ci  *		Optional; Called to enable/disable PD 3.0 fast role swap.
328422851890Sopenharmony_ci  *		Enabling frs is accessory dependent as not all PD3.0
328522851890Sopenharmony_ci  *		accessories support fast role swap.
328622851890Sopenharmony_ci+ * @frs_sourcing_vbus:
328722851890Sopenharmony_ci+ *		Optional; Called to notify that vbus is now being sourced.
328822851890Sopenharmony_ci+ *		Low level drivers can perform chip specific operations, if any.
328922851890Sopenharmony_ci+ * @enable_auto_vbus_discharge:
329022851890Sopenharmony_ci+ *		Optional; TCPCI spec based TCPC implementations can optionally
329122851890Sopenharmony_ci+ *		support hardware to autonomously dischrge vbus upon disconnecting
329222851890Sopenharmony_ci+ *		as sink or source. TCPM signals TCPC to enable the mechanism upon
329322851890Sopenharmony_ci+ *		entering connected state and signals disabling upon disconnect.
329422851890Sopenharmony_ci+ * @set_auto_vbus_discharge_threshold:
329522851890Sopenharmony_ci+ *		Mandatory when enable_auto_vbus_discharge is implemented. TCPM
329622851890Sopenharmony_ci+ *		calls this function to allow lower levels drivers to program the
329722851890Sopenharmony_ci+ *		vbus threshold voltage below which the vbus discharge circuit
329822851890Sopenharmony_ci+ *		will be turned on. requested_vbus_voltage is set to 0 when vbus
329922851890Sopenharmony_ci+ *		is going to disappear knowingly i.e. during PR_SWAP and
330022851890Sopenharmony_ci+ *		HARD_RESET etc.
330122851890Sopenharmony_ci+ * @is_vbus_vsafe0v:
330222851890Sopenharmony_ci+ *		Optional; TCPCI spec based TCPC implementations are expected to
330322851890Sopenharmony_ci+ *		detect VSAFE0V voltage level at vbus. When detection of VSAFE0V
330422851890Sopenharmony_ci+ *		is supported by TCPC, set this callback for TCPM to query
330522851890Sopenharmony_ci+ *		whether vbus is at VSAFE0V when needed.
330622851890Sopenharmony_ci+ *		Returns true when vbus is at VSAFE0V, false otherwise.
330722851890Sopenharmony_ci+ * @set_partner_usb_comm_capable:
330822851890Sopenharmony_ci+ *              Optional; The USB Communications Capable bit indicates if port
330922851890Sopenharmony_ci+ *              partner is capable of communication over the USB data lines
331022851890Sopenharmony_ci+ *              (e.g. D+/- or SS Tx/Rx). Called to notify the status of the bit.
331122851890Sopenharmony_ci+ * @check_contaminant:
331222851890Sopenharmony_ci+ *		Optional; The callback is called when CC pins report open status
331322851890Sopenharmony_ci+ *		at the end of the toggling period. Chip level drivers are
331422851890Sopenharmony_ci+ *		expected to check for contaminant and re-enable toggling if
331522851890Sopenharmony_ci+ *		needed. When 0 is not returned, check_contaminant is expected to
331622851890Sopenharmony_ci+ *		restart toggling after checking the connector for contaminant.
331722851890Sopenharmony_ci+ *		This forces the TCPM state machine to tranistion to TOGGLING state
331822851890Sopenharmony_ci+ *		without calling start_toggling callback.
331922851890Sopenharmony_ci  */
332022851890Sopenharmony_ci struct tcpc_dev {
332122851890Sopenharmony_ci 	struct fwnode_handle *fwnode;
332222851890Sopenharmony_ci@@ -91,6 +130,8 @@ struct tcpc_dev {
332322851890Sopenharmony_ci 	int (*get_vbus)(struct tcpc_dev *dev);
332422851890Sopenharmony_ci 	int (*get_current_limit)(struct tcpc_dev *dev);
332522851890Sopenharmony_ci 	int (*set_cc)(struct tcpc_dev *dev, enum typec_cc_status cc);
332622851890Sopenharmony_ci+	int (*apply_rc)(struct tcpc_dev *dev, enum typec_cc_status cc,
332722851890Sopenharmony_ci+			enum typec_cc_polarity polarity);
332822851890Sopenharmony_ci 	int (*get_cc)(struct tcpc_dev *dev, enum typec_cc_status *cc1,
332922851890Sopenharmony_ci 		      enum typec_cc_status *cc2);
333022851890Sopenharmony_ci 	int (*set_polarity)(struct tcpc_dev *dev,
333122851890Sopenharmony_ci@@ -106,9 +147,16 @@ struct tcpc_dev {
333222851890Sopenharmony_ci 			      enum typec_cc_status cc);
333322851890Sopenharmony_ci 	int (*try_role)(struct tcpc_dev *dev, int role);
333422851890Sopenharmony_ci 	int (*pd_transmit)(struct tcpc_dev *dev, enum tcpm_transmit_type type,
333522851890Sopenharmony_ci-			   const struct pd_message *msg);
333622851890Sopenharmony_ci+			   const struct pd_message *msg, unsigned int negotiated_rev);
333722851890Sopenharmony_ci 	int (*set_bist_data)(struct tcpc_dev *dev, bool on);
333822851890Sopenharmony_ci 	int (*enable_frs)(struct tcpc_dev *dev, bool enable);
333922851890Sopenharmony_ci+	void (*frs_sourcing_vbus)(struct tcpc_dev *dev);
334022851890Sopenharmony_ci+	int (*enable_auto_vbus_discharge)(struct tcpc_dev *dev, bool enable);
334122851890Sopenharmony_ci+	int (*set_auto_vbus_discharge_threshold)(struct tcpc_dev *dev, enum typec_pwr_opmode mode,
334222851890Sopenharmony_ci+						 bool pps_active, u32 requested_vbus_voltage);
334322851890Sopenharmony_ci+	int (*check_contaminant)(struct tcpc_dev *dev);
334422851890Sopenharmony_ci+	bool (*is_vbus_vsafe0v)(struct tcpc_dev *dev);
334522851890Sopenharmony_ci+	void (*set_partner_usb_comm_capable)(struct tcpc_dev *dev, bool enable);
334622851890Sopenharmony_ci };
334722851890Sopenharmony_ci 
334822851890Sopenharmony_ci struct tcpm_port;
334922851890Sopenharmony_ci@@ -116,6 +164,10 @@ struct tcpm_port;
335022851890Sopenharmony_ci struct tcpm_port *tcpm_register_port(struct device *dev, struct tcpc_dev *tcpc);
335122851890Sopenharmony_ci void tcpm_unregister_port(struct tcpm_port *port);
335222851890Sopenharmony_ci 
335322851890Sopenharmony_ci+int tcpm_update_sink_capabilities(struct tcpm_port *port, const u32 *pdo,
335422851890Sopenharmony_ci+				  unsigned int nr_pdo,
335522851890Sopenharmony_ci+				  unsigned int operating_snk_mw);
335622851890Sopenharmony_ci+
335722851890Sopenharmony_ci void tcpm_vbus_change(struct tcpm_port *port);
335822851890Sopenharmony_ci void tcpm_cc_change(struct tcpm_port *port);
335922851890Sopenharmony_ci void tcpm_sink_frs(struct tcpm_port *port);
336022851890Sopenharmony_ci@@ -126,5 +178,7 @@ void tcpm_pd_transmit_complete(struct tcpm_port *port,
336122851890Sopenharmony_ci 			       enum tcpm_transmit_status status);
336222851890Sopenharmony_ci void tcpm_pd_hard_reset(struct tcpm_port *port);
336322851890Sopenharmony_ci void tcpm_tcpc_reset(struct tcpm_port *port);
336422851890Sopenharmony_ci+bool tcpm_is_debouncing(struct tcpm_port *tcpm);
336522851890Sopenharmony_ci+bool tcpm_is_toggling(struct tcpm_port *port);
336622851890Sopenharmony_ci 
336722851890Sopenharmony_ci #endif /* __LINUX_USB_TCPM_H */
336822851890Sopenharmony_cidiff --git a/include/linux/usb/typec.h b/include/linux/usb/typec.h
336922851890Sopenharmony_ciindex 6be558045..91b4303ca 100644
337022851890Sopenharmony_ci--- a/include/linux/usb/typec.h
337122851890Sopenharmony_ci+++ b/include/linux/usb/typec.h
337222851890Sopenharmony_ci@@ -126,9 +126,12 @@ struct typec_altmode_desc {
337322851890Sopenharmony_ci 	enum typec_port_data	roles;
337422851890Sopenharmony_ci };
337522851890Sopenharmony_ci 
337622851890Sopenharmony_ci+void typec_partner_set_pd_revision(struct typec_partner *partner, u16 pd_revision);
337722851890Sopenharmony_ci+int typec_partner_set_num_altmodes(struct typec_partner *partner, int num_altmodes);
337822851890Sopenharmony_ci struct typec_altmode
337922851890Sopenharmony_ci *typec_partner_register_altmode(struct typec_partner *partner,
338022851890Sopenharmony_ci 				const struct typec_altmode_desc *desc);
338122851890Sopenharmony_ci+int typec_plug_set_num_altmodes(struct typec_plug *plug, int num_altmodes);
338222851890Sopenharmony_ci struct typec_altmode
338322851890Sopenharmony_ci *typec_plug_register_altmode(struct typec_plug *plug,
338422851890Sopenharmony_ci 			     const struct typec_altmode_desc *desc);
338522851890Sopenharmony_ci@@ -162,6 +165,7 @@ struct typec_plug_desc {
338622851890Sopenharmony_ci  * @type: The plug type from USB PD Cable VDO
338722851890Sopenharmony_ci  * @active: Is the cable active or passive
338822851890Sopenharmony_ci  * @identity: Result of Discover Identity command
338922851890Sopenharmony_ci+ * @pd_revision: USB Power Delivery Specification revision if supported
339022851890Sopenharmony_ci  *
339122851890Sopenharmony_ci  * Represents USB Type-C Cable attached to USB Type-C port.
339222851890Sopenharmony_ci  */
339322851890Sopenharmony_ci@@ -169,6 +173,8 @@ struct typec_cable_desc {
339422851890Sopenharmony_ci 	enum typec_plug_type	type;
339522851890Sopenharmony_ci 	unsigned int		active:1;
339622851890Sopenharmony_ci 	struct usb_pd_identity	*identity;
339722851890Sopenharmony_ci+	u16			pd_revision; /* 0300H = "3.0" */
339822851890Sopenharmony_ci+
339922851890Sopenharmony_ci };
340022851890Sopenharmony_ci 
340122851890Sopenharmony_ci /*
340222851890Sopenharmony_ci@@ -176,15 +182,22 @@ struct typec_cable_desc {
340322851890Sopenharmony_ci  * @usb_pd: USB Power Delivery support
340422851890Sopenharmony_ci  * @accessory: Audio, Debug or none.
340522851890Sopenharmony_ci  * @identity: Discover Identity command data
340622851890Sopenharmony_ci+ * @pd_revision: USB Power Delivery Specification Revision if supported
340722851890Sopenharmony_ci  *
340822851890Sopenharmony_ci  * Details about a partner that is attached to USB Type-C port. If @identity
340922851890Sopenharmony_ci  * member exists when partner is registered, a directory named "identity" is
341022851890Sopenharmony_ci  * created to sysfs for the partner device.
341122851890Sopenharmony_ci+ *
341222851890Sopenharmony_ci+ * @pd_revision is based on the setting of the "Specification Revision" field
341322851890Sopenharmony_ci+ * in the message header on the initial "Source Capabilities" message received
341422851890Sopenharmony_ci+ * from the partner, or a "Request" message received from the partner, depending
341522851890Sopenharmony_ci+ * on whether our port is a Sink or a Source.
341622851890Sopenharmony_ci  */
341722851890Sopenharmony_ci struct typec_partner_desc {
341822851890Sopenharmony_ci 	unsigned int		usb_pd:1;
341922851890Sopenharmony_ci 	enum typec_accessory	accessory;
342022851890Sopenharmony_ci 	struct usb_pd_identity	*identity;
342122851890Sopenharmony_ci+	u16			pd_revision; /* 0300H = "3.0" */
342222851890Sopenharmony_ci };
342322851890Sopenharmony_ci 
342422851890Sopenharmony_ci /**
342522851890Sopenharmony_ci@@ -204,12 +217,19 @@ struct typec_operations {
342622851890Sopenharmony_ci 			     enum typec_port_type type);
342722851890Sopenharmony_ci };
342822851890Sopenharmony_ci 
342922851890Sopenharmony_ci+enum usb_pd_svdm_ver {
343022851890Sopenharmony_ci+	SVDM_VER_1_0 = 0,
343122851890Sopenharmony_ci+	SVDM_VER_2_0 = 1,
343222851890Sopenharmony_ci+	SVDM_VER_MAX = SVDM_VER_2_0,
343322851890Sopenharmony_ci+};
343422851890Sopenharmony_ci+
343522851890Sopenharmony_ci /*
343622851890Sopenharmony_ci  * struct typec_capability - USB Type-C Port Capabilities
343722851890Sopenharmony_ci  * @type: Supported power role of the port
343822851890Sopenharmony_ci  * @data: Supported data role of the port
343922851890Sopenharmony_ci  * @revision: USB Type-C Specification release. Binary coded decimal
344022851890Sopenharmony_ci  * @pd_revision: USB Power Delivery Specification revision if supported
344122851890Sopenharmony_ci+ * @svdm_version: USB PD Structured VDM version if supported
344222851890Sopenharmony_ci  * @prefer_role: Initial role preference (DRP ports).
344322851890Sopenharmony_ci  * @accessory: Supported Accessory Modes
344422851890Sopenharmony_ci  * @fwnode: Optional fwnode of the port
344522851890Sopenharmony_ci@@ -223,6 +243,7 @@ struct typec_capability {
344622851890Sopenharmony_ci 	enum typec_port_data	data;
344722851890Sopenharmony_ci 	u16			revision; /* 0120H = "1.2" */
344822851890Sopenharmony_ci 	u16			pd_revision; /* 0300H = "3.0" */
344922851890Sopenharmony_ci+	enum usb_pd_svdm_ver	svdm_version;
345022851890Sopenharmony_ci 	int			prefer_role;
345122851890Sopenharmony_ci 	enum typec_accessory	accessory[TYPEC_MAX_ACCESSORY];
345222851890Sopenharmony_ci 	unsigned int		orientation_aware:1;
345322851890Sopenharmony_ci@@ -273,4 +294,8 @@ int typec_find_orientation(const char *name);
345422851890Sopenharmony_ci int typec_find_port_power_role(const char *name);
345522851890Sopenharmony_ci int typec_find_power_role(const char *name);
345622851890Sopenharmony_ci int typec_find_port_data_role(const char *name);
345722851890Sopenharmony_ci+
345822851890Sopenharmony_ci+void typec_partner_set_svdm_version(struct typec_partner *partner,
345922851890Sopenharmony_ci+				    enum usb_pd_svdm_ver svdm_version);
346022851890Sopenharmony_ci+int typec_get_negotiated_svdm_version(struct typec_port *port);
346122851890Sopenharmony_ci #endif /* __LINUX_USB_TYPEC_H */
346222851890Sopenharmony_cidiff --git a/include/linux/usb/typec_altmode.h b/include/linux/usb/typec_altmode.h
346322851890Sopenharmony_ciindex 5e0a7b764..65933cbe9 100644
346422851890Sopenharmony_ci--- a/include/linux/usb/typec_altmode.h
346522851890Sopenharmony_ci+++ b/include/linux/usb/typec_altmode.h
346622851890Sopenharmony_ci@@ -132,6 +132,16 @@ typec_altmode_get_orientation(struct typec_altmode *altmode)
346722851890Sopenharmony_ci 	return typec_get_orientation(typec_altmode2port(altmode));
346822851890Sopenharmony_ci }
346922851890Sopenharmony_ci 
347022851890Sopenharmony_ci+/**
347122851890Sopenharmony_ci+ * typec_altmode_get_svdm_version - Get negotiated SVDM version
347222851890Sopenharmony_ci+ * @altmode: Handle to the alternate mode
347322851890Sopenharmony_ci+ */
347422851890Sopenharmony_ci+static inline int
347522851890Sopenharmony_ci+typec_altmode_get_svdm_version(struct typec_altmode *altmode)
347622851890Sopenharmony_ci+{
347722851890Sopenharmony_ci+	return typec_get_negotiated_svdm_version(typec_altmode2port(altmode));
347822851890Sopenharmony_ci+}
347922851890Sopenharmony_ci+
348022851890Sopenharmony_ci /**
348122851890Sopenharmony_ci  * struct typec_altmode_driver - USB Type-C alternate mode device driver
348222851890Sopenharmony_ci  * @id_table: Null terminated array of SVIDs
348322851890Sopenharmony_cidiff --git a/include/linux/usb/typec_tbt.h b/include/linux/usb/typec_tbt.h
348422851890Sopenharmony_ciindex 47c2d501d..63dd44b72 100644
348522851890Sopenharmony_ci--- a/include/linux/usb/typec_tbt.h
348622851890Sopenharmony_ci+++ b/include/linux/usb/typec_tbt.h
348722851890Sopenharmony_ci@@ -39,12 +39,16 @@ struct typec_thunderbolt_data {
348822851890Sopenharmony_ci #define   TBT_CABLE_USB3_GEN1		1
348922851890Sopenharmony_ci #define   TBT_CABLE_USB3_PASSIVE	2
349022851890Sopenharmony_ci #define   TBT_CABLE_10_AND_20GBPS	3
349122851890Sopenharmony_ci-#define TBT_CABLE_ROUNDED		BIT(19)
349222851890Sopenharmony_ci+#define TBT_CABLE_ROUNDED_SUPPORT(_vdo_) \
349322851890Sopenharmony_ci+					(((_vdo_) & GENMASK(20, 19)) >> 19)
349422851890Sopenharmony_ci+#define   TBT_GEN3_NON_ROUNDED                 0
349522851890Sopenharmony_ci+#define   TBT_GEN3_GEN4_ROUNDED_NON_ROUNDED    1
349622851890Sopenharmony_ci #define TBT_CABLE_OPTICAL		BIT(21)
349722851890Sopenharmony_ci #define TBT_CABLE_RETIMER		BIT(22)
349822851890Sopenharmony_ci #define TBT_CABLE_LINK_TRAINING		BIT(23)
349922851890Sopenharmony_ci 
350022851890Sopenharmony_ci #define TBT_SET_CABLE_SPEED(_s_)	(((_s_) & GENMASK(2, 0)) << 16)
350122851890Sopenharmony_ci+#define TBT_SET_CABLE_ROUNDED(_g_)	(((_g_) & GENMASK(1, 0)) << 19)
350222851890Sopenharmony_ci 
350322851890Sopenharmony_ci /* TBT3 Device Enter Mode VDO bits */
350422851890Sopenharmony_ci #define TBT_ENTER_MODE_CABLE_SPEED(s)	TBT_SET_CABLE_SPEED(s)
350522851890Sopenharmony_cidiff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
350622851890Sopenharmony_ciindex 8110c29fa..2e4f7721f 100644
350722851890Sopenharmony_ci--- a/include/linux/usb/usbnet.h
350822851890Sopenharmony_ci+++ b/include/linux/usb/usbnet.h
350922851890Sopenharmony_ci@@ -83,8 +83,6 @@ struct usbnet {
351022851890Sopenharmony_ci #		define EVENT_LINK_CHANGE	11
351122851890Sopenharmony_ci #		define EVENT_SET_RX_MODE	12
351222851890Sopenharmony_ci #		define EVENT_NO_IP_ALIGN	13
351322851890Sopenharmony_ci-	u32			rx_speed;	/* in bps - NOT Mbps */
351422851890Sopenharmony_ci-	u32			tx_speed;	/* in bps - NOT Mbps */
351522851890Sopenharmony_ci };
351622851890Sopenharmony_ci 
351722851890Sopenharmony_ci static inline struct usb_driver *driver_of(struct usb_interface *intf)
351822851890Sopenharmony_cidiff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h
351922851890Sopenharmony_ciindex 92cd9f038..03b43b0f7 100644
352022851890Sopenharmony_ci--- a/include/media/v4l2-async.h
352122851890Sopenharmony_ci+++ b/include/media/v4l2-async.h
352222851890Sopenharmony_ci@@ -266,6 +266,21 @@ int v4l2_async_notifier_register(struct v4l2_device *v4l2_dev,
352322851890Sopenharmony_ci int v4l2_async_subdev_notifier_register(struct v4l2_subdev *sd,
352422851890Sopenharmony_ci 					struct v4l2_async_notifier *notifier);
352522851890Sopenharmony_ci 
352622851890Sopenharmony_ci+/**
352722851890Sopenharmony_ci+ * v4l2_async_notifier_clr_unready_dev - remove unready subdevice
352822851890Sopenharmony_ci+ *
352922851890Sopenharmony_ci+ * @notifier: pointer to &struct v4l2_async_notifier
353022851890Sopenharmony_ci+ */
353122851890Sopenharmony_ci+#if IS_ENABLED(CONFIG_NO_GKI)
353222851890Sopenharmony_ci+int v4l2_async_notifier_clr_unready_dev(struct v4l2_async_notifier *notifier);
353322851890Sopenharmony_ci+#else
353422851890Sopenharmony_ci+static inline int
353522851890Sopenharmony_ci+v4l2_async_notifier_clr_unready_dev(struct v4l2_async_notifier *notifier)
353622851890Sopenharmony_ci+{
353722851890Sopenharmony_ci+	return 0;
353822851890Sopenharmony_ci+}
353922851890Sopenharmony_ci+#endif
354022851890Sopenharmony_ci+
354122851890Sopenharmony_ci /**
354222851890Sopenharmony_ci  * v4l2_async_notifier_unregister - unregisters a subdevice
354322851890Sopenharmony_ci  *	asynchronous notifier
354422851890Sopenharmony_cidiff --git a/include/soc/rockchip/rockchip_sip.h b/include/soc/rockchip/rockchip_sip.h
354522851890Sopenharmony_ciindex c46a9ae2a..4afba01c6 100644
354622851890Sopenharmony_ci--- a/include/soc/rockchip/rockchip_sip.h
354722851890Sopenharmony_ci+++ b/include/soc/rockchip/rockchip_sip.h
354822851890Sopenharmony_ci@@ -15,6 +15,12 @@
354922851890Sopenharmony_ci #define ROCKCHIP_SIP_CONFIG_DRAM_GET_RATE	0x05
355022851890Sopenharmony_ci #define ROCKCHIP_SIP_CONFIG_DRAM_CLR_IRQ	0x06
355122851890Sopenharmony_ci #define ROCKCHIP_SIP_CONFIG_DRAM_SET_PARAM	0x07
355222851890Sopenharmony_ci-#define ROCKCHIP_SIP_CONFIG_DRAM_SET_ODT_PD	0x08
355322851890Sopenharmony_ci+#define ROCKCHIP_SIP_CONFIG_DRAM_GET_VERSION	0x08
355422851890Sopenharmony_ci+#define ROCKCHIP_SIP_CONFIG_DRAM_POST_SET_RATE	0x09
355522851890Sopenharmony_ci+#define ROCKCHIP_SIP_CONFIG_DRAM_SET_MSCH_RL	0x0a
355622851890Sopenharmony_ci+#define ROCKCHIP_SIP_CONFIG_DRAM_DEBUG		0x0b
355722851890Sopenharmony_ci+#define ROCKCHIP_SIP_CONFIG_MCU_START		0x0c
355822851890Sopenharmony_ci+#define ROCKCHIP_SIP_CONFIG_DRAM_GET_FREQ_INFO	0x0e
355922851890Sopenharmony_ci+#define ROCKCHIP_SIP_CONFIG_DRAM_ADDRMAP_GET	0x10
356022851890Sopenharmony_ci 
356122851890Sopenharmony_ci #endif
356222851890Sopenharmony_cidiff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h
356322851890Sopenharmony_ciindex b55970859..4fc733c8c 100644
356422851890Sopenharmony_ci--- a/include/sound/hdmi-codec.h
356522851890Sopenharmony_ci+++ b/include/sound/hdmi-codec.h
356622851890Sopenharmony_ci@@ -34,6 +34,11 @@ struct hdmi_codec_daifmt {
356722851890Sopenharmony_ci 	unsigned int frame_clk_inv:1;
356822851890Sopenharmony_ci 	unsigned int bit_clk_master:1;
356922851890Sopenharmony_ci 	unsigned int frame_clk_master:1;
357022851890Sopenharmony_ci+	/* bit_fmt could be standard PCM format or
357122851890Sopenharmony_ci+	 * IEC958 encoded format. ALSA IEC958 plugin will pass
357222851890Sopenharmony_ci+	 * IEC958_SUBFRAME format to the underneath driver.
357322851890Sopenharmony_ci+	 */
357422851890Sopenharmony_ci+	snd_pcm_format_t bit_fmt;
357522851890Sopenharmony_ci };
357622851890Sopenharmony_ci 
357722851890Sopenharmony_ci /*
357822851890Sopenharmony_ci@@ -60,12 +65,22 @@ struct hdmi_codec_ops {
357922851890Sopenharmony_ci 
358022851890Sopenharmony_ci 	/*
358122851890Sopenharmony_ci 	 * Configures HDMI-encoder for audio stream.
358222851890Sopenharmony_ci-	 * Mandatory
358322851890Sopenharmony_ci+	 * Having either prepare or hw_params is mandatory.
358422851890Sopenharmony_ci 	 */
358522851890Sopenharmony_ci 	int (*hw_params)(struct device *dev, void *data,
358622851890Sopenharmony_ci 			 struct hdmi_codec_daifmt *fmt,
358722851890Sopenharmony_ci 			 struct hdmi_codec_params *hparms);
358822851890Sopenharmony_ci 
358922851890Sopenharmony_ci+	/*
359022851890Sopenharmony_ci+	 * Configures HDMI-encoder for audio stream. Can be called
359122851890Sopenharmony_ci+	 * multiple times for each setup.
359222851890Sopenharmony_ci+	 *
359322851890Sopenharmony_ci+	 * Having either prepare or hw_params is mandatory.
359422851890Sopenharmony_ci+	 */
359522851890Sopenharmony_ci+	int (*prepare)(struct device *dev, void *data,
359622851890Sopenharmony_ci+		       struct hdmi_codec_daifmt *fmt,
359722851890Sopenharmony_ci+		       struct hdmi_codec_params *hparms);
359822851890Sopenharmony_ci+
359922851890Sopenharmony_ci 	/*
360022851890Sopenharmony_ci 	 * Shuts down the audio stream.
360122851890Sopenharmony_ci 	 * Mandatory
360222851890Sopenharmony_cidiff --git a/include/trace/events/cpuhp.h b/include/trace/events/cpuhp.h
360322851890Sopenharmony_ciindex ad16f7731..f302ab6db 100644
360422851890Sopenharmony_ci--- a/include/trace/events/cpuhp.h
360522851890Sopenharmony_ci+++ b/include/trace/events/cpuhp.h
360622851890Sopenharmony_ci@@ -89,6 +89,28 @@ TRACE_EVENT(cpuhp_exit,
360722851890Sopenharmony_ci 		  __entry->cpu, __entry->state, __entry->idx,  __entry->ret)
360822851890Sopenharmony_ci );
360922851890Sopenharmony_ci 
361022851890Sopenharmony_ci+TRACE_EVENT(cpuhp_pause,
361122851890Sopenharmony_ci+	TP_PROTO(struct cpumask *cpus, u64 start_time, unsigned char pause),
361222851890Sopenharmony_ci+
361322851890Sopenharmony_ci+	TP_ARGS(cpus, start_time, pause),
361422851890Sopenharmony_ci+
361522851890Sopenharmony_ci+	TP_STRUCT__entry(
361622851890Sopenharmony_ci+		__field( unsigned int,	cpus		)
361722851890Sopenharmony_ci+		__field( unsigned int,	active_cpus	)
361822851890Sopenharmony_ci+		__field( unsigned int,	time		)
361922851890Sopenharmony_ci+		__field( unsigned char,	pause		)
362022851890Sopenharmony_ci+	),
362122851890Sopenharmony_ci+
362222851890Sopenharmony_ci+	TP_fast_assign(
362322851890Sopenharmony_ci+		__entry->cpus	     = cpumask_bits(cpus)[0];
362422851890Sopenharmony_ci+		__entry->active_cpus = cpumask_bits(cpu_active_mask)[0];
362522851890Sopenharmony_ci+		__entry->time        = div64_u64(sched_clock() - start_time, 1000);
362622851890Sopenharmony_ci+		__entry->pause	     = pause;
362722851890Sopenharmony_ci+	),
362822851890Sopenharmony_ci+
362922851890Sopenharmony_ci+	TP_printk("req_cpus=0x%x act_cpus=0x%x time=%u us paused=%d",
363022851890Sopenharmony_ci+		  __entry->cpus, __entry->active_cpus, __entry->time, __entry->pause)
363122851890Sopenharmony_ci+);
363222851890Sopenharmony_ci #endif
363322851890Sopenharmony_ci 
363422851890Sopenharmony_ci /* This part must be outside protection */
363522851890Sopenharmony_cidiff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
363622851890Sopenharmony_ciindex dd5fff2bb..6c6a23b4b 100644
363722851890Sopenharmony_ci--- a/include/trace/events/sched.h
363822851890Sopenharmony_ci+++ b/include/trace/events/sched.h
363922851890Sopenharmony_ci@@ -203,6 +203,7 @@ TRACE_EVENT(sched_migrate_task,
364022851890Sopenharmony_ci 		__field(	int,	prio			)
364122851890Sopenharmony_ci 		__field(	int,	orig_cpu		)
364222851890Sopenharmony_ci 		__field(	int,	dest_cpu		)
364322851890Sopenharmony_ci+		__field(	int,	running			)
364422851890Sopenharmony_ci 	),
364522851890Sopenharmony_ci 
364622851890Sopenharmony_ci 	TP_fast_assign(
364722851890Sopenharmony_ci@@ -211,11 +212,13 @@ TRACE_EVENT(sched_migrate_task,
364822851890Sopenharmony_ci 		__entry->prio		= p->prio; /* XXX SCHED_DEADLINE */
364922851890Sopenharmony_ci 		__entry->orig_cpu	= task_cpu(p);
365022851890Sopenharmony_ci 		__entry->dest_cpu	= dest_cpu;
365122851890Sopenharmony_ci+		__entry->running	= (p->state == TASK_RUNNING);
365222851890Sopenharmony_ci 	),
365322851890Sopenharmony_ci 
365422851890Sopenharmony_ci-	TP_printk("comm=%s pid=%d prio=%d orig_cpu=%d dest_cpu=%d",
365522851890Sopenharmony_ci+	TP_printk("comm=%s pid=%d prio=%d orig_cpu=%d dest_cpu=%d running=%d",
365622851890Sopenharmony_ci 		  __entry->comm, __entry->pid, __entry->prio,
365722851890Sopenharmony_ci-		  __entry->orig_cpu, __entry->dest_cpu)
365822851890Sopenharmony_ci+		  __entry->orig_cpu, __entry->dest_cpu,
365922851890Sopenharmony_ci+		  __entry->running)
366022851890Sopenharmony_ci );
366122851890Sopenharmony_ci 
366222851890Sopenharmony_ci DECLARE_EVENT_CLASS(sched_process_template,
366322851890Sopenharmony_cidiff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
366422851890Sopenharmony_ciindex 5498d7a65..5b5db0381 100644
366522851890Sopenharmony_ci--- a/include/uapi/drm/drm_fourcc.h
366622851890Sopenharmony_ci+++ b/include/uapi/drm/drm_fourcc.h
366722851890Sopenharmony_ci@@ -242,6 +242,8 @@ extern "C" {
366822851890Sopenharmony_ci  * index 1 = Cr:Cb plane, [39:0] Cr1:Cb1:Cr0:Cb0 little endian
366922851890Sopenharmony_ci  */
367022851890Sopenharmony_ci #define DRM_FORMAT_NV15		fourcc_code('N', 'V', '1', '5') /* 2x2 subsampled Cr:Cb plane */
367122851890Sopenharmony_ci+#define DRM_FORMAT_NV20		fourcc_code('N', 'V', '2', '0') /* 2x1 subsampled Cr:Cb plane */
367222851890Sopenharmony_ci+#define DRM_FORMAT_NV30		fourcc_code('N', 'V', '3', '0') /* non-subsampled Cr:Cb plane */
367322851890Sopenharmony_ci 
367422851890Sopenharmony_ci /*
367522851890Sopenharmony_ci  * 2 plane YCbCr MSB aligned
367622851890Sopenharmony_cidiff --git a/include/uapi/linux/media-bus-format.h b/include/uapi/linux/media-bus-format.h
367722851890Sopenharmony_ciindex 84fa53ffb..096f891d4 100644
367822851890Sopenharmony_ci--- a/include/uapi/linux/media-bus-format.h
367922851890Sopenharmony_ci+++ b/include/uapi/linux/media-bus-format.h
368022851890Sopenharmony_ci@@ -34,7 +34,7 @@
368122851890Sopenharmony_ci 
368222851890Sopenharmony_ci #define MEDIA_BUS_FMT_FIXED			0x0001
368322851890Sopenharmony_ci 
368422851890Sopenharmony_ci-/* RGB - next is	0x101d */
368522851890Sopenharmony_ci+/* RGB - next is	0x1024 */
368622851890Sopenharmony_ci #define MEDIA_BUS_FMT_RGB444_1X12		0x1016
368722851890Sopenharmony_ci #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_BE	0x1001
368822851890Sopenharmony_ci #define MEDIA_BUS_FMT_RGB444_2X8_PADHI_LE	0x1002
368922851890Sopenharmony_ci@@ -63,6 +63,10 @@
369022851890Sopenharmony_ci #define MEDIA_BUS_FMT_RGB101010_1X30		0x1018
369122851890Sopenharmony_ci #define MEDIA_BUS_FMT_RGB121212_1X36		0x1019
369222851890Sopenharmony_ci #define MEDIA_BUS_FMT_RGB161616_1X48		0x101a
369322851890Sopenharmony_ci+#define MEDIA_BUS_FMT_RGB888_DUMMY_4X8		0x101f
369422851890Sopenharmony_ci+#define MEDIA_BUS_FMT_BGR888_DUMMY_4X8		0x1020
369522851890Sopenharmony_ci+#define MEDIA_BUS_FMT_RGB101010_1X7X5_SPWG	0x1022
369622851890Sopenharmony_ci+#define MEDIA_BUS_FMT_RGB101010_1X7X5_JEIDA	0x1023
369722851890Sopenharmony_ci 
369822851890Sopenharmony_ci /* YUV (including grey) - next is	0x202e */
369922851890Sopenharmony_ci #define MEDIA_BUS_FMT_Y8_1X8			0x2001
370022851890Sopenharmony_cidiff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h
370122851890Sopenharmony_ciindex f51bc8f36..7e3fe68af 100644
370222851890Sopenharmony_ci--- a/include/uapi/linux/serial_reg.h
370322851890Sopenharmony_ci+++ b/include/uapi/linux/serial_reg.h
370422851890Sopenharmony_ci@@ -30,6 +30,7 @@
370522851890Sopenharmony_ci  * Sleep mode for ST16650 and TI16750.  For the ST16650, EFR[4]=1
370622851890Sopenharmony_ci  */
370722851890Sopenharmony_ci #define UART_IERX_SLEEP		0x10 /* Enable sleep mode */
370822851890Sopenharmony_ci+#define UART_IER_PTIME		0x80 /* Enable programmable transmit interrupt mode */
370922851890Sopenharmony_ci 
371022851890Sopenharmony_ci #define UART_IIR	2	/* In:  Interrupt ID Register */
371122851890Sopenharmony_ci #define UART_IIR_NO_INT		0x01 /* No interrupts pending */
371222851890Sopenharmony_cidiff --git a/include/uapi/linux/usb/f_accessory.h b/include/uapi/linux/usb/f_accessory.h
371322851890Sopenharmony_cinew file mode 100644
371422851890Sopenharmony_ciindex 000000000..0baeb7d0d
371522851890Sopenharmony_ci--- /dev/null
371622851890Sopenharmony_ci+++ b/include/uapi/linux/usb/f_accessory.h
371722851890Sopenharmony_ci@@ -0,0 +1,146 @@
371822851890Sopenharmony_ci+/*
371922851890Sopenharmony_ci+ * Gadget Function Driver for Android USB accessories
372022851890Sopenharmony_ci+ *
372122851890Sopenharmony_ci+ * Copyright (C) 2011 Google, Inc.
372222851890Sopenharmony_ci+ * Author: Mike Lockwood <lockwood@android.com>
372322851890Sopenharmony_ci+ *
372422851890Sopenharmony_ci+ * This software is licensed under the terms of the GNU General Public
372522851890Sopenharmony_ci+ * License version 2, as published by the Free Software Foundation, and
372622851890Sopenharmony_ci+ * may be copied, distributed, and modified under those terms.
372722851890Sopenharmony_ci+ *
372822851890Sopenharmony_ci+ * This program is distributed in the hope that it will be useful,
372922851890Sopenharmony_ci+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
373022851890Sopenharmony_ci+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
373122851890Sopenharmony_ci+ * GNU General Public License for more details.
373222851890Sopenharmony_ci+ *
373322851890Sopenharmony_ci+ */
373422851890Sopenharmony_ci+
373522851890Sopenharmony_ci+#ifndef _UAPI_LINUX_USB_F_ACCESSORY_H
373622851890Sopenharmony_ci+#define _UAPI_LINUX_USB_F_ACCESSORY_H
373722851890Sopenharmony_ci+
373822851890Sopenharmony_ci+/* Use Google Vendor ID when in accessory mode */
373922851890Sopenharmony_ci+#define USB_ACCESSORY_VENDOR_ID 0x18D1
374022851890Sopenharmony_ci+
374122851890Sopenharmony_ci+
374222851890Sopenharmony_ci+/* Product ID to use when in accessory mode */
374322851890Sopenharmony_ci+#define USB_ACCESSORY_PRODUCT_ID 0x2D00
374422851890Sopenharmony_ci+
374522851890Sopenharmony_ci+/* Product ID to use when in accessory mode and adb is enabled */
374622851890Sopenharmony_ci+#define USB_ACCESSORY_ADB_PRODUCT_ID 0x2D01
374722851890Sopenharmony_ci+
374822851890Sopenharmony_ci+/* Indexes for strings sent by the host via ACCESSORY_SEND_STRING */
374922851890Sopenharmony_ci+#define ACCESSORY_STRING_MANUFACTURER   0
375022851890Sopenharmony_ci+#define ACCESSORY_STRING_MODEL          1
375122851890Sopenharmony_ci+#define ACCESSORY_STRING_DESCRIPTION    2
375222851890Sopenharmony_ci+#define ACCESSORY_STRING_VERSION        3
375322851890Sopenharmony_ci+#define ACCESSORY_STRING_URI            4
375422851890Sopenharmony_ci+#define ACCESSORY_STRING_SERIAL         5
375522851890Sopenharmony_ci+
375622851890Sopenharmony_ci+/* Control request for retrieving device's protocol version
375722851890Sopenharmony_ci+ *
375822851890Sopenharmony_ci+ *	requestType:    USB_DIR_IN | USB_TYPE_VENDOR
375922851890Sopenharmony_ci+ *	request:        ACCESSORY_GET_PROTOCOL
376022851890Sopenharmony_ci+ *	value:          0
376122851890Sopenharmony_ci+ *	index:          0
376222851890Sopenharmony_ci+ *	data            version number (16 bits little endian)
376322851890Sopenharmony_ci+ *                     1 for original accessory support
376422851890Sopenharmony_ci+ *                     2 adds HID and device to host audio support
376522851890Sopenharmony_ci+ */
376622851890Sopenharmony_ci+#define ACCESSORY_GET_PROTOCOL  51
376722851890Sopenharmony_ci+
376822851890Sopenharmony_ci+/* Control request for host to send a string to the device
376922851890Sopenharmony_ci+ *
377022851890Sopenharmony_ci+ *	requestType:    USB_DIR_OUT | USB_TYPE_VENDOR
377122851890Sopenharmony_ci+ *	request:        ACCESSORY_SEND_STRING
377222851890Sopenharmony_ci+ *	value:          0
377322851890Sopenharmony_ci+ *	index:          string ID
377422851890Sopenharmony_ci+ *	data            zero terminated UTF8 string
377522851890Sopenharmony_ci+ *
377622851890Sopenharmony_ci+ *  The device can later retrieve these strings via the
377722851890Sopenharmony_ci+ *  ACCESSORY_GET_STRING_* ioctls
377822851890Sopenharmony_ci+ */
377922851890Sopenharmony_ci+#define ACCESSORY_SEND_STRING   52
378022851890Sopenharmony_ci+
378122851890Sopenharmony_ci+/* Control request for starting device in accessory mode.
378222851890Sopenharmony_ci+ * The host sends this after setting all its strings to the device.
378322851890Sopenharmony_ci+ *
378422851890Sopenharmony_ci+ *	requestType:    USB_DIR_OUT | USB_TYPE_VENDOR
378522851890Sopenharmony_ci+ *	request:        ACCESSORY_START
378622851890Sopenharmony_ci+ *	value:          0
378722851890Sopenharmony_ci+ *	index:          0
378822851890Sopenharmony_ci+ *	data            none
378922851890Sopenharmony_ci+ */
379022851890Sopenharmony_ci+#define ACCESSORY_START         53
379122851890Sopenharmony_ci+
379222851890Sopenharmony_ci+/* Control request for registering a HID device.
379322851890Sopenharmony_ci+ * Upon registering, a unique ID is sent by the accessory in the
379422851890Sopenharmony_ci+ * value parameter. This ID will be used for future commands for
379522851890Sopenharmony_ci+ * the device
379622851890Sopenharmony_ci+ *
379722851890Sopenharmony_ci+ *	requestType:    USB_DIR_OUT | USB_TYPE_VENDOR
379822851890Sopenharmony_ci+ *	request:        ACCESSORY_REGISTER_HID_DEVICE
379922851890Sopenharmony_ci+ *	value:          Accessory assigned ID for the HID device
380022851890Sopenharmony_ci+ *	index:          total length of the HID report descriptor
380122851890Sopenharmony_ci+ *	data            none
380222851890Sopenharmony_ci+ */
380322851890Sopenharmony_ci+#define ACCESSORY_REGISTER_HID         54
380422851890Sopenharmony_ci+
380522851890Sopenharmony_ci+/* Control request for unregistering a HID device.
380622851890Sopenharmony_ci+ *
380722851890Sopenharmony_ci+ *	requestType:    USB_DIR_OUT | USB_TYPE_VENDOR
380822851890Sopenharmony_ci+ *	request:        ACCESSORY_REGISTER_HID
380922851890Sopenharmony_ci+ *	value:          Accessory assigned ID for the HID device
381022851890Sopenharmony_ci+ *	index:          0
381122851890Sopenharmony_ci+ *	data            none
381222851890Sopenharmony_ci+ */
381322851890Sopenharmony_ci+#define ACCESSORY_UNREGISTER_HID         55
381422851890Sopenharmony_ci+
381522851890Sopenharmony_ci+/* Control request for sending the HID report descriptor.
381622851890Sopenharmony_ci+ * If the HID descriptor is longer than the endpoint zero max packet size,
381722851890Sopenharmony_ci+ * the descriptor will be sent in multiple ACCESSORY_SET_HID_REPORT_DESC
381822851890Sopenharmony_ci+ * commands. The data for the descriptor must be sent sequentially
381922851890Sopenharmony_ci+ * if multiple packets are needed.
382022851890Sopenharmony_ci+ *
382122851890Sopenharmony_ci+ *	requestType:    USB_DIR_OUT | USB_TYPE_VENDOR
382222851890Sopenharmony_ci+ *	request:        ACCESSORY_SET_HID_REPORT_DESC
382322851890Sopenharmony_ci+ *	value:          Accessory assigned ID for the HID device
382422851890Sopenharmony_ci+ *	index:          offset of data in descriptor
382522851890Sopenharmony_ci+ *                      (needed when HID descriptor is too big for one packet)
382622851890Sopenharmony_ci+ *	data            the HID report descriptor
382722851890Sopenharmony_ci+ */
382822851890Sopenharmony_ci+#define ACCESSORY_SET_HID_REPORT_DESC         56
382922851890Sopenharmony_ci+
383022851890Sopenharmony_ci+/* Control request for sending HID events.
383122851890Sopenharmony_ci+ *
383222851890Sopenharmony_ci+ *	requestType:    USB_DIR_OUT | USB_TYPE_VENDOR
383322851890Sopenharmony_ci+ *	request:        ACCESSORY_SEND_HID_EVENT
383422851890Sopenharmony_ci+ *	value:          Accessory assigned ID for the HID device
383522851890Sopenharmony_ci+ *	index:          0
383622851890Sopenharmony_ci+ *	data            the HID report for the event
383722851890Sopenharmony_ci+ */
383822851890Sopenharmony_ci+#define ACCESSORY_SEND_HID_EVENT         57
383922851890Sopenharmony_ci+
384022851890Sopenharmony_ci+/* Control request for setting the audio mode.
384122851890Sopenharmony_ci+ *
384222851890Sopenharmony_ci+ *	requestType:	USB_DIR_OUT | USB_TYPE_VENDOR
384322851890Sopenharmony_ci+ *	request:        ACCESSORY_SET_AUDIO_MODE
384422851890Sopenharmony_ci+ *	value:          0 - no audio
384522851890Sopenharmony_ci+ *                     1 - device to host, 44100 16-bit stereo PCM
384622851890Sopenharmony_ci+ *	index:          0
384722851890Sopenharmony_ci+ *	data            none
384822851890Sopenharmony_ci+ */
384922851890Sopenharmony_ci+#define ACCESSORY_SET_AUDIO_MODE         58
385022851890Sopenharmony_ci+
385122851890Sopenharmony_ci+/* ioctls for retrieving strings set by the host */
385222851890Sopenharmony_ci+#define ACCESSORY_GET_STRING_MANUFACTURER   _IOW('M', 1, char[256])
385322851890Sopenharmony_ci+#define ACCESSORY_GET_STRING_MODEL          _IOW('M', 2, char[256])
385422851890Sopenharmony_ci+#define ACCESSORY_GET_STRING_DESCRIPTION    _IOW('M', 3, char[256])
385522851890Sopenharmony_ci+#define ACCESSORY_GET_STRING_VERSION        _IOW('M', 4, char[256])
385622851890Sopenharmony_ci+#define ACCESSORY_GET_STRING_URI            _IOW('M', 5, char[256])
385722851890Sopenharmony_ci+#define ACCESSORY_GET_STRING_SERIAL         _IOW('M', 6, char[256])
385822851890Sopenharmony_ci+/* returns 1 if there is a start request pending */
385922851890Sopenharmony_ci+#define ACCESSORY_IS_START_REQUESTED        _IO('M', 7)
386022851890Sopenharmony_ci+/* returns audio mode (set via the ACCESSORY_SET_AUDIO_MODE control request) */
386122851890Sopenharmony_ci+#define ACCESSORY_GET_AUDIO_MODE            _IO('M', 8)
386222851890Sopenharmony_ci+
386322851890Sopenharmony_ci+#endif /* _UAPI_LINUX_USB_F_ACCESSORY_H */
386422851890Sopenharmony_cidiff --git a/include/uapi/linux/usb/g_uvc.h b/include/uapi/linux/usb/g_uvc.h
386522851890Sopenharmony_ciindex 652f169a0..428926e35 100644
386622851890Sopenharmony_ci--- a/include/uapi/linux/usb/g_uvc.h
386722851890Sopenharmony_ci+++ b/include/uapi/linux/usb/g_uvc.h
386822851890Sopenharmony_ci@@ -19,7 +19,9 @@
386922851890Sopenharmony_ci #define UVC_EVENT_STREAMOFF		(V4L2_EVENT_PRIVATE_START + 3)
387022851890Sopenharmony_ci #define UVC_EVENT_SETUP			(V4L2_EVENT_PRIVATE_START + 4)
387122851890Sopenharmony_ci #define UVC_EVENT_DATA			(V4L2_EVENT_PRIVATE_START + 5)
387222851890Sopenharmony_ci-#define UVC_EVENT_LAST			(V4L2_EVENT_PRIVATE_START + 5)
387322851890Sopenharmony_ci+#define UVC_EVENT_SUSPEND		(V4L2_EVENT_PRIVATE_START + 6)
387422851890Sopenharmony_ci+#define UVC_EVENT_RESUME		(V4L2_EVENT_PRIVATE_START + 7)
387522851890Sopenharmony_ci+#define UVC_EVENT_LAST			(V4L2_EVENT_PRIVATE_START + 7)
387622851890Sopenharmony_ci 
387722851890Sopenharmony_ci struct uvc_request_data {
387822851890Sopenharmony_ci 	__s32 length;
387922851890Sopenharmony_cidiff --git a/include/uapi/linux/usb/video.h b/include/uapi/linux/usb/video.h
388022851890Sopenharmony_ciindex bfdae12cd..b82436fd9 100644
388122851890Sopenharmony_ci--- a/include/uapi/linux/usb/video.h
388222851890Sopenharmony_ci+++ b/include/uapi/linux/usb/video.h
388322851890Sopenharmony_ci@@ -567,5 +567,63 @@ struct UVC_FRAME_MJPEG(n) {				\
388422851890Sopenharmony_ci 	__le32 dwFrameInterval[n];			\
388522851890Sopenharmony_ci } __attribute__ ((packed))
388622851890Sopenharmony_ci 
388722851890Sopenharmony_ci+/* Frame Based Payload - 3.1.1. Frame Based Video Format Descriptor */
388822851890Sopenharmony_ci+struct uvc_format_framebased {
388922851890Sopenharmony_ci+	__u8  bLength;
389022851890Sopenharmony_ci+	__u8  bDescriptorType;
389122851890Sopenharmony_ci+	__u8  bDescriptorSubType;
389222851890Sopenharmony_ci+	__u8  bFormatIndex;
389322851890Sopenharmony_ci+	__u8  bNumFrameDescriptors;
389422851890Sopenharmony_ci+	__u8  guidFormat[16];
389522851890Sopenharmony_ci+	__u8  bBitsPerPixel;
389622851890Sopenharmony_ci+	__u8  bDefaultFrameIndex;
389722851890Sopenharmony_ci+	__u8  bAspectRatioX;
389822851890Sopenharmony_ci+	__u8  bAspectRatioY;
389922851890Sopenharmony_ci+	__u8  bmInterfaceFlags;
390022851890Sopenharmony_ci+	__u8  bCopyProtect;
390122851890Sopenharmony_ci+	__u8  bVariableSize;
390222851890Sopenharmony_ci+} __attribute__((__packed__));
390322851890Sopenharmony_ci+
390422851890Sopenharmony_ci+#define UVC_DT_FORMAT_FRAMEBASED_SIZE			28
390522851890Sopenharmony_ci+
390622851890Sopenharmony_ci+/* Frame Based Payload - 3.1.2. Frame Based Video Frame Descriptor */
390722851890Sopenharmony_ci+struct uvc_frame_framebased {
390822851890Sopenharmony_ci+	__u8  bLength;
390922851890Sopenharmony_ci+	__u8  bDescriptorType;
391022851890Sopenharmony_ci+	__u8  bDescriptorSubType;
391122851890Sopenharmony_ci+	__u8  bFrameIndex;
391222851890Sopenharmony_ci+	__u8  bmCapabilities;
391322851890Sopenharmony_ci+	__u16 wWidth;
391422851890Sopenharmony_ci+	__u16 wHeight;
391522851890Sopenharmony_ci+	__u32 dwMinBitRate;
391622851890Sopenharmony_ci+	__u32 dwMaxBitRate;
391722851890Sopenharmony_ci+	__u32 dwDefaultFrameInterval;
391822851890Sopenharmony_ci+	__u8  bFrameIntervalType;
391922851890Sopenharmony_ci+	__u32 dwBytesPerLine;
392022851890Sopenharmony_ci+	__u32 dwFrameInterval[];
392122851890Sopenharmony_ci+} __attribute__((__packed__));
392222851890Sopenharmony_ci+
392322851890Sopenharmony_ci+#define UVC_DT_FRAME_FRAMEBASED_SIZE(n)                        (26+4*(n))
392422851890Sopenharmony_ci+
392522851890Sopenharmony_ci+#define UVC_FRAME_FRAMEBASED(n) \
392622851890Sopenharmony_ci+	uvc_frame_framebased_##n
392722851890Sopenharmony_ci+
392822851890Sopenharmony_ci+#define DECLARE_UVC_FRAME_FRAMEBASED(n)		\
392922851890Sopenharmony_ci+struct UVC_FRAME_FRAMEBASED(n) {		\
393022851890Sopenharmony_ci+	__u8  bLength;				\
393122851890Sopenharmony_ci+	__u8  bDescriptorType;			\
393222851890Sopenharmony_ci+	__u8  bDescriptorSubType;		\
393322851890Sopenharmony_ci+	__u8  bFrameIndex;			\
393422851890Sopenharmony_ci+	__u8  bmCapabilities;			\
393522851890Sopenharmony_ci+	__u16 wWidth;				\
393622851890Sopenharmony_ci+	__u16 wHeight;				\
393722851890Sopenharmony_ci+	__u32 dwMinBitRate;			\
393822851890Sopenharmony_ci+	__u32 dwMaxBitRate;			\
393922851890Sopenharmony_ci+	__u32 dwDefaultFrameInterval;		\
394022851890Sopenharmony_ci+	__u8  bFrameIntervalType;		\
394122851890Sopenharmony_ci+	__u32 dwBytesPerLine;			\
394222851890Sopenharmony_ci+	__u32 dwFrameInterval[n];		\
394322851890Sopenharmony_ci+} __attribute__ ((packed))
394422851890Sopenharmony_ci+
394522851890Sopenharmony_ci #endif /* __LINUX_USB_VIDEO_H */
394622851890Sopenharmony_ci 
394722851890Sopenharmony_cidiff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
394822851890Sopenharmony_ciindex a184c4939..a3eb68372 100644
394922851890Sopenharmony_ci--- a/include/uapi/linux/v4l2-controls.h
395022851890Sopenharmony_ci+++ b/include/uapi/linux/v4l2-controls.h
395122851890Sopenharmony_ci@@ -188,6 +188,12 @@ enum v4l2_colorfx {
395222851890Sopenharmony_ci  */
395322851890Sopenharmony_ci #define V4L2_CID_USER_MAX217X_BASE		(V4L2_CID_USER_BASE + 0x1090)
395422851890Sopenharmony_ci 
395522851890Sopenharmony_ci+/*
395622851890Sopenharmony_ci+ * The base for the tc35874x driver controls.
395722851890Sopenharmony_ci+ * We reserve 16 controls for this driver.
395822851890Sopenharmony_ci+ */
395922851890Sopenharmony_ci+#define V4L2_CID_USER_TC35874X_BASE		(V4L2_CID_USER_BASE + 0x10a0)
396022851890Sopenharmony_ci+
396122851890Sopenharmony_ci /* The base for the imx driver controls.
396222851890Sopenharmony_ci  * We reserve 16 controls for this driver. */
396322851890Sopenharmony_ci #define V4L2_CID_USER_IMX_BASE			(V4L2_CID_USER_BASE + 0x10b0)
396422851890Sopenharmony_cidiff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
396522851890Sopenharmony_ciindex 534eaa4d3..eb01fb549 100644
396622851890Sopenharmony_ci--- a/include/uapi/linux/videodev2.h
396722851890Sopenharmony_ci+++ b/include/uapi/linux/videodev2.h
396822851890Sopenharmony_ci@@ -689,6 +689,7 @@ struct v4l2_pix_format {
396922851890Sopenharmony_ci #define V4L2_PIX_FMT_JPEG     v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG     */
397022851890Sopenharmony_ci #define V4L2_PIX_FMT_DV       v4l2_fourcc('d', 'v', 's', 'd') /* 1394          */
397122851890Sopenharmony_ci #define V4L2_PIX_FMT_MPEG     v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
397222851890Sopenharmony_ci+#define V4L2_PIX_FMT_H265     v4l2_fourcc('H', '2', '6', '5') /* H265 with start codes */
397322851890Sopenharmony_ci #define V4L2_PIX_FMT_H264     v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
397422851890Sopenharmony_ci #define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
397522851890Sopenharmony_ci #define V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */
3976