dp_audio.h (1545B)
1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* 3 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 4 */ 5 6#ifndef _DP_AUDIO_H_ 7#define _DP_AUDIO_H_ 8 9#include <linux/platform_device.h> 10 11#include "dp_panel.h" 12#include "dp_catalog.h" 13#include <sound/hdmi-codec.h> 14 15/** 16 * struct dp_audio 17 * @lane_count: number of lanes configured in current session 18 * @bw_code: link rate's bandwidth code for current session 19 */ 20struct dp_audio { 21 u32 lane_count; 22 u32 bw_code; 23}; 24 25/** 26 * dp_audio_get() 27 * 28 * Creates and instance of dp audio. 29 * 30 * @pdev: caller's platform device instance. 31 * @panel: an instance of dp_panel module. 32 * @catalog: an instance of dp_catalog module. 33 * 34 * Returns the error code in case of failure, otherwize 35 * an instance of newly created dp_module. 36 */ 37struct dp_audio *dp_audio_get(struct platform_device *pdev, 38 struct dp_panel *panel, 39 struct dp_catalog *catalog); 40 41/** 42 * dp_register_audio_driver() 43 * 44 * Registers DP device with hdmi_codec interface. 45 * 46 * @dev: DP device instance. 47 * @dp_audio: an instance of dp_audio module. 48 * 49 * 50 * Returns the error code in case of failure, otherwise 51 * zero on success. 52 */ 53int dp_register_audio_driver(struct device *dev, 54 struct dp_audio *dp_audio); 55 56/** 57 * dp_audio_put() 58 * 59 * Cleans the dp_audio instance. 60 * 61 * @dp_audio: an instance of dp_audio. 62 */ 63void dp_audio_put(struct dp_audio *dp_audio); 64 65int dp_audio_hw_params(struct device *dev, 66 void *data, 67 struct hdmi_codec_daifmt *daifmt, 68 struct hdmi_codec_params *params); 69 70#endif /* _DP_AUDIO_H_ */ 71 72