Commit 437af8f2 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: x86: Call event callback directly

Currently the driver calls the event callback stored in its ctx
pointer, but it's obviously inefficient.  Replace it with the direct
calls.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent dd895f2e
...@@ -1591,7 +1591,6 @@ int hdmi_audio_probe(struct platform_device *devptr, ...@@ -1591,7 +1591,6 @@ int hdmi_audio_probe(struct platform_device *devptr,
int retval; int retval;
struct snd_pcm *pcm; struct snd_pcm *pcm;
struct snd_card *card; struct snd_card *card;
struct had_callback_ops ops_cb;
struct snd_intelhad *intelhaddata; struct snd_intelhad *intelhaddata;
struct had_pvt_data *had_stream; struct had_pvt_data *had_stream;
...@@ -1610,16 +1609,6 @@ int hdmi_audio_probe(struct platform_device *devptr, ...@@ -1610,16 +1609,6 @@ int hdmi_audio_probe(struct platform_device *devptr,
goto free_haddata; goto free_haddata;
} }
ops_cb.intel_had_event_call_back = had_event_handler;
/* registering with display driver to get access to display APIs */
retval = mid_hdmi_audio_setup(ops_cb.intel_had_event_call_back);
if (retval) {
pr_err("querying display driver APIs failed %#x\n", retval);
goto free_hadstream;
}
spin_lock_init(&intelhaddata->had_spinlock); spin_lock_init(&intelhaddata->had_spinlock);
intelhaddata->drv_status = HAD_DRV_DISCONNECTED; intelhaddata->drv_status = HAD_DRV_DISCONNECTED;
pr_debug("%s @ %d:DEBUG PLUG/UNPLUG : HAD_DRV_DISCONNECTED\n", pr_debug("%s @ %d:DEBUG PLUG/UNPLUG : HAD_DRV_DISCONNECTED\n",
......
...@@ -99,10 +99,6 @@ struct had_pvt_data { ...@@ -99,10 +99,6 @@ struct had_pvt_data {
enum had_status_stream stream_type; enum had_status_stream stream_type;
}; };
struct had_callback_ops {
had_event_call_back intel_had_event_call_back;
};
/** /**
* struct snd_intelhad - intelhad driver structure * struct snd_intelhad - intelhad driver structure
* *
......
...@@ -44,7 +44,6 @@ static union otm_hdmi_eld_t hlpe_eld; ...@@ -44,7 +44,6 @@ static union otm_hdmi_eld_t hlpe_eld;
struct hdmi_lpe_audio_ctx { struct hdmi_lpe_audio_ctx {
int irq; int irq;
void __iomem *mmio_start; void __iomem *mmio_start;
had_event_call_back had_event_callbacks;
struct snd_intelhad *had; struct snd_intelhad *had;
int tmds_clock_speed; int tmds_clock_speed;
bool dp_output; bool dp_output;
...@@ -118,8 +117,7 @@ void mid_hdmi_audio_signal_event(enum had_event_type event) ...@@ -118,8 +117,7 @@ void mid_hdmi_audio_signal_event(enum had_event_type event)
/* The handler is protected in the respective /* The handler is protected in the respective
* event handlers to avoid races * event handlers to avoid races
*/ */
if (ctx->had_event_callbacks) had_event_handler(event, ctx->had);
(*ctx->had_event_callbacks)(event, ctx->had);
} }
/* /*
...@@ -257,19 +255,6 @@ int mid_hdmi_audio_set_caps(enum had_caps_list set_element, ...@@ -257,19 +255,6 @@ int mid_hdmi_audio_set_caps(enum had_caps_list set_element,
return 0; return 0;
} }
int mid_hdmi_audio_setup(had_event_call_back audio_callbacks)
{
struct hdmi_lpe_audio_ctx *ctx;
ctx = platform_get_drvdata(hlpe_pdev);
dev_dbg(&hlpe_pdev->dev, "%s: called\n", __func__);
ctx->had_event_callbacks = audio_callbacks;
return 0;
}
static void _had_wq(struct work_struct *work) static void _had_wq(struct work_struct *work)
{ {
mid_hdmi_audio_signal_event(HAD_EVENT_HOT_PLUG); mid_hdmi_audio_signal_event(HAD_EVENT_HOT_PLUG);
......
...@@ -638,16 +638,12 @@ enum had_event_type { ...@@ -638,16 +638,12 @@ enum had_event_type {
* HDMI Display Controller Audio Interface * HDMI Display Controller Audio Interface
* *
*/ */
typedef int (*had_event_call_back) (enum had_event_type event_type,
void *ctxt_info);
struct hdmi_audio_event { struct hdmi_audio_event {
int type; int type;
}; };
bool mid_hdmi_audio_is_busy(void *dev); bool mid_hdmi_audio_is_busy(void *dev);
void mid_hdmi_audio_signal_event(enum had_event_type event); void mid_hdmi_audio_signal_event(enum had_event_type event);
int mid_hdmi_audio_setup(had_event_call_back audio_callbacks);
int mid_hdmi_audio_read(u32 reg, u32 *val); int mid_hdmi_audio_read(u32 reg, u32 *val);
int mid_hdmi_audio_write(u32 reg, u32 val); int mid_hdmi_audio_write(u32 reg, u32 val);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment