mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
hdmitx: add tracer for audio [1/1]
PD#SWPL-142522 Problem: no event for audio Solution: add audio trace event Verify: s5 Test: DRM-TX-71 Change-Id: Ic2592cd06f1ef392adb29131a45f72af3ae2933a Signed-off-by: yahui.liu <yahui.liu@amlogic.com>
This commit is contained in:
committed by
gerrit autosubmit
parent
32d95f5213
commit
fd14e1eb0d
@@ -3753,8 +3753,6 @@ static int amhdmitx_probe(struct platform_device *pdev)
|
||||
/* return ret; */
|
||||
|
||||
amhdmitx_clktree_probe(device, hdev);
|
||||
hdmitx_audio_register_ctrl_callback(hdmitx20_ext_set_audio_output,
|
||||
hdmitx20_ext_get_audio_status);
|
||||
|
||||
r = alloc_chrdev_region(&hdev->hdmitx_id, 0, HDMI_TX_COUNT,
|
||||
DEVICE_NAME);
|
||||
@@ -3824,6 +3822,8 @@ static int amhdmitx_probe(struct platform_device *pdev)
|
||||
tx_tracer = hdmitx_tracer_create(tx_uevent_mgr);
|
||||
hdmitx_common_attch_platform_data(tx_comm,
|
||||
HDMITX_PLATFORM_TRACER, tx_tracer);
|
||||
hdmitx_audio_register_ctrl_callback(tx_tracer, hdmitx20_ext_set_audio_output,
|
||||
hdmitx20_ext_get_audio_status);
|
||||
hdmitx_edid_init(tx_comm);
|
||||
#ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND
|
||||
hdmitx_early_suspend_handler.param = hdev;
|
||||
|
||||
@@ -3857,8 +3857,6 @@ static int amhdmitx_probe(struct platform_device *pdev)
|
||||
amhdmitx_clktree_probe(&pdev->dev, hdev);
|
||||
if (0) /* TODO */
|
||||
amhdmitx21_vpu_dev_register(hdev);
|
||||
hdmitx_audio_register_ctrl_callback(hdmitx21_ext_set_audio_output,
|
||||
hdmitx21_ext_get_audio_status);
|
||||
|
||||
r = alloc_chrdev_region(&hdev->hdmitx_id, 0, HDMI_TX_COUNT,
|
||||
DEVICE_NAME);
|
||||
@@ -3925,6 +3923,8 @@ static int amhdmitx_probe(struct platform_device *pdev)
|
||||
tx_tracer = hdmitx_tracer_create(tx_event_mgr);
|
||||
hdmitx_common_attch_platform_data(tx_comm,
|
||||
HDMITX_PLATFORM_TRACER, tx_tracer);
|
||||
hdmitx_audio_register_ctrl_callback(tx_tracer, hdmitx21_ext_set_audio_output,
|
||||
hdmitx21_ext_get_audio_status);
|
||||
hdmitx_edid_init(tx_comm);
|
||||
#ifdef CONFIG_AMLOGIC_LEGACY_EARLY_SUSPEND
|
||||
hdmitx_early_suspend_handler.param = hdev;
|
||||
|
||||
@@ -847,6 +847,7 @@ void hdmitx_audio_notify_callback(struct hdmitx_common *tx_comm,
|
||||
if (tx_comm->hpd_state == 1) {
|
||||
tx_aud_param->aud_notify_update = 1;
|
||||
tx_hw_base->setaudmode(tx_hw_base, tx_aud_param);
|
||||
hdmitx_tracer_write_event(tx_comm->tx_tracer, HDMITX_AUDIO_MODE_SETTING);
|
||||
tx_aud_param->aud_notify_update = 0;
|
||||
HDMITX_INFO("set audio param\n");
|
||||
}
|
||||
@@ -855,21 +856,29 @@ void hdmitx_audio_notify_callback(struct hdmitx_common *tx_comm,
|
||||
hdmitx_hw_cntl_misc(tx_hw_base, MISC_AUDIO_RESET, 1);
|
||||
}
|
||||
|
||||
struct hdmitx_tracer *tx_tracer;
|
||||
static audio_en_callback cb_set_audio_output_en;
|
||||
static audio_st_callback cb_get_audio_status;
|
||||
|
||||
int hdmitx_audio_register_ctrl_callback(audio_en_callback cb1, audio_st_callback cb2)
|
||||
int hdmitx_audio_register_ctrl_callback(struct hdmitx_tracer *tracer,
|
||||
audio_en_callback cb1, audio_st_callback cb2)
|
||||
{
|
||||
if (!cb1 || !cb2)
|
||||
return -1;
|
||||
|
||||
tx_tracer = tracer;
|
||||
cb_set_audio_output_en = cb1;
|
||||
cb_get_audio_status = cb2;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void hdmitx_ext_set_audio_output(int enable)
|
||||
{
|
||||
cb_set_audio_output_en ? cb_set_audio_output_en(enable) : 0;
|
||||
if (cb_set_audio_output_en && tx_tracer)
|
||||
hdmitx_tracer_write_event(tx_tracer,
|
||||
enable ? HDMITX_AUDIO_UNMUTE : HDMITX_AUDIO_MUTE);
|
||||
}
|
||||
EXPORT_SYMBOL(hdmitx_ext_set_audio_output);
|
||||
|
||||
|
||||
@@ -72,6 +72,12 @@ const char *hdmitx_event_to_str(enum hdmitx_event_log_bits event)
|
||||
return "KMS_ERROR\n";
|
||||
case HDMITX_KMS_SKIP:
|
||||
return "KMS_SKIP\n";
|
||||
case HDMITX_AUDIO_MODE_SETTING:
|
||||
return "hdmitx_audio_mode_setting\n";
|
||||
case HDMITX_AUDIO_MUTE:
|
||||
return "hdmitx_audio_mute\n";
|
||||
case HDMITX_AUDIO_UNMUTE:
|
||||
return "hdmitx_audio_unmute\n";
|
||||
default:
|
||||
return "Unknown event\n";
|
||||
}
|
||||
|
||||
@@ -232,7 +232,8 @@ int hdmitx_common_setup_vsif_packet(struct hdmitx_common *tx_comm,
|
||||
|
||||
int hdmitx_register_hpd_cb(struct hdmitx_common *tx_comm, struct connector_hpd_cb *hpd_cb);
|
||||
int hdmitx_fire_drm_hpd_cb_unlocked(struct hdmitx_common *tx_comm);
|
||||
int hdmitx_audio_register_ctrl_callback(audio_en_callback cb1, audio_st_callback cb2);
|
||||
int hdmitx_audio_register_ctrl_callback(struct hdmitx_tracer *tracer,
|
||||
audio_en_callback cb1, audio_st_callback cb2);
|
||||
|
||||
int hdmitx_get_hpd_state(struct hdmitx_common *tx_comm);
|
||||
unsigned char *hdmitx_get_raw_edid(struct hdmitx_common *tx_comm);
|
||||
|
||||
@@ -43,6 +43,11 @@ enum hdmitx_event_log_bits {
|
||||
/* Mode setting erros */
|
||||
HDMITX_KMS_ERROR = HDMITX_HDMI_ERROR_MASK | 13,
|
||||
HDMITX_KMS_SKIP = HDMITX_HDMI_ERROR_MASK | 14,
|
||||
/* AUDIO format setting */
|
||||
HDMITX_AUDIO_MODE_SETTING = HDMITX_HDMI_ERROR_MASK | 15,
|
||||
HDMITX_AUDIO_MUTE = HDMITX_HDMI_ERROR_MASK | 16,
|
||||
HDMITX_AUDIO_UNMUTE = HDMITX_HDMI_ERROR_MASK | 17,
|
||||
|
||||
};
|
||||
|
||||
struct hdmitx_tracer;
|
||||
|
||||
Reference in New Issue
Block a user