linux/drivers/gpu/drm/sun4i/sun8i_tcon_top.c

// SPDX-License-Identifier: GPL-2.0+
/* Copyright (c) 2018 Jernej Skrabec <[email protected]> */


#include <linux/bitfield.h>
#include <linux/component.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>

#include <dt-bindings/clock/sun8i-tcon-top.h>

#include "sun8i_tcon_top.h"

struct sun8i_tcon_top_quirks {};

static bool sun8i_tcon_top_node_is_tcon_top(struct device_node *node)
{}

int sun8i_tcon_top_set_hdmi_src(struct device *dev, int tcon)
{}
EXPORT_SYMBOL();

int sun8i_tcon_top_de_config(struct device *dev, int mixer, int tcon)
{}
EXPORT_SYMBOL();


static struct clk_hw *sun8i_tcon_top_register_gate(struct device *dev,
						   const char *parent,
						   void __iomem *regs,
						   spinlock_t *lock,
						   u8 bit, int name_index)
{
	const char *clk_name, *parent_name;
	int ret, index;

	index = of_property_match_string(dev->of_node, "clock-names", parent);
	if (index < 0)
		return ERR_PTR(index);

	parent_name = of_clk_get_parent_name(dev->of_node, index);

	ret = of_property_read_string_index(dev->of_node,
					    "clock-output-names", name_index,
					    &clk_name);
	if (ret)
		return ERR_PTR(ret);

	return clk_hw_register_gate(dev, clk_name, parent_name,
				    CLK_SET_RATE_PARENT,
				    regs + TCON_TOP_GATE_SRC_REG,
				    bit, 0, lock);
};

static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
			       void *data)
{}

static void sun8i_tcon_top_unbind(struct device *dev, struct device *master,
				  void *data)
{}

static const struct component_ops sun8i_tcon_top_ops =;

static int sun8i_tcon_top_probe(struct platform_device *pdev)
{}

static void sun8i_tcon_top_remove(struct platform_device *pdev)
{}

static const struct sun8i_tcon_top_quirks sun8i_r40_tcon_top_quirks =;

static const struct sun8i_tcon_top_quirks sun20i_d1_tcon_top_quirks =;

static const struct sun8i_tcon_top_quirks sun50i_h6_tcon_top_quirks =;

/* sun4i_drv uses this list to check if a device node is a TCON TOP */
const struct of_device_id sun8i_tcon_top_of_table[] =;
MODULE_DEVICE_TABLE(of, sun8i_tcon_top_of_table);
EXPORT_SYMBOL();

static struct platform_driver sun8i_tcon_top_platform_driver =;
module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();