#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/clk.h>
#include <linux/irq.h>
#include <linux/math64.h>
#include <linux/mfd/syscon.h>
#include <linux/media-bus-format.h>
#include <linux/module.h>
#include <linux/mux/consumer.h>
#include <linux/of.h>
#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/sys_soc.h>
#include <linux/time64.h>
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_mipi_dsi.h>
#include <drm/drm_of.h>
#include <drm/drm_print.h>
#include <video/mipi_display.h>
#include "nwl-dsi.h"
#define DRV_NAME …
#define E11418_HS_MODE_QUIRK …
#define NWL_DSI_MIPI_FIFO_TIMEOUT …
enum transfer_direction { … };
#define NWL_DSI_ENDPOINT_LCDIF …
#define NWL_DSI_ENDPOINT_DCSS …
struct nwl_dsi_transfer { … };
struct nwl_dsi { … };
static const struct regmap_config nwl_dsi_regmap_config = …;
static inline struct nwl_dsi *bridge_to_dsi(struct drm_bridge *bridge)
{ … }
static int nwl_dsi_clear_error(struct nwl_dsi *dsi)
{ … }
static void nwl_dsi_write(struct nwl_dsi *dsi, unsigned int reg, u32 val)
{ … }
static u32 nwl_dsi_read(struct nwl_dsi *dsi, u32 reg)
{ … }
static int nwl_dsi_get_dpi_pixel_format(enum mipi_dsi_pixel_format format)
{ … }
static u32 ps2bc(struct nwl_dsi *dsi, unsigned long long ps)
{ … }
static u32 ui2bc(unsigned int ui)
{ … }
static u32 us2lp(u32 lp_clk_rate, unsigned long us)
{ … }
static int nwl_dsi_config_host(struct nwl_dsi *dsi)
{ … }
static int nwl_dsi_config_dpi(struct nwl_dsi *dsi)
{ … }
static int nwl_dsi_init_interrupts(struct nwl_dsi *dsi)
{ … }
static int nwl_dsi_host_attach(struct mipi_dsi_host *dsi_host,
struct mipi_dsi_device *device)
{ … }
static bool nwl_dsi_read_packet(struct nwl_dsi *dsi, u32 status)
{ … }
static void nwl_dsi_finish_transmission(struct nwl_dsi *dsi, u32 status)
{ … }
static void nwl_dsi_begin_transmission(struct nwl_dsi *dsi)
{ … }
static ssize_t nwl_dsi_host_transfer(struct mipi_dsi_host *dsi_host,
const struct mipi_dsi_msg *msg)
{ … }
static const struct mipi_dsi_host_ops nwl_dsi_host_ops = …;
static irqreturn_t nwl_dsi_irq_handler(int irq, void *data)
{ … }
static int nwl_dsi_mode_set(struct nwl_dsi *dsi)
{ … }
static int nwl_dsi_disable(struct nwl_dsi *dsi)
{ … }
static void
nwl_dsi_bridge_atomic_disable(struct drm_bridge *bridge,
struct drm_bridge_state *old_bridge_state)
{ … }
static int nwl_dsi_get_dphy_params(struct nwl_dsi *dsi,
const struct drm_display_mode *mode,
union phy_configure_opts *phy_opts)
{ … }
static enum drm_mode_status
nwl_dsi_bridge_mode_valid(struct drm_bridge *bridge,
const struct drm_display_info *info,
const struct drm_display_mode *mode)
{ … }
static int nwl_dsi_bridge_atomic_check(struct drm_bridge *bridge,
struct drm_bridge_state *bridge_state,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state)
{ … }
static void
nwl_dsi_bridge_mode_set(struct drm_bridge *bridge,
const struct drm_display_mode *mode,
const struct drm_display_mode *adjusted_mode)
{ … }
static void
nwl_dsi_bridge_atomic_enable(struct drm_bridge *bridge,
struct drm_bridge_state *old_bridge_state)
{ … }
static int nwl_dsi_bridge_attach(struct drm_bridge *bridge,
enum drm_bridge_attach_flags flags)
{ … }
static u32 *nwl_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge,
struct drm_bridge_state *bridge_state,
struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state,
u32 output_fmt,
unsigned int *num_input_fmts)
{ … }
static const struct drm_bridge_funcs nwl_dsi_bridge_funcs = …;
static int nwl_dsi_parse_dt(struct nwl_dsi *dsi)
{ … }
static int nwl_dsi_select_input(struct nwl_dsi *dsi)
{ … }
static int nwl_dsi_deselect_input(struct nwl_dsi *dsi)
{ … }
static const struct drm_bridge_timings nwl_dsi_timings = …;
static const struct of_device_id nwl_dsi_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, nwl_dsi_dt_ids);
static const struct soc_device_attribute nwl_dsi_quirks_match[] = …;
static int nwl_dsi_probe(struct platform_device *pdev)
{ … }
static void nwl_dsi_remove(struct platform_device *pdev)
{ … }
static struct platform_driver nwl_dsi_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;