diff options
Diffstat (limited to 'drivers/staging/sm750fb')
-rw-r--r-- | drivers/staging/sm750fb/Kconfig | 1 | ||||
-rw-r--r-- | drivers/staging/sm750fb/Makefile | 1 | ||||
-rw-r--r-- | drivers/staging/sm750fb/ddk750.h | 1 | ||||
-rw-r--r-- | drivers/staging/sm750fb/ddk750_chip.c | 27 | ||||
-rw-r--r-- | drivers/staging/sm750fb/ddk750_chip.h | 2 | ||||
-rw-r--r-- | drivers/staging/sm750fb/ddk750_display.c | 10 | ||||
-rw-r--r-- | drivers/staging/sm750fb/ddk750_display.h | 2 | ||||
-rw-r--r-- | drivers/staging/sm750fb/ddk750_dvi.c | 40 | ||||
-rw-r--r-- | drivers/staging/sm750fb/ddk750_power.h | 2 | ||||
-rw-r--r-- | drivers/staging/sm750fb/ddk750_sii164.c | 114 | ||||
-rw-r--r-- | drivers/staging/sm750fb/ddk750_swi2c.c | 1 | ||||
-rw-r--r-- | drivers/staging/sm750fb/ddk750_swi2c.h | 1 | ||||
-rw-r--r-- | drivers/staging/sm750fb/sm750.c | 7 | ||||
-rw-r--r-- | drivers/staging/sm750fb/sm750_accel.c | 32 | ||||
-rw-r--r-- | drivers/staging/sm750fb/sm750_hw.c | 2 |
15 files changed, 123 insertions, 120 deletions
diff --git a/drivers/staging/sm750fb/Kconfig b/drivers/staging/sm750fb/Kconfig index ccebc25c2ec1..fb5a086bf9b1 100644 --- a/drivers/staging/sm750fb/Kconfig +++ b/drivers/staging/sm750fb/Kconfig @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 config FB_SM750 tristate "Silicon Motion SM750 framebuffer support" depends on FB && PCI diff --git a/drivers/staging/sm750fb/Makefile b/drivers/staging/sm750fb/Makefile index 4d781f78b95c..1cf3849cef23 100644 --- a/drivers/staging/sm750fb/Makefile +++ b/drivers/staging/sm750fb/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_FB_SM750) += sm750fb.o sm750fb-objs := sm750.o sm750_hw.o sm750_accel.o sm750_cursor.o ddk750_chip.o ddk750_power.o ddk750_mode.o diff --git a/drivers/staging/sm750fb/ddk750.h b/drivers/staging/sm750fb/ddk750.h index 734010324a8f..482c1c6ba422 100644 --- a/drivers/staging/sm750fb/ddk750.h +++ b/drivers/staging/sm750fb/ddk750.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2007 by Silicon Motion, Inc. (SMI) * diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index 4c1f00f551da..5a317cc98a4b 100644 --- a/drivers/staging/sm750fb/ddk750_chip.c +++ b/drivers/staging/sm750fb/ddk750_chip.c @@ -15,14 +15,14 @@ enum logical_chip_type sm750_get_chip_type(void) return chip; } -void sm750_set_chip_type(unsigned short devId, u8 revId) +void sm750_set_chip_type(unsigned short dev_id, u8 rev_id) { - if (devId == 0x718) { + if (dev_id == 0x718) { chip = SM718; - } else if (devId == 0x750) { + } else if (dev_id == 0x750) { chip = SM750; /* SM750 and SM750LE are different in their revision ID only. */ - if (revId == SM750LE_REVISION_ID) { + if (rev_id == SM750LE_REVISION_ID) { chip = SM750LE; pr_info("found sm750le\n"); } @@ -45,7 +45,7 @@ static unsigned int get_mxclk_freq(void) OD = (pll_reg & PLL_CTRL_OD_MASK) >> PLL_CTRL_OD_SHIFT; POD = (pll_reg & PLL_CTRL_POD_MASK) >> PLL_CTRL_POD_SHIFT; - return DEFAULT_INPUT_CLOCK * M / N / (1 << OD) / (1 << POD); + return DEFAULT_INPUT_CLOCK * M / N / BIT(OD) / BIT(POD); } /* @@ -56,7 +56,7 @@ static unsigned int get_mxclk_freq(void) static void set_chip_clock(unsigned int frequency) { struct pll_value pll; - unsigned int ulActualMxClk; + unsigned int actual_mx_clk; /* Cheok_0509: For SM750LE, the chip clock is fixed. Nothing to set. */ if (sm750_get_chip_type() == SM750LE) @@ -76,7 +76,7 @@ static void set_chip_clock(unsigned int frequency) * Return value of sm750_calc_pll_value gives the actual * possible clock. */ - ulActualMxClk = sm750_calc_pll_value(frequency, &pll); + actual_mx_clk = sm750_calc_pll_value(frequency, &pll); /* Master Clock Control: MXCLK_PLL */ poke32(MXCLK_PLL_CTRL, sm750_format_pll_reg(&pll)); @@ -321,7 +321,7 @@ unsigned int sm750_calc_pll_value(unsigned int request_orig, int mini_diff; unsigned int RN, quo, rem, fl_quo; unsigned int input, request; - unsigned int tmpClock, ret; + unsigned int tmp_clock, ret; const int max_OD = 3; int max_d = 6; @@ -365,8 +365,8 @@ unsigned int sm750_calc_pll_value(unsigned int request_orig, if (M < 256 && M > 0) { unsigned int diff; - tmpClock = pll->inputFreq * M / N / X; - diff = abs(tmpClock - request_orig); + tmp_clock = pll->inputFreq * M / N / X; + diff = abs(tmp_clock - request_orig); if (diff < mini_diff) { pll->M = M; pll->N = N; @@ -375,7 +375,7 @@ unsigned int sm750_calc_pll_value(unsigned int request_orig, pll->POD = d - max_OD; pll->OD = d - pll->POD; mini_diff = diff; - ret = tmpClock; + ret = tmp_clock; } } } @@ -391,7 +391,6 @@ unsigned int sm750_format_pll_reg(struct pll_value *pPLL) unsigned int OD = pPLL->OD; unsigned int M = pPLL->M; unsigned int N = pPLL->N; - unsigned int reg = 0; /* * Note that all PLL's have the same format. Here, we just use @@ -399,13 +398,11 @@ unsigned int sm750_format_pll_reg(struct pll_value *pPLL) * register. On returning a 32 bit number, the value can be * applied to any PLL in the calling function. */ - reg = PLL_CTRL_POWER | + return PLL_CTRL_POWER | #ifndef VALIDATION_CHIP ((POD << PLL_CTRL_POD_SHIFT) & PLL_CTRL_POD_MASK) | #endif ((OD << PLL_CTRL_OD_SHIFT) & PLL_CTRL_OD_MASK) | ((N << PLL_CTRL_N_SHIFT) & PLL_CTRL_N_MASK) | ((M << PLL_CTRL_M_SHIFT) & PLL_CTRL_M_MASK); - - return reg; } diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h index c72aac21b675..3e92b3297160 100644 --- a/drivers/staging/sm750fb/ddk750_chip.h +++ b/drivers/staging/sm750fb/ddk750_chip.h @@ -93,7 +93,7 @@ struct initchip_param { }; enum logical_chip_type sm750_get_chip_type(void); -void sm750_set_chip_type(unsigned short devId, u8 revId); +void sm750_set_chip_type(unsigned short dev_id, u8 rev_id); 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); diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index f38051eedb6c..887ea8aef43f 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -85,7 +85,7 @@ static void primary_wait_vertical_sync(int delay) } } -static void swPanelPowerSequence(int disp, int delay) +static void sw_panel_power_sequence(int disp, int delay) { unsigned int reg; @@ -111,7 +111,7 @@ static void swPanelPowerSequence(int disp, int delay) primary_wait_vertical_sync(delay); } -void ddk750_setLogicalDispOut(enum disp_output output) +void ddk750_set_logical_disp_out(enum disp_output output) { unsigned int reg; @@ -147,12 +147,12 @@ void ddk750_setLogicalDispOut(enum disp_output output) if (output & PNL_SEQ_USAGE) { /* set panel sequence */ - swPanelPowerSequence((output & PNL_SEQ_MASK) >> PNL_SEQ_OFFSET, - 4); + sw_panel_power_sequence((output & PNL_SEQ_MASK) >> PNL_SEQ_OFFSET, + 4); } if (output & DAC_USAGE) - setDAC((output & DAC_MASK) >> DAC_OFFSET); + set_DAC((output & DAC_MASK) >> DAC_OFFSET); if (output & DPMS_USAGE) ddk750_set_dpms((output & DPMS_MASK) >> DPMS_OFFSET); diff --git a/drivers/staging/sm750fb/ddk750_display.h b/drivers/staging/sm750fb/ddk750_display.h index 7fd101d98199..7f713906dc16 100644 --- a/drivers/staging/sm750fb/ddk750_display.h +++ b/drivers/staging/sm750fb/ddk750_display.h @@ -102,6 +102,6 @@ enum disp_output { do_CRT_SEC = CRT_2_SEC | SEC_TP_ON | DPMS_ON | DAC_ON, }; -void ddk750_setLogicalDispOut(enum disp_output output); +void ddk750_set_logical_disp_out(enum disp_output output); #endif diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index b20d16198c17..cd564ea40779 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -30,31 +30,31 @@ static struct dvi_ctrl_device g_dcftSupportedDviController[] = { #endif }; -int dviInit(unsigned char edgeSelect, - unsigned char busSelect, - unsigned char dualEdgeClkSelect, - unsigned char hsyncEnable, - unsigned char vsyncEnable, - unsigned char deskewEnable, - unsigned char deskewSetting, - unsigned char continuousSyncEnable, - unsigned char pllFilterEnable, - unsigned char pllFilterValue) +int dviInit(unsigned char edge_select, + unsigned char bus_select, + unsigned char dual_edge_clk_select, + unsigned char hsync_enable, + unsigned char vsync_enable, + unsigned char deskew_enable, + unsigned char deskew_setting, + unsigned char continuous_sync_enable, + unsigned char pll_filter_enable, + unsigned char pll_filter_value) { struct dvi_ctrl_device *pCurrentDviCtrl; pCurrentDviCtrl = g_dcftSupportedDviController; if (pCurrentDviCtrl->pfnInit) { - return pCurrentDviCtrl->pfnInit(edgeSelect, - busSelect, - dualEdgeClkSelect, - hsyncEnable, - vsyncEnable, - deskewEnable, - deskewSetting, - continuousSyncEnable, - pllFilterEnable, - pllFilterValue); + return pCurrentDviCtrl->pfnInit(edge_select, + bus_select, + dual_edge_clk_select, + hsync_enable, + vsync_enable, + deskew_enable, + deskew_setting, + continuous_sync_enable, + pll_filter_enable, + pll_filter_value); } return -1; /* error */ } diff --git a/drivers/staging/sm750fb/ddk750_power.h b/drivers/staging/sm750fb/ddk750_power.h index e48c74ecbbd1..7002567a47d2 100644 --- a/drivers/staging/sm750fb/ddk750_power.h +++ b/drivers/staging/sm750fb/ddk750_power.h @@ -9,7 +9,7 @@ enum dpms { crtDPMS_OFF = 0x3, }; -#define setDAC(off) { \ +#define set_DAC(off) { \ poke32(MISC_CTRL, \ (peek32(MISC_CTRL) & ~MISC_CTRL_DAC_POWER_OFF) | (off)); \ } diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index 8391f57d5383..c8e856c13912 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -69,58 +69,58 @@ unsigned short sii164GetDeviceID(void) * This function initialize and detect the DVI controller chip. * * Input: - * edgeSelect - Edge Select: - * 0 = Input data is falling edge latched (falling edge - * latched first in dual edge mode) - * 1 = Input data is rising edge latched (rising edge - * latched first in dual edge mode) - * busSelect - Input Bus Select: - * 0 = Input data bus is 12-bits wide - * 1 = Input data bus is 24-bits wide - * dualEdgeClkSelect - Dual Edge Clock Select - * 0 = Input data is single edge latched - * 1 = Input data is dual edge latched - * hsyncEnable - Horizontal Sync Enable: - * 0 = HSYNC input is transmitted as fixed LOW - * 1 = HSYNC input is transmitted as is - * vsyncEnable - Vertical Sync Enable: - * 0 = VSYNC input is transmitted as fixed LOW - * 1 = VSYNC input is transmitted as is - * deskewEnable - De-skewing Enable: - * 0 = De-skew disabled - * 1 = De-skew enabled - * deskewSetting - De-skewing Setting (increment of 260psec) - * 0 = 1 step --> minimum setup / maximum hold - * 1 = 2 step - * 2 = 3 step - * 3 = 4 step - * 4 = 5 step - * 5 = 6 step - * 6 = 7 step - * 7 = 8 step --> maximum setup / minimum hold - * continuousSyncEnable- SYNC Continuous: - * 0 = Disable - * 1 = Enable - * pllFilterEnable - PLL Filter Enable - * 0 = Disable PLL Filter - * 1 = Enable PLL Filter - * pllFilterValue - PLL Filter characteristics: - * 0~7 (recommended value is 4) + * edge_select - Edge Select: + * 0 = Input data is falling edge latched (falling + * edge latched first in dual edge mode) + * 1 = Input data is rising edge latched (rising + * edge latched first in dual edge mode) + * bus_select - Input Bus Select: + * 0 = Input data bus is 12-bits wide + * 1 = Input data bus is 24-bits wide + * dual_edge_clk_select - Dual Edge Clock Select + * 0 = Input data is single edge latched + * 1 = Input data is dual edge latched + * hsync_enable - Horizontal Sync Enable: + * 0 = HSYNC input is transmitted as fixed LOW + * 1 = HSYNC input is transmitted as is + * vsync_enable - Vertical Sync Enable: + * 0 = VSYNC input is transmitted as fixed LOW + * 1 = VSYNC input is transmitted as is + * deskew_enable - De-skewing Enable: + * 0 = De-skew disabled + * 1 = De-skew enabled + * deskew_setting - De-skewing Setting (increment of 260psec) + * 0 = 1 step --> minimum setup / maximum hold + * 1 = 2 step + * 2 = 3 step + * 3 = 4 step + * 4 = 5 step + * 5 = 6 step + * 6 = 7 step + * 7 = 8 step --> maximum setup / minimum hold + * continuous_sync_enable- SYNC Continuous: + * 0 = Disable + * 1 = Enable + * pll_filter_enable - PLL Filter Enable + * 0 = Disable PLL Filter + * 1 = Enable PLL Filter + * pll_filter_value - PLL Filter characteristics: + * 0~7 (recommended value is 4) * * Output: * 0 - Success * -1 - Fail. */ -long sii164InitChip(unsigned char edgeSelect, - unsigned char busSelect, - unsigned char dualEdgeClkSelect, - unsigned char hsyncEnable, - unsigned char vsyncEnable, - unsigned char deskewEnable, - unsigned char deskewSetting, - unsigned char continuousSyncEnable, - unsigned char pllFilterEnable, - unsigned char pllFilterValue) +long sii164InitChip(unsigned char edge_select, + unsigned char bus_select, + unsigned char dual_edge_clk_select, + unsigned char hsync_enable, + unsigned char vsync_enable, + unsigned char deskew_enable, + unsigned char deskew_setting, + unsigned char continuous_sync_enable, + unsigned char pll_filter_enable, + unsigned char pll_filter_value) { unsigned char config; @@ -139,31 +139,31 @@ long sii164InitChip(unsigned char edgeSelect, */ /* Select the edge */ - if (edgeSelect == 0) + if (edge_select == 0) config = SII164_CONFIGURATION_LATCH_FALLING; else config = SII164_CONFIGURATION_LATCH_RISING; /* Select bus wide */ - if (busSelect == 0) + if (bus_select == 0) config |= SII164_CONFIGURATION_BUS_12BITS; else config |= SII164_CONFIGURATION_BUS_24BITS; /* Select Dual/Single Edge Clock */ - if (dualEdgeClkSelect == 0) + if (dual_edge_clk_select == 0) config |= SII164_CONFIGURATION_CLOCK_SINGLE; else config |= SII164_CONFIGURATION_CLOCK_DUAL; /* Select HSync Enable */ - if (hsyncEnable == 0) + if (hsync_enable == 0) config |= SII164_CONFIGURATION_HSYNC_FORCE_LOW; else config |= SII164_CONFIGURATION_HSYNC_AS_IS; /* Select VSync Enable */ - if (vsyncEnable == 0) + if (vsync_enable == 0) config |= SII164_CONFIGURATION_VSYNC_FORCE_LOW; else config |= SII164_CONFIGURATION_VSYNC_AS_IS; @@ -175,12 +175,12 @@ long sii164InitChip(unsigned char edgeSelect, * This fixes some artifacts problem in some mode on board 2.2. * Somehow this fix does not affect board 2.1. */ - if (deskewEnable == 0) + if (deskew_enable == 0) config = SII164_DESKEW_DISABLE; else config = SII164_DESKEW_ENABLE; - switch (deskewSetting) { + switch (deskew_setting) { case 0: config |= SII164_DESKEW_1_STEP; break; @@ -209,19 +209,19 @@ long sii164InitChip(unsigned char edgeSelect, i2cWriteReg(SII164_I2C_ADDRESS, SII164_DESKEW, config); /* Enable/Disable Continuous Sync. */ - if (continuousSyncEnable == 0) + if (continuous_sync_enable == 0) config = SII164_PLL_FILTER_SYNC_CONTINUOUS_DISABLE; else config = SII164_PLL_FILTER_SYNC_CONTINUOUS_ENABLE; /* Enable/Disable PLL Filter */ - if (pllFilterEnable == 0) + if (pll_filter_enable == 0) config |= SII164_PLL_FILTER_DISABLE; else config |= SII164_PLL_FILTER_ENABLE; /* Set the PLL Filter value */ - config |= ((pllFilterValue & 0x07) << 1); + config |= ((pll_filter_value & 0x07) << 1); i2cWriteReg(SII164_I2C_ADDRESS, SII164_PLL, config); diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c b/drivers/staging/sm750fb/ddk750_swi2c.c index 19c5ffc72b16..5c0ac747ea2b 100644 --- a/drivers/staging/sm750fb/ddk750_swi2c.c +++ b/drivers/staging/sm750fb/ddk750_swi2c.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Copyright (c) 2007 by Silicon Motion, Inc. (SMI) * diff --git a/drivers/staging/sm750fb/ddk750_swi2c.h b/drivers/staging/sm750fb/ddk750_swi2c.h index 3b8a96d6d25a..5868feea791b 100644 --- a/drivers/staging/sm750fb/ddk750_swi2c.h +++ b/drivers/staging/sm750fb/ddk750_swi2c.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (c) 2007 by Silicon Motion, Inc. (SMI) * diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index e9f10c2669ea..59568d18ce23 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 #include <linux/kernel.h> #include <linux/module.h> #include <linux/errno.h> @@ -695,7 +696,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par) output->paths = sm750_crt; crtc->channel = sm750_secondary; /* not consider of padding stuffs for oScreen,need fix */ - crtc->oScreen = (sm750_dev->vidmem_size >> 1); + crtc->oScreen = sm750_dev->vidmem_size >> 1; crtc->vScreen = sm750_dev->pvMem + crtc->oScreen; } break; @@ -709,7 +710,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par) output->paths = sm750_crt; crtc->channel = sm750_primary; /* not consider of padding stuffs for oScreen,need fix */ - crtc->oScreen = (sm750_dev->vidmem_size >> 1); + crtc->oScreen = sm750_dev->vidmem_size >> 1; crtc->vScreen = sm750_dev->pvMem + crtc->oScreen; } break; @@ -747,7 +748,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index) lynx750_ext, NULL, vesa_modes, }; int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE}; - static const char *mdb_desc[] = { + static const char * const mdb_desc[] = { "driver prepared modes", "kernel prepared default modedb", "kernel HELPERS prepared vesa_modes", diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index eed840b251da..dbcbbd1055da 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -155,26 +155,26 @@ unsigned int rop2) /* ROP value */ if (sBase == dBase && sPitch == dPitch) { /* Determine direction of operation */ if (sy < dy) { - /* +----------+ - * |S | - * | +----------+ - * | | | | - * | | | | - * +---|------+ | - * | D| - * +----------+ + /* +----------+ + * |S | + * | +----------+ + * | | | | + * | | | | + * +---|------+ | + * | D| + * +----------+ */ nDirection = BOTTOM_TO_TOP; } else if (sy > dy) { - /* +----------+ - * |D | - * | +----------+ - * | | | | - * | | | | - * +---|------+ | - * | S| - * +----------+ + /* +----------+ + * |D | + * | +----------+ + * | | | | + * | | | | + * +---|------+ | + * | S| + * +----------+ */ nDirection = TOP_TO_BOTTOM; diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index edeae9d06883..ea1d3d4efbc2 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -207,7 +207,7 @@ int hw_sm750_output_setMode(struct lynxfb_output *output, if (output->paths & sm750_crt) disp_set |= do_CRT_SEC; } - ddk750_setLogicalDispOut(disp_set); + ddk750_set_logical_disp_out(disp_set); } else { /* just open DISPLAY_CONTROL_750LE register bit 3:0 */ u32 reg; |