Commit 5abaa683 authored by Thomas Zimmermann's avatar Thomas Zimmermann
Browse files

drm/ast: Rename to_ast_private() to to_ast_device()



The helper to_ast_private() now upcasts to struct ast_device. Rename
it accordingly. No functional changes.

Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230221155745.27484-5-tzimmermann@suse.de
parent 37b42cf9
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@

int ast_astdp_read_edid(struct drm_device *dev, u8 *ediddata)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	u8 i = 0, j = 0;

	/*
@@ -125,7 +125,7 @@ void ast_dp_launch(struct drm_device *dev, u8 bPower)
	u8 bDPTX = 0;
	u8 bDPExecute = 1;

	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	// S3 come back, need more time to wait BMC ready.
	if (bPower)
		WaitCount = 300;
@@ -172,7 +172,7 @@ void ast_dp_launch(struct drm_device *dev, u8 bPower)

void ast_dp_power_on_off(struct drm_device *dev, bool on)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	// Read and Turn off DP PHY sleep
	u8 bE3 = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xE3, AST_DP_VIDEO_ENABLE);

@@ -188,7 +188,7 @@ void ast_dp_power_on_off(struct drm_device *dev, bool on)

void ast_dp_set_on_off(struct drm_device *dev, bool on)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	u8 video_on_off = on;

	// Video On/Off
@@ -208,7 +208,7 @@ void ast_dp_set_on_off(struct drm_device *dev, bool on)

void ast_dp_set_mode(struct drm_crtc *crtc, struct ast_vbios_mode_info *vbios_mode)
{
	struct ast_device *ast = to_ast_private(crtc->dev);
	struct ast_device *ast = to_ast_device(crtc->dev);

	u32 ulRefreshRateIndex;
	u8 ModeIdx;
+10 −10
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ static void ast_release_firmware(void *data)

static int ast_load_dp501_microcode(struct drm_device *dev)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	int ret;

	ret = request_firmware(&ast->dp501_fw, "ast_dp501_fw.bin", dev->dev);
@@ -106,7 +106,7 @@ static bool wait_fw_ready(struct ast_device *ast)

static bool ast_write_cmd(struct drm_device *dev, u8 data)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	int retry = 0;
	if (wait_nack(ast)) {
		send_nack(ast);
@@ -128,7 +128,7 @@ static bool ast_write_cmd(struct drm_device *dev, u8 data)

static bool ast_write_data(struct drm_device *dev, u8 data)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);

	if (wait_nack(ast)) {
		send_nack(ast);
@@ -146,7 +146,7 @@ static bool ast_write_data(struct drm_device *dev, u8 data)
#if 0
static bool ast_read_data(struct drm_device *dev, u8 *data)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	u8 tmp;

	*data = 0;
@@ -185,7 +185,7 @@ static u32 get_fw_base(struct ast_device *ast)

bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	u32 i, data;
	u32 boot_address;

@@ -204,7 +204,7 @@ bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size)

static bool ast_launch_m68k(struct drm_device *dev)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	u32 i, data, len = 0;
	u32 boot_address;
	u8 *fw_addr = NULL;
@@ -274,7 +274,7 @@ static bool ast_launch_m68k(struct drm_device *dev)

bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	u32 i, boot_address, offset, data;
	u32 *pEDIDidx;

@@ -334,7 +334,7 @@ bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata)

static bool ast_init_dvo(struct drm_device *dev)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	u8 jreg;
	u32 data;
	ast_write32(ast, 0xf004, 0x1e6e0000);
@@ -407,7 +407,7 @@ static bool ast_init_dvo(struct drm_device *dev)

static void ast_init_analog(struct drm_device *dev)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	u32 data;

	/*
@@ -434,7 +434,7 @@ static void ast_init_analog(struct drm_device *dev)

void ast_init_3rdtx(struct drm_device *dev)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	u8 jreg;

	if (ast->chip == AST2300 || ast->chip == AST2400) {
+1 −1
Original line number Diff line number Diff line
@@ -210,7 +210,7 @@ struct ast_device {
	const struct firmware *dp501_fw;	/* dp501 fw */
};

static inline struct ast_device *to_ast_private(struct drm_device *dev)
static inline struct ast_device *to_ast_device(struct drm_device *dev)
{
	return container_of(dev, struct ast_device, base);
}
+4 −4
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
static void ast_i2c_setsda(void *i2c_priv, int data)
{
	struct ast_i2c_chan *i2c = i2c_priv;
	struct ast_device *ast = to_ast_private(i2c->dev);
	struct ast_device *ast = to_ast_device(i2c->dev);
	int i;
	u8 ujcrb7, jtemp;

@@ -45,7 +45,7 @@ static void ast_i2c_setsda(void *i2c_priv, int data)
static void ast_i2c_setscl(void *i2c_priv, int clock)
{
	struct ast_i2c_chan *i2c = i2c_priv;
	struct ast_device *ast = to_ast_private(i2c->dev);
	struct ast_device *ast = to_ast_device(i2c->dev);
	int i;
	u8 ujcrb7, jtemp;

@@ -61,7 +61,7 @@ static void ast_i2c_setscl(void *i2c_priv, int clock)
static int ast_i2c_getsda(void *i2c_priv)
{
	struct ast_i2c_chan *i2c = i2c_priv;
	struct ast_device *ast = to_ast_private(i2c->dev);
	struct ast_device *ast = to_ast_device(i2c->dev);
	uint32_t val, val2, count, pass;

	count = 0;
@@ -83,7 +83,7 @@ static int ast_i2c_getsda(void *i2c_priv)
static int ast_i2c_getscl(void *i2c_priv)
{
	struct ast_i2c_chan *i2c = i2c_priv;
	struct ast_device *ast = to_ast_private(i2c->dev);
	struct ast_device *ast = to_ast_device(i2c->dev);
	uint32_t val, val2, count, pass;

	count = 0;
+3 −3
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ uint8_t ast_get_index_reg_mask(struct ast_device *ast,
static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev)
{
	struct device_node *np = dev->dev->of_node;
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	struct pci_dev *pdev = to_pci_dev(dev->dev);
	uint32_t data, jregd0, jregd1;

@@ -122,7 +122,7 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev)

static int ast_detect_chip(struct drm_device *dev, bool *need_post)
{
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	struct pci_dev *pdev = to_pci_dev(dev->dev);
	uint32_t jreg, scu_rev;

@@ -271,7 +271,7 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)
static int ast_get_dram_info(struct drm_device *dev)
{
	struct device_node *np = dev->dev->of_node;
	struct ast_device *ast = to_ast_private(dev);
	struct ast_device *ast = to_ast_device(dev);
	uint32_t mcr_cfg, mcr_scu_mpll, mcr_scu_strap;
	uint32_t denum, num, div, ref_pll, dsel;

Loading