#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
#include <drm/drm_device.h>
#include <drm/drm_of.h>
#include <drm/drm_panel.h>
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/media-bus-format.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#define LVDS_CR …
#define LVDS_DMLCR0 …
#define LVDS_DMMCR0 …
#define LVDS_DMLCR1 …
#define LVDS_DMMCR1 …
#define LVDS_DMLCR2 …
#define LVDS_DMMCR2 …
#define LVDS_DMLCR3 …
#define LVDS_DMMCR3 …
#define LVDS_DMLCR4 …
#define LVDS_DMMCR4 …
#define LVDS_CDL1CR …
#define LVDS_CDL2CR …
#define CDL1CR_DEFAULT …
#define CDL2CR_DEFAULT …
#define LVDS_DMLCR(bit) …
#define LVDS_DMMCR(bit) …
#define LVDS_WCLKCR …
#define LVDS_HWCFGR …
#define LVDS_VERR …
#define LVDS_IPIDR …
#define LVDS_SIDR …
#define CR_LVDSEN …
#define CR_HSPOL …
#define CR_VSPOL …
#define CR_DEPOL …
#define CR_CI …
#define CR_LKMOD …
#define CR_LKPHA …
#define CR_LK1POL …
#define CR_LK2POL …
#define DMMCR_MAP0 …
#define DMMCR_MAP1 …
#define DMMCR_MAP2 …
#define DMMCR_MAP3 …
#define DMLCR_MAP4 …
#define DMLCR_MAP5 …
#define DMLCR_MAP6 …
#define CDLCR_DISTR0 …
#define CDLCR_DISTR1 …
#define CDLCR_DISTR2 …
#define CDLCR_DISTR3 …
#define CDLCR_DISTR4 …
#define PHY_GCR_BIT_CLK_OUT …
#define PHY_GCR_LS_CLK_OUT …
#define PHY_GCR_DP_CLK_OUT …
#define PHY_GCR_RSTZ …
#define PHY_GCR_DIV_RSTN …
#define PHY_SCR_TX_EN …
#define PHY_CMCR_CM_EN_DL …
#define PHY_CMCR_CM_EN_DL4 …
#define PHY_BCR1_EN_BIAS_DL …
#define PHY_BCR2_BIAS_EN …
#define PHY_BCR3_VM_EN_DL …
#define PHY_DCR_POWER_OK …
#define PHY_CFGCR_EN_DIG_DL …
#define PHY_PLLCR1_PLL_EN …
#define PHY_PLLCR1_EN_SD …
#define PHY_PLLCR1_EN_TWG …
#define PHY_PLLCR1_DIV_EN …
#define PHY_PLLCR2_NDIV …
#define PHY_PLLCR2_BDIV …
#define PHY_PLLSR_PLL_LOCK …
#define PHY_PLLSDCR1_MDIV …
#define PHY_PLLTESTCR_TDIV …
#define PHY_PLLTESTCR_CLK_EN …
#define PHY_PLLTESTCR_EN …
#define WCLKCR_SECND_CLKPIX_SEL …
#define WCLKCR_SRCSEL …
#define SLEEP_US …
#define TIMEOUT_US …
enum lvds_link_type { … };
enum lvds_pixel { … };
struct phy_reg_offsets { … };
struct lvds_phy_info { … };
static struct lvds_phy_info lvds_phy_16ff_primary = …;
static struct lvds_phy_info lvds_phy_16ff_secondary = …;
struct stm_lvds { … };
#define bridge_to_stm_lvds(b) …
#define connector_to_stm_lvds(c) …
#define lvds_is_dual_link(lvds) …
static inline void lvds_write(struct stm_lvds *lvds, u32 reg, u32 val)
{ … }
static inline u32 lvds_read(struct stm_lvds *lvds, u32 reg)
{ … }
static inline void lvds_set(struct stm_lvds *lvds, u32 reg, u32 mask)
{ … }
static inline void lvds_clear(struct stm_lvds *lvds, u32 reg, u32 mask)
{ … }
static enum lvds_pixel lvds_bitmap_jeida_rgb888[5][7] = …;
static enum lvds_pixel lvds_bitmap_vesa_rgb888[5][7] = …;
static int lvds_pll_enable(struct stm_lvds *lvds, struct lvds_phy_info *phy)
{ … }
static int pll_get_clkout_khz(int clkin_khz, int bdiv, int mdiv, int ndiv)
{ … }
#define TDIV …
#define NDIV_MIN …
#define NDIV_MAX …
#define BDIV_MIN …
#define BDIV_MAX …
#define MDIV_MIN …
#define MDIV_MAX …
static int lvds_pll_get_params(struct stm_lvds *lvds,
unsigned int clkin_khz, unsigned int clkout_khz,
unsigned int *bdiv, unsigned int *mdiv, unsigned int *ndiv)
{ … }
static void lvds_pll_config(struct stm_lvds *lvds, struct lvds_phy_info *phy)
{ … }
static int lvds_pixel_clk_enable(struct clk_hw *hw)
{ … }
static void lvds_pixel_clk_disable(struct clk_hw *hw)
{ … }
static unsigned long lvds_pixel_clk_recalc_rate(struct clk_hw *hw,
unsigned long parent_rate)
{ … }
static long lvds_pixel_clk_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate)
{ … }
static const struct clk_ops lvds_pixel_clk_ops = …;
static const struct clk_init_data clk_data = …;
static void lvds_pixel_clk_unregister(void *data)
{ … }
static int lvds_pixel_clk_register(struct stm_lvds *lvds)
{ … }
static void lvds_config_data_mapping(struct stm_lvds *lvds)
{ … }
static void lvds_config_mode(struct stm_lvds *lvds)
{ … }
static int lvds_connector_get_modes(struct drm_connector *connector)
{ … }
static int lvds_connector_atomic_check(struct drm_connector *connector,
struct drm_atomic_state *state)
{ … }
static const struct drm_connector_helper_funcs lvds_conn_helper_funcs = …;
static const struct drm_connector_funcs lvds_conn_funcs = …;
static int lvds_attach(struct drm_bridge *bridge,
enum drm_bridge_attach_flags flags)
{ … }
static void lvds_atomic_enable(struct drm_bridge *bridge,
struct drm_bridge_state *old_bridge_state)
{ … }
static void lvds_atomic_disable(struct drm_bridge *bridge,
struct drm_bridge_state *old_bridge_state)
{ … }
static const struct drm_bridge_funcs lvds_bridge_funcs = …;
static int lvds_probe(struct platform_device *pdev)
{ … }
static void lvds_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id lvds_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, lvds_dt_ids);
static struct platform_driver lvds_platform_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;