Commit 52d0744d authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman
Browse files

staging: sm750fb: prefix global identifiers



Renaming some symbols inside this driver caused a conflict with
an existing function, which in turn results in a link error:

drivers/staging/sm750fb/sm750fb.o: In function `enable_dma':
ddk750_hwi2c.c:(.text.enable_dma+0x0): multiple definition of `enable_dma'

This adds a sm750_ prefix to each global symbol in the sm750fb
driver that does not already have one. I manually looked for the
symbols and then converted the driver using

for i in calc_pll_value format_pll_reg set_power_mode set_current_gate    \
	enable_2d_engine enable_dma enable_gpio enable_i2c hw_set2dformat \
	hw_de_init hw_fillrect hw_copyarea hw_imageblit hw_cursor_enable  \
	hw_cursor_disable hw_cursor_setSize hw_cursor_setPos		  \
	hw_cursor_setColor hw_cursor_setData hw_cursor_setData2 ;
do
		sed -i "s:\<$i\>:sm750_$i:" drivers/staging/sm750fb/*.[ch]
done

Fixes: 03140dab ("staging: sm750fb: Replace functions CamelCase naming with underscores.")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8b9fa551
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -68,16 +68,16 @@ static void set_chip_clock(unsigned int frequency)
		pll.clockType = MXCLK_PLL;

		/*
		 * Call calc_pll_value() to fill the other fields of the PLL
		 * Call sm750_calc_pll_value() to fill the other fields of the PLL
		 * structure. Sometimes, the chip cannot set up the exact
		 * clock required by the User.
		 * Return value of calc_pll_value gives the actual possible
		 * Return value of sm750_calc_pll_value gives the actual possible
		 * clock.
		 */
		ulActualMxClk = calc_pll_value(frequency, &pll);
		ulActualMxClk = sm750_calc_pll_value(frequency, &pll);

		/* Master Clock Control: MXCLK_PLL */
		POKE32(MXCLK_PLL_CTRL, format_pll_reg(&pll));
		POKE32(MXCLK_PLL_CTRL, sm750_format_pll_reg(&pll));
	}
}

@@ -121,7 +121,7 @@ static void set_memory_clock(unsigned int frequency)
			break;
		}

		set_current_gate(reg);
		sm750_set_current_gate(reg);
	}
}

@@ -173,7 +173,7 @@ static void set_master_clock(unsigned int frequency)
			break;
		}

		set_current_gate(reg);
		sm750_set_current_gate(reg);
		}
}

@@ -215,12 +215,12 @@ int ddk750_init_hw(struct initchip_param *pInitParam)

	if (pInitParam->powerMode != 0)
		pInitParam->powerMode = 0;
	set_power_mode(pInitParam->powerMode);
	sm750_set_power_mode(pInitParam->powerMode);

	/* Enable display power gate & LOCALMEM power gate*/
	reg = PEEK32(CURRENT_GATE);
	reg |= (CURRENT_GATE_DISPLAY | CURRENT_GATE_LOCALMEM);
	set_current_gate(reg);
	sm750_set_current_gate(reg);

	if (sm750_get_chip_type() != SM750LE) {
		/*	set panel pll and graphic mode via mmio_88 */
@@ -261,7 +261,7 @@ int ddk750_init_hw(struct initchip_param *pInitParam)
	}

	if (pInitParam->setAllEngOff == 1) {
		enable_2d_engine(0);
		sm750_enable_2d_engine(0);

		/* Disable Overlay, if a former application left it on */
		reg = PEEK32(VIDEO_DISPLAY_CTRL);
@@ -284,7 +284,7 @@ int ddk750_init_hw(struct initchip_param *pInitParam)
		POKE32(DMA_ABORT_INTERRUPT, reg);

		/* Disable DMA Power, if a former application left it on */
		enable_dma(0);
		sm750_enable_dma(0);
	}

	/* We can add more initialization as needed. */
@@ -309,7 +309,7 @@ int ddk750_init_hw(struct initchip_param *pInitParam)
 * M = {1,...,255}
 * N = {2,...,15}
 */
unsigned int calc_pll_value(unsigned int request_orig, struct pll_value *pll)
unsigned int sm750_calc_pll_value(unsigned int request_orig, struct pll_value *pll)
{
	/*
	 * as sm750 register definition,
@@ -381,7 +381,7 @@ unsigned int calc_pll_value(unsigned int request_orig, struct pll_value *pll)
	return ret;
}

unsigned int format_pll_reg(struct pll_value *pPLL)
unsigned int sm750_format_pll_reg(struct pll_value *pPLL)
{
#ifndef VALIDATION_CHIP
	unsigned int POD = pPLL->POD;
+2 −2
Original line number Diff line number Diff line
@@ -88,8 +88,8 @@ struct initchip_param {

logical_chip_type_t sm750_get_chip_type(void);
void sm750_set_chip_type(unsigned short devId, char revId);
unsigned int calc_pll_value(unsigned int request, struct  pll_value *pll);
unsigned int format_pll_reg(struct pll_value *pPLL);
unsigned int sm750_calc_pll_value(unsigned int request, struct  pll_value *pll);
unsigned int sm750_format_pll_reg(struct pll_value *pPLL);
unsigned int ddk750_get_vm_size(void);
int ddk750_init_hw(struct initchip_param *);

+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ unsigned char bus_speed_mode
	 * Enable Hardware I2C power.
	 * TODO: Check if we need to enable GPIO power?
	 */
	enable_i2c(1);
	sm750_enable_i2c(1);

	/* Enable the I2C Controller and set the bus speed mode */
	value = PEEK32(I2C_CTRL) & ~(I2C_CTRL_MODE | I2C_CTRL_EN);
@@ -45,7 +45,7 @@ void sm750_hw_i2c_close(void)
	POKE32(I2C_CTRL, value);

	/* Disable I2C Power */
	enable_i2c(0);
	sm750_enable_i2c(0);

	/* Set GPIO 30 & 31 back as GPIO pins */
	value = PEEK32(GPIO_MUX);
+3 −3
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam,

	if (pll->clockType == SECONDARY_PLL) {
		/* programe secondary pixel clock */
		POKE32(CRT_PLL_CTRL, format_pll_reg(pll));
		POKE32(CRT_PLL_CTRL, sm750_format_pll_reg(pll));
		POKE32(CRT_HORIZONTAL_TOTAL,
			(((pModeParam->horizontal_total - 1) <<
				CRT_HORIZONTAL_TOTAL_TOTAL_SHIFT) &
@@ -133,7 +133,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam,
	} else if (pll->clockType == PRIMARY_PLL) {
		unsigned int reserved;

		POKE32(PANEL_PLL_CTRL, format_pll_reg(pll));
		POKE32(PANEL_PLL_CTRL, sm750_format_pll_reg(pll));

		reg = ((pModeParam->horizontal_total - 1) <<
			PANEL_HORIZONTAL_TOTAL_TOTAL_SHIFT) &
@@ -210,7 +210,7 @@ int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock)
	pll.inputFreq = DEFAULT_INPUT_CLOCK;
	pll.clockType = clock;

	uiActualPixelClk = calc_pll_value(parm->pixel_clock, &pll);
	uiActualPixelClk = sm750_calc_pll_value(parm->pixel_clock, &pll);
	if (sm750_get_chip_type() == SM750LE) {
		/* set graphic mode via IO method */
		outb_p(0x88, 0x3d4);
+10 −10
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ static unsigned int get_power_mode(void)
 * SM50x can operate in one of three modes: 0, 1 or Sleep.
 * On hardware reset, power mode 0 is default.
 */
void set_power_mode(unsigned int mode)
void sm750_set_power_mode(unsigned int mode)
{
	unsigned int ctrl = 0;

@@ -72,7 +72,7 @@ void set_power_mode(unsigned int mode)
	POKE32(POWER_MODE_CTRL, ctrl);
}

void set_current_gate(unsigned int gate)
void sm750_set_current_gate(unsigned int gate)
{
	if (get_power_mode() == POWER_MODE_CTRL_MODE_MODE1)
		POKE32(MODE1_GATE, gate);
@@ -85,7 +85,7 @@ void set_current_gate(unsigned int gate)
/*
 * This function enable/disable the 2D engine.
 */
void enable_2d_engine(unsigned int enable)
void sm750_enable_2d_engine(unsigned int enable)
{
	u32 gate;

@@ -95,10 +95,10 @@ void enable_2d_engine(unsigned int enable)
	else
		gate &= ~(CURRENT_GATE_DE | CURRENT_GATE_CSC);

	set_current_gate(gate);
	sm750_set_current_gate(gate);
}

void enable_dma(unsigned int enable)
void sm750_enable_dma(unsigned int enable)
{
	u32 gate;

@@ -109,13 +109,13 @@ void enable_dma(unsigned int enable)
	else
		gate &= ~CURRENT_GATE_DMA;

	set_current_gate(gate);
	sm750_set_current_gate(gate);
}

/*
 * This function enable/disable the GPIO Engine
 */
void enable_gpio(unsigned int enable)
void sm750_enable_gpio(unsigned int enable)
{
	u32 gate;

@@ -126,13 +126,13 @@ void enable_gpio(unsigned int enable)
	else
		gate &= ~CURRENT_GATE_GPIO;

	set_current_gate(gate);
	sm750_set_current_gate(gate);
}

/*
 * This function enable/disable the I2C Engine
 */
void enable_i2c(unsigned int enable)
void sm750_enable_i2c(unsigned int enable)
{
	u32 gate;

@@ -143,7 +143,7 @@ void enable_i2c(unsigned int enable)
	else
		gate &= ~CURRENT_GATE_I2C;

	set_current_gate(gate);
	sm750_set_current_gate(gate);
}

Loading