#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/math64.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_mipi_dsi.h>
#include <drm/drm_of.h>
#include <drm/drm_panel.h>
#include <drm/drm_probe_helper.h>
#include "rcar_mipi_dsi.h"
#include "rcar_mipi_dsi_regs.h"
#define MHZ(v) …
enum rcar_mipi_dsi_hw_model { … };
struct rcar_mipi_dsi_device_info { … };
struct rcar_mipi_dsi { … };
struct dsi_setup_info { … };
static inline struct rcar_mipi_dsi *
bridge_to_rcar_mipi_dsi(struct drm_bridge *bridge)
{ … }
static inline struct rcar_mipi_dsi *
host_to_rcar_mipi_dsi(struct mipi_dsi_host *host)
{ … }
static const u32 hsfreqrange_table[][2] = …;
struct dsi_clk_config { … };
static const struct dsi_clk_config dsi_clk_cfg_v3u[] = …;
static const struct dsi_clk_config dsi_clk_cfg_v4h[] = …;
static void rcar_mipi_dsi_write(struct rcar_mipi_dsi *dsi, u32 reg, u32 data)
{ … }
static u32 rcar_mipi_dsi_read(struct rcar_mipi_dsi *dsi, u32 reg)
{ … }
static void rcar_mipi_dsi_clr(struct rcar_mipi_dsi *dsi, u32 reg, u32 clr)
{ … }
static void rcar_mipi_dsi_set(struct rcar_mipi_dsi *dsi, u32 reg, u32 set)
{ … }
static int rcar_mipi_dsi_write_phtw(struct rcar_mipi_dsi *dsi, u32 phtw)
{ … }
static int rcar_mipi_dsi_write_phtw_arr(struct rcar_mipi_dsi *dsi,
const u32 *phtw, unsigned int size)
{ … }
#define WRITE_PHTW(...) …
static int rcar_mipi_dsi_init_phtw_v3u(struct rcar_mipi_dsi *dsi)
{ … }
static int rcar_mipi_dsi_post_init_phtw_v3u(struct rcar_mipi_dsi *dsi)
{ … }
static int rcar_mipi_dsi_init_phtw_v4h(struct rcar_mipi_dsi *dsi,
const struct dsi_setup_info *setup_info)
{ … }
static int
rcar_mipi_dsi_post_init_phtw_v4h(struct rcar_mipi_dsi *dsi,
const struct dsi_setup_info *setup_info)
{ … }
static void rcar_mipi_dsi_pll_calc(struct rcar_mipi_dsi *dsi,
unsigned long fin_rate,
unsigned long fout_target,
struct dsi_setup_info *setup_info)
{ … }
static void rcar_mipi_dsi_parameters_calc(struct rcar_mipi_dsi *dsi,
struct clk *clk, unsigned long target,
struct dsi_setup_info *setup_info)
{ … }
static void rcar_mipi_dsi_set_display_timing(struct rcar_mipi_dsi *dsi,
const struct drm_display_mode *mode)
{ … }
static int rcar_mipi_dsi_startup(struct rcar_mipi_dsi *dsi,
const struct drm_display_mode *mode)
{ … }
static void rcar_mipi_dsi_shutdown(struct rcar_mipi_dsi *dsi)
{ … }
static int rcar_mipi_dsi_clk_enable(struct rcar_mipi_dsi *dsi)
{ … }
static void rcar_mipi_dsi_clk_disable(struct rcar_mipi_dsi *dsi)
{ … }
static int rcar_mipi_dsi_start_hs_clock(struct rcar_mipi_dsi *dsi)
{ … }
static int rcar_mipi_dsi_start_video(struct rcar_mipi_dsi *dsi)
{ … }
static void rcar_mipi_dsi_stop_video(struct rcar_mipi_dsi *dsi)
{ … }
static int rcar_mipi_dsi_attach(struct drm_bridge *bridge,
enum drm_bridge_attach_flags flags)
{ … }
static void rcar_mipi_dsi_atomic_enable(struct drm_bridge *bridge,
struct drm_bridge_state *old_bridge_state)
{ … }
static void rcar_mipi_dsi_atomic_disable(struct drm_bridge *bridge,
struct drm_bridge_state *old_bridge_state)
{ … }
void rcar_mipi_dsi_pclk_enable(struct drm_bridge *bridge,
struct drm_atomic_state *state)
{ … }
EXPORT_SYMBOL_GPL(…);
void rcar_mipi_dsi_pclk_disable(struct drm_bridge *bridge)
{ … }
EXPORT_SYMBOL_GPL(…);
static enum drm_mode_status
rcar_mipi_dsi_bridge_mode_valid(struct drm_bridge *bridge,
const struct drm_display_info *info,
const struct drm_display_mode *mode)
{ … }
static const struct drm_bridge_funcs rcar_mipi_dsi_bridge_ops = …;
static int rcar_mipi_dsi_host_attach(struct mipi_dsi_host *host,
struct mipi_dsi_device *device)
{ … }
static int rcar_mipi_dsi_host_detach(struct mipi_dsi_host *host,
struct mipi_dsi_device *device)
{ … }
static const struct mipi_dsi_host_ops rcar_mipi_dsi_host_ops = …;
static int rcar_mipi_dsi_parse_dt(struct rcar_mipi_dsi *dsi)
{ … }
static struct clk *rcar_mipi_dsi_get_clock(struct rcar_mipi_dsi *dsi,
const char *name,
bool optional)
{ … }
static int rcar_mipi_dsi_get_clocks(struct rcar_mipi_dsi *dsi)
{ … }
static int rcar_mipi_dsi_probe(struct platform_device *pdev)
{ … }
static void rcar_mipi_dsi_remove(struct platform_device *pdev)
{ … }
static const struct rcar_mipi_dsi_device_info v3u_data = …;
static const struct rcar_mipi_dsi_device_info v4h_data = …;
static const struct of_device_id rcar_mipi_dsi_of_table[] = …;
MODULE_DEVICE_TABLE(of, rcar_mipi_dsi_of_table);
static struct platform_driver rcar_mipi_dsi_platform_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;