Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea9d2805 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge f1385241 on remote branch

Change-Id: Ia1721604844e1e2ffdb68be6f5b47e3be1859dcb
parents 47673f2f f1385241
Loading
Loading
Loading
Loading
+61 −0
Original line number Diff line number Diff line
@@ -504,6 +504,8 @@ int bolero_register_macro(struct device *dev, u16 macro_id,
	if (macro_id == TX_MACRO) {
		priv->macro_params[macro_id].reg_wake_irq = ops->reg_wake_irq;
		priv->macro_params[macro_id].clk_switch = ops->clk_switch;
		priv->macro_params[macro_id].reg_evt_listener =
							ops->reg_evt_listener;
	}

	priv->num_dais += ops->num_dais;
@@ -567,6 +569,7 @@ void bolero_unregister_macro(struct device *dev, u16 macro_id)
	if (macro_id == TX_MACRO) {
		priv->macro_params[macro_id].reg_wake_irq = NULL;
		priv->macro_params[macro_id].clk_switch = NULL;
		priv->macro_params[macro_id].reg_evt_listener = NULL;
	}

	priv->num_dais -= priv->macro_params[macro_id].num_dais;
@@ -578,6 +581,29 @@ void bolero_unregister_macro(struct device *dev, u16 macro_id)
}
EXPORT_SYMBOL(bolero_unregister_macro);

void bolero_wsa_pa_on(struct device *dev)
{
	struct bolero_priv *priv;

	if (!dev) {
		pr_err("%s: dev is null\n", __func__);
		return;
	}
	if (!bolero_is_valid_child_dev(dev)) {
		dev_err(dev, "%s: not a valid child dev\n",
			__func__);
		return;
	}
	priv = dev_get_drvdata(dev->parent);
	if (!priv) {
		dev_err(dev, "%s: priv is null\n", __func__);
		return;
	}

	bolero_cdc_notifier_call(priv, BOLERO_WCD_EVT_PA_ON_POST_FSCLK);
}
EXPORT_SYMBOL(bolero_wsa_pa_on);

static ssize_t bolero_version_read(struct snd_info_entry *entry,
				   void *file_private_data,
				   struct file *file,
@@ -803,6 +829,41 @@ int bolero_tx_clk_switch(struct snd_soc_component *component)
}
EXPORT_SYMBOL(bolero_tx_clk_switch);

/**
 * bolero_register_event_listener - Register/Deregister to event listener
 *
 * @component: pointer to codec component instance.
 * @enable: when set to 1 registers to event listener otherwise, derigisters
 *          from the event listener
 *
 * Returns 0 on success or -EINVAL on error.
 */
int bolero_register_event_listener(struct snd_soc_component *component,
				   bool enable)
{
	struct bolero_priv *priv = NULL;
	int ret = 0;

	if (!component)
		return -EINVAL;

	priv = snd_soc_component_get_drvdata(component);
	if (!priv)
		return -EINVAL;

	if (!bolero_is_valid_codec_dev(priv->dev)) {
		dev_err(component->dev, "%s: invalid codec\n", __func__);
		return -EINVAL;
	}

	if (priv->macro_params[TX_MACRO].reg_evt_listener)
		ret = priv->macro_params[TX_MACRO].reg_evt_listener(component,
								    enable);

	return ret;
}
EXPORT_SYMBOL(bolero_register_event_listener);

static int bolero_soc_codec_probe(struct snd_soc_component *component)
{
	struct bolero_priv *priv = dev_get_drvdata(component->dev);
+14 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ struct macro_ops {
	int (*set_port_map)(struct snd_soc_component *component, u32 uc,
			    u32 size, void *data);
	int (*clk_switch)(struct snd_soc_component *component);
	int (*reg_evt_listener)(struct snd_soc_component *component, bool en);
	char __iomem *io_base;
	u16 clk_id_req;
	u16 default_clk_id;
@@ -80,6 +81,9 @@ int bolero_runtime_resume(struct device *dev);
int bolero_runtime_suspend(struct device *dev);
int bolero_set_port_map(struct snd_soc_component *component, u32 size, void *data);
int bolero_tx_clk_switch(struct snd_soc_component *component);
int bolero_register_event_listener(struct snd_soc_component *component,
				   bool enable);
void bolero_wsa_pa_on(struct device *dev);
#else
static inline int bolero_register_res_clk(struct device *dev, rsc_clk_cb_t cb)
{
@@ -144,5 +148,15 @@ static inline int bolero_tx_clk_switch(struct snd_soc_component *component)
	return 0;
}

static inline int bolero_register_event_listener(
					struct snd_soc_component *component,
					bool enable)
{
	return 0;
}

static void bolero_wsa_pa_on(struct device *dev)
{
}
#endif /* CONFIG_SND_SOC_BOLERO */
#endif /* BOLERO_CDC_H */
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ enum {
	BOLERO_WCD_EVT_PA_OFF_PRE_SSR,
	BOLERO_WCD_EVT_SSR_DOWN,
	BOLERO_WCD_EVT_SSR_UP,
	BOLERO_WCD_EVT_PA_ON_POST_FSCLK,
};

enum {
+372 −40

File changed.

Preview size limit exceeded, changes collapsed.

+231 −9

File changed.

Preview size limit exceeded, changes collapsed.

Loading