From nobody Sun Feb 8 20:34:40 2026 Received: from mail-dl1-f50.google.com (mail-dl1-f50.google.com [74.125.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1D3330DEBA for ; Wed, 4 Feb 2026 05:47:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770184080; cv=none; b=UT3BbWJ0RDIsiG3KB9mQU51mLLzfqbDyhxoLBw67AKThT0YZ6PGGjxSX/cZbansvX6p9PpkevahLEzm86jPal1QoMJuYgy7PJ1zSLTw8RMRJYCu+tiZUskCO9w+UyNRCwbvL6vbdsWnw5fZD7OVjpvyPoAaVi80Ji89vHme2yKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770184080; c=relaxed/simple; bh=ocZlK0qr9jfRRAab9a7BIVs5Qxv0a8nwFLXSKLrgh+M=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NhkFBYgu4YNwzJmgBIQwOg39+zOxHJzyiQQjW9ZG3xMOPwvyCqMIRjzFrCJDfmYj87FFuccHvLhRfJR9UeJsQ5CnuBsXubqNUBe0xgj6fb7cnvDbyiDEss4yIjbcbsHBBHc07iCrOvGG+4b2OVfL8me4+U2CDNChXjuS8lOzIQo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=X5AlxlrJ; arc=none smtp.client-ip=74.125.82.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X5AlxlrJ" Received: by mail-dl1-f50.google.com with SMTP id a92af1059eb24-124afd03fd1so9631590c88.0 for ; Tue, 03 Feb 2026 21:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770184079; x=1770788879; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=8Ki/nvE45SrA8u/YzQYabo/TMhZWJKCzdq6GePyDhuA=; b=X5AlxlrJfVFsu2hhBupNT8fS/OPCgjTHXBCoUsdbitR+F6NJxvKiW2iEZG6e+GhaZc Taf0Q6X5zXN1MqWf1BZVUCOPLy/5g4z2qtyWBNpVOlGUJOC79tpEv7E7W+ZmtMhcCzUV OnJzr24c10BrHSThYY+05s4uF5qPlD0c4sSK+kMCVdiMi15jenGEvkcKWJGSyuRU6U+1 HGboihUhpanenmLXPz2UrT0JbcliS4iRCM7QP+/4v653VH79EYQetaozxNMs514IHuvD v5Ds8u4OyDa1hSMaeywtIRhAbgprz9VWJRPh/t4v/WCoQqNjvT9vioCZQoawSZm9u+x5 Sjqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770184079; x=1770788879; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=8Ki/nvE45SrA8u/YzQYabo/TMhZWJKCzdq6GePyDhuA=; b=T1jf7at8tDP898fdmGM6tJiBhfS0N+rUUXLB+FjnHK9XJuPRGRuXNDdUlojZURXCnR mH+7M+ZKwE5wqcL69njCz0IbZRPe91YMljIY/ayiivcEp6/SLUI+FydCMsyj6HrqFz5W 1DIjZFc3j/JV7b86Mtpu9/tTycSqwNCIbqbuKvJIdtWOrYfYAVIGg4ursJoYSYx0lQpa yu0X74UR5czToDe0qlzYpcU/7saQimbGz9gRL2Ch8wCjG87Dba0wnRfFNngn/bk9oRry +nG6J/KyW0VlelQnC2apwS+MCDjrI3MAIAw5nXr/8DGpMijNPoevB4O2zZDBGTCfQGIM 5/Yg== X-Forwarded-Encrypted: i=1; AJvYcCXetjceXsIiuVjzT8FLjrooAHZb1iVHy0+7qrn0yYR9i7zECLZ+KWjQ/o1QNyr568TPdMYVagtTUl+irkM=@vger.kernel.org X-Gm-Message-State: AOJu0Yx98kkII7mZBU5U6+3JFOzDRBkecUerUFtKWywI6HEFkC2QDomn Q8qFixUSAQvO87sLFGafuV5zJTu1wHa1xmx0FFylppekBAcU+AhYqMipRQg/Cd+O2A== X-Gm-Gg: AZuq6aI4+FkXegKaVX8mV7dTIBxFkxqCGJCq0ua7Hh9CdnPEbxGjf6mFu84Qzi3glUj CUFDXNlCyi+7PYLoK0gN6sKEWB8mF2/sCAydzkYtTxyyQ/hA3Lp27Pb/J5uEyyNTlC/4eCpTRgm zlLER8O6Xu1Txi+Sf4NOHFj2bkIg1E+UBFo+cOcM+E/De1/nrsV2NgAH1WGGR5ZpX48GR/GdVdU Ldh4B5uusd/sn64JPwN+wvBWMRuCGOJrKHMeK48VDmVdfVPTNa5DvLPXEmBdh5jPVdLhuojWf8v Grg+8F2XHOAADy1akJNoKUWOWRhIC3lU3egR9zuDpig7dTUeajiYDZ8gyJjl1WkRg5MUCIRddhL SfLkLqtkvahzevlN3D233M7PsHBIKSxEiLfLJhwrpB1o1V4ldgcuJtpO2tg9w+CPCI7i2ZBBaZj zlUuJWJE1Mc2HrARyqTmYx8kgTQ92G9O6NoY/KpMHx+/rR4VTY9zvczb1Ps18CFrJUfTJH8GtNe ILeDS0uo0tqjzQ= X-Received: by 2002:a05:7022:797:b0:11a:fb3c:568b with SMTP id a92af1059eb24-126f47924femr954017c88.17.1770184078741; Tue, 03 Feb 2026 21:47:58 -0800 (PST) Received: from arch (c-76-102-62-140.hsd1.ca.comcast.net. [76.102.62.140]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-126f503ecf4sm1311119c88.15.2026.02.03.21.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Feb 2026 21:47:58 -0800 (PST) From: Shreyas Ravi To: sudipm.mukherjee@gmail.com, teddy.wang@siliconmotion.com, gregkh@linuxfoundation.org Cc: linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Shreyas Ravi Subject: [PATCH] staging: sm750fb: fix CamelCase and Hungarian prefix in variable names Date: Tue, 3 Feb 2026 21:47:53 -0800 Message-ID: <20260204054753.3137479-1-shreyasravi320@gmail.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Fix multiple coding style issues: - Rename CamelCase variables to snake_case - Drop Hungarian prefixes on variable names No functional changes. Signed-off-by: Shreyas Ravi --- drivers/staging/sm750fb/sm750.c | 132 +++++++++++++------------- drivers/staging/sm750fb/sm750.h | 16 ++-- drivers/staging/sm750fb/sm750_accel.c | 132 +++++++++++++------------- drivers/staging/sm750fb/sm750_accel.h | 44 ++++----- drivers/staging/sm750fb/sm750_hw.c | 26 ++--- 5 files changed, 175 insertions(+), 175 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm75= 0.c index dec1f6b88a7d..67cba3eb0422 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -30,14 +30,14 @@ */ =20 /* common var for all device */ -static int g_hwcursor =3D 1; -static int g_noaccel; -static int g_nomtrr; -static const char *g_fbmode[] =3D {NULL, NULL}; -static const char *g_def_fbmode =3D "1024x768-32@60"; -static char *g_settings; -static int g_dualview; -static char *g_option; +static int sm750_hwcursor =3D 1; +static int sm750_noaccel; +static int sm750_nomtrr; +static const char *sm750_fbmode[] =3D {NULL, NULL}; +static const char *sm750_def_fbmode =3D "1024x768-32@60"; +static char *sm750_settings; +static int sm750_dualview; +static char *sm750_option; =20 static const struct fb_videomode lynx750_ext[] =3D { /* 1024x600-60 VESA [1.71:1] */ @@ -609,7 +609,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par) crtc->vidmem_size >>=3D 1; =20 /* setup crtc and output member */ - sm750_dev->hw_cursor =3D g_hwcursor; + sm750_dev->hw_cursor =3D sm750_hwcursor; =20 crtc->line_pad =3D 16; crtc->xpanstep =3D 8; @@ -624,27 +624,27 @@ static int sm750fb_set_drv(struct lynxfb_par *par) output->paths =3D sm750_pnc; crtc->channel =3D sm750_primary; crtc->o_screen =3D 0; - crtc->v_screen =3D sm750_dev->pvMem; + crtc->v_screen =3D sm750_dev->v_mem; pr_info("use simul primary mode\n"); break; case sm750_simul_sec: output->paths =3D sm750_pnc; crtc->channel =3D sm750_secondary; crtc->o_screen =3D 0; - crtc->v_screen =3D sm750_dev->pvMem; + crtc->v_screen =3D sm750_dev->v_mem; break; case sm750_dual_normal: if (par->index =3D=3D 0) { output->paths =3D sm750_panel; crtc->channel =3D sm750_primary; crtc->o_screen =3D 0; - crtc->v_screen =3D sm750_dev->pvMem; + crtc->v_screen =3D sm750_dev->v_mem; } else { output->paths =3D sm750_crt; crtc->channel =3D sm750_secondary; /* not consider of padding stuffs for o_screen,need fix */ crtc->o_screen =3D sm750_dev->vidmem_size >> 1; - crtc->v_screen =3D sm750_dev->pvMem + crtc->o_screen; + crtc->v_screen =3D sm750_dev->v_mem + crtc->o_screen; } break; case sm750_dual_swap: @@ -652,7 +652,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par) output->paths =3D sm750_panel; crtc->channel =3D sm750_secondary; crtc->o_screen =3D 0; - crtc->v_screen =3D sm750_dev->pvMem; + crtc->v_screen =3D sm750_dev->v_mem; } else { output->paths =3D sm750_crt; crtc->channel =3D sm750_primary; @@ -660,7 +660,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par) * need fix */ crtc->o_screen =3D sm750_dev->vidmem_size >> 1; - crtc->v_screen =3D sm750_dev->pvMem + crtc->o_screen; + crtc->v_screen =3D sm750_dev->v_mem + crtc->o_screen; } break; default: @@ -764,51 +764,51 @@ static int lynxfb_set_fbinfo(struct fb_info *info, in= t index) * must be set after crtc member initialized */ crtc->cursor.offset =3D crtc->o_screen + crtc->vidmem_size - 1024; - crtc->cursor.mmio =3D sm750_dev->pvReg + + crtc->cursor.mmio =3D sm750_dev->v_reg + 0x800f0 + (int)crtc->channel * 0x140; =20 pr_info("crtc->cursor.mmio =3D %p\n", crtc->cursor.mmio); crtc->cursor.max_h =3D 64; crtc->cursor.max_w =3D 64; crtc->cursor.size =3D crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8; - crtc->cursor.vstart =3D sm750_dev->pvMem + crtc->cursor.offset; + crtc->cursor.vstart =3D sm750_dev->v_mem + crtc->cursor.offset; =20 memset_io(crtc->cursor.vstart, 0, crtc->cursor.size); - if (!g_hwcursor) + if (!sm750_hwcursor) sm750_hw_cursor_disable(&crtc->cursor); =20 /* set info->fbops, must be set before fb_find_mode */ if (!sm750_dev->accel_off) { /* use 2d acceleration */ - if (!g_hwcursor) + if (!sm750_hwcursor) info->fbops =3D &lynxfb_ops_accel; else info->fbops =3D &lynxfb_ops_accel_with_cursor; } else { - if (!g_hwcursor) + if (!sm750_hwcursor) info->fbops =3D &lynxfb_ops; else info->fbops =3D &lynxfb_ops_with_cursor; } =20 - if (!g_fbmode[index]) { - g_fbmode[index] =3D g_def_fbmode; + if (!sm750_fbmode[index]) { + sm750_fbmode[index] =3D sm750_def_fbmode; if (index) - g_fbmode[index] =3D g_fbmode[0]; + sm750_fbmode[index] =3D sm750_fbmode[0]; } =20 for (i =3D 0; i < 3; i++) { - ret =3D fb_find_mode(var, info, g_fbmode[index], + ret =3D fb_find_mode(var, info, sm750_fbmode[index], pdb[i], cdb[i], NULL, 8); =20 if (ret =3D=3D 1) { pr_info("success! use specified mode:%s in %s\n", - g_fbmode[index], + sm750_fbmode[index], mdb_desc[i]); break; } else if (ret =3D=3D 2) { pr_warn("use specified mode:%s in %s,with an ignored refresh rate\n", - g_fbmode[index], + sm750_fbmode[index], mdb_desc[i]); break; } else if (ret =3D=3D 3) { @@ -910,7 +910,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int = index) return ret; } =20 -/* chip specific g_option configuration routine */ +/* chip specific sm750_option configuration routine */ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src) { char *opt; @@ -921,15 +921,15 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev= , char *src) sm750_dev->init_parm.chip_clk =3D 0; sm750_dev->init_parm.mem_clk =3D 0; sm750_dev->init_parm.master_clk =3D 0; - sm750_dev->init_parm.powerMode =3D 0; - sm750_dev->init_parm.setAllEngOff =3D 0; - sm750_dev->init_parm.resetMemory =3D 1; + sm750_dev->init_parm.power_mode =3D 0; + sm750_dev->init_parm.set_all_eng_off =3D 0; + sm750_dev->init_parm.reset_memory =3D 1; =20 - /* defaultly turn g_hwcursor on for both view */ - g_hwcursor =3D 3; + /* defaultly turn sm750_hwcursor on for both view */ + sm750_hwcursor =3D 3; =20 if (!src || !*src) { - dev_warn(&sm750_dev->pdev->dev, "no specific g_option.\n"); + dev_warn(&sm750_dev->pdev->dev, "no specific sm750_option.\n"); goto NO_PARAM; } =20 @@ -942,26 +942,26 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev= , char *src) } else if (!strncmp(opt, "nocrt", strlen("nocrt"))) { sm750_dev->nocrt =3D 1; } else if (!strncmp(opt, "36bit", strlen("36bit"))) { - sm750_dev->pnltype =3D sm750_doubleTFT; + sm750_dev->pnltype =3D sm750_double_tft; } else if (!strncmp(opt, "18bit", strlen("18bit"))) { - sm750_dev->pnltype =3D sm750_dualTFT; + sm750_dev->pnltype =3D sm750_dual_tft; } else if (!strncmp(opt, "24bit", strlen("24bit"))) { - sm750_dev->pnltype =3D sm750_24TFT; + sm750_dev->pnltype =3D sm750_24_tft; } else if (!strncmp(opt, "nohwc0", strlen("nohwc0"))) { - g_hwcursor &=3D ~0x1; + sm750_hwcursor &=3D ~0x1; } else if (!strncmp(opt, "nohwc1", strlen("nohwc1"))) { - g_hwcursor &=3D ~0x2; + sm750_hwcursor &=3D ~0x2; } else if (!strncmp(opt, "nohwc", strlen("nohwc"))) { - g_hwcursor =3D 0; + sm750_hwcursor =3D 0; } else { - if (!g_fbmode[0]) { - g_fbmode[0] =3D opt; + if (!sm750_fbmode[0]) { + sm750_fbmode[0] =3D opt; dev_info(&sm750_dev->pdev->dev, - "find fbmode0 : %s\n", g_fbmode[0]); - } else if (!g_fbmode[1]) { - g_fbmode[1] =3D opt; + "find fbmode0 : %s\n", sm750_fbmode[0]); + } else if (!sm750_fbmode[1]) { + sm750_fbmode[1] =3D opt; dev_info(&sm750_dev->pdev->dev, - "find fbmode1 : %s\n", g_fbmode[1]); + "find fbmode1 : %s\n", sm750_fbmode[1]); } else { dev_warn(&sm750_dev->pdev->dev, "How many view you wann set?\n"); } @@ -1060,9 +1060,9 @@ static int lynxfb_pci_probe(struct pci_dev *pdev, sm750_dev->devid =3D pdev->device; sm750_dev->revid =3D pdev->revision; sm750_dev->pdev =3D pdev; - sm750_dev->mtrr_off =3D g_nomtrr; + sm750_dev->mtrr_off =3D sm750_nomtrr; sm750_dev->mtrr.vram =3D 0; - sm750_dev->accel_off =3D g_noaccel; + sm750_dev->accel_off =3D sm750_noaccel; spin_lock_init(&sm750_dev->slock); =20 if (!sm750_dev->accel_off) { @@ -1079,7 +1079,7 @@ static int lynxfb_pci_probe(struct pci_dev *pdev, } =20 /* call chip specific setup routine */ - sm750fb_setup(sm750_dev, g_settings); + sm750fb_setup(sm750_dev, sm750_settings); =20 /* call chip specific mmap routine */ err =3D hw_sm750_map(sm750_dev, pdev); @@ -1090,15 +1090,15 @@ static int lynxfb_pci_probe(struct pci_dev *pdev, sm750_dev->mtrr.vram =3D arch_phys_wc_add(sm750_dev->vidmem_start, sm750_dev->vidmem_size); =20 - memset_io(sm750_dev->pvMem, 0, sm750_dev->vidmem_size); + memset_io(sm750_dev->v_mem, 0, sm750_dev->vidmem_size); =20 pci_set_drvdata(pdev, sm750_dev); =20 /* call chipInit routine */ hw_sm750_inithw(sm750_dev, pdev); =20 - /* allocate frame buffer info structures according to g_dualview */ - max_fb =3D g_dualview ? 2 : 1; + /* allocate frame buffer info structures according to sm750_dualview */ + max_fb =3D sm750_dualview ? 2 : 1; for (fbidx =3D 0; fbidx < max_fb; fbidx++) { err =3D sm750fb_framebuffer_alloc(sm750_dev, fbidx); if (err) @@ -1121,9 +1121,9 @@ static void lynxfb_pci_remove(struct pci_dev *pdev) sm750fb_framebuffer_release(sm750_dev); arch_phys_wc_del(sm750_dev->mtrr.vram); =20 - iounmap(sm750_dev->pvReg); - iounmap(sm750_dev->pvMem); - kfree(g_settings); + iounmap(sm750_dev->v_reg); + iounmap(sm750_dev->v_mem); + kfree(sm750_settings); } =20 static int __init lynxfb_setup(char *options) @@ -1139,11 +1139,11 @@ static int __init lynxfb_setup(char *options) pr_info("options:%s\n", options); =20 len =3D strlen(options) + 1; - g_settings =3D kzalloc(len, GFP_KERNEL); - if (!g_settings) + sm750_settings =3D kzalloc(len, GFP_KERNEL); + if (!sm750_settings) return -ENOMEM; =20 - tmp =3D g_settings; + tmp =3D sm750_settings; =20 /* * Notes: @@ -1157,11 +1157,11 @@ static int __init lynxfb_setup(char *options) while ((opt =3D strsep(&options, ":")) !=3D NULL) { /* options that mean for any lynx chips are configured here */ if (!strncmp(opt, "noaccel", strlen("noaccel"))) { - g_noaccel =3D 1; + sm750_noaccel =3D 1; } else if (!strncmp(opt, "nomtrr", strlen("nomtrr"))) { - g_nomtrr =3D 1; + sm750_nomtrr =3D 1; } else if (!strncmp(opt, "dual", strlen("dual"))) { - g_dualview =3D 1; + sm750_dualview =3D 1; } else { strcat(tmp, opt); tmp +=3D strlen(opt); @@ -1172,8 +1172,8 @@ static int __init lynxfb_setup(char *options) } } =20 - /* misc g_settings are transport to chip specific routines */ - pr_info("parameter left for chip specific analysis:%s\n", g_settings); + /* misc sm750_settings are transport to chip specific routines */ + pr_info("parameter left for chip specific analysis:%s\n", sm750_settings); return 0; } =20 @@ -1202,7 +1202,7 @@ static int __init lynxfb_init(void) return -ENODEV; =20 #ifdef MODULE - option =3D g_option; + option =3D sm750_option; #else if (fb_get_options("sm750fb", &option)) return -ENODEV; @@ -1219,16 +1219,16 @@ static void __exit lynxfb_exit(void) } module_exit(lynxfb_exit); =20 -module_param(g_option, charp, 0444); +module_param(sm750_option, charp, 0444); =20 -MODULE_PARM_DESC(g_option, +MODULE_PARM_DESC(sm750_option, "\n\t\tCommon options:\n" "\t\tnoaccel:disable 2d capabilities\n" "\t\tnomtrr:disable MTRR attribute for video memory\n" "\t\tdualview:dual frame buffer feature enabled\n" "\t\tnohwc:disable hardware cursor\n" "\t\tUsual example:\n" - "\t\tinsmod ./sm750fb.ko g_option=3D\"noaccel,nohwc,1280x1024-8@60\"\n" + "\t\tinsmod ./sm750fb.ko sm750_option=3D\"noaccel,nohwc,1280x1024-8@60\= "\n" ); =20 MODULE_AUTHOR("monk liu "); diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm75= 0.h index 67b9bfa23f41..559a875da938 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -13,9 +13,9 @@ #endif =20 enum sm750_pnltype { - sm750_24TFT =3D 0, /* 24bit tft */ - sm750_dualTFT =3D 2, /* dual 18 bit tft */ - sm750_doubleTFT =3D 1, /* 36 bit double pixel tft */ + sm750_24_tft =3D 0, /* 24bit tft */ + sm750_dual_tft =3D 2, /* dual 18 bit tft */ + sm750_double_tft =3D 1, /* 36 bit double pixel tft */ }; =20 /* vga channel is not concerned */ @@ -39,13 +39,13 @@ enum sm750_path { }; =20 struct init_status { - ushort powerMode; + ushort power_mode; /* below three clocks are in unit of MHZ*/ ushort chip_clk; ushort mem_clk; ushort master_clk; - ushort setAllEngOff; - ushort resetMemory; + ushort set_all_eng_off; + ushort reset_memory; }; =20 struct lynx_accel { @@ -97,8 +97,8 @@ struct sm750_dev { unsigned long vidreg_start; __u32 vidmem_size; __u32 vidreg_size; - void __iomem *pvReg; - unsigned char __iomem *pvMem; + void __iomem *v_reg; + unsigned char __iomem *v_mem; /* locks*/ spinlock_t slock; =20 diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750f= b/sm750_accel.c index 046b9282b24a..b922cb4c4b9b 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -27,7 +27,7 @@ static inline u32 read_dpr(struct lynx_accel *accel, int = offset) return readl(accel->dpr_base + offset); } =20 -static inline void write_dpPort(struct lynx_accel *accel, u32 data) +static inline void write_dp_port(struct lynx_accel *accel, u32 data) { writel(data, accel->dp_port_base); } @@ -85,7 +85,7 @@ void sm750_hw_set2dformat(struct lynx_accel *accel, int f= mt) } =20 int sm750_hw_fillrect(struct lynx_accel *accel, - u32 base, u32 pitch, u32 Bpp, + u32 base, u32 pitch, u32 bytes_per_pixel, u32 x, u32 y, u32 width, u32 height, u32 color, u32 rop) { @@ -102,14 +102,14 @@ int sm750_hw_fillrect(struct lynx_accel *accel, =20 write_dpr(accel, DE_WINDOW_DESTINATION_BASE, base); /* dpr40 */ write_dpr(accel, DE_PITCH, - ((pitch / Bpp << DE_PITCH_DESTINATION_SHIFT) & + ((pitch / bytes_per_pixel << DE_PITCH_DESTINATION_SHIFT) & DE_PITCH_DESTINATION_MASK) | - (pitch / Bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */ + (pitch / bytes_per_pixel & DE_PITCH_SOURCE_MASK)); /* dpr10 */ =20 write_dpr(accel, DE_WINDOW_WIDTH, - ((pitch / Bpp << DE_WINDOW_WIDTH_DST_SHIFT) & + ((pitch / bytes_per_pixel << DE_WINDOW_WIDTH_DST_SHIFT) & DE_WINDOW_WIDTH_DST_MASK) | - (pitch / Bpp & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr44 */ + (pitch / bytes_per_pixel & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr44 */ =20 write_dpr(accel, DE_FOREGROUND, color); /* DPR14 */ =20 @@ -132,13 +132,13 @@ int sm750_hw_fillrect(struct lynx_accel *accel, /** * sm750_hw_copyarea * @accel: Acceleration device data - * @sBase: Address of source: offset in frame buffer - * @sPitch: Pitch value of source surface in BYTE + * @s_base: Address of source: offset in frame buffer + * @s_pitch: Pitch value of source surface in BYTE * @sx: Starting x coordinate of source surface * @sy: Starting y coordinate of source surface - * @dBase: Address of destination: offset in frame buffer - * @dPitch: Pitch value of destination surface in BYTE - * @Bpp: Color depth of destination surface + * @d_base: Address of destination: offset in frame buffer + * @d_pitch: Pitch value of destination surface in BYTE + * @bytes_per_pixel: Color depth of destination surface * @dx: Starting x coordinate of destination surface * @dy: Starting y coordinate of destination surface * @width: width of rectangle in pixel value @@ -146,21 +146,21 @@ int sm750_hw_fillrect(struct lynx_accel *accel, * @rop2: ROP value */ int sm750_hw_copyarea(struct lynx_accel *accel, - unsigned int sBase, unsigned int sPitch, + unsigned int s_base, unsigned int s_pitch, unsigned int sx, unsigned int sy, - unsigned int dBase, unsigned int dPitch, - unsigned int Bpp, unsigned int dx, unsigned int dy, + unsigned int d_base, unsigned int d_pitch, + unsigned int bytes_per_pixel, unsigned int dx, unsigned int dy, unsigned int width, unsigned int height, unsigned int rop2) { - unsigned int nDirection, de_ctrl; + unsigned int n_direction, de_ctrl; =20 - nDirection =3D LEFT_TO_RIGHT; + n_direction =3D LEFT_TO_RIGHT; /* Direction of ROP2 operation: 1 =3D Left to Right, (-1) =3D Right to Le= ft */ de_ctrl =3D 0; =20 /* If source and destination are the same surface, need to check for over= lay cases */ - if (sBase =3D=3D dBase && sPitch =3D=3D dPitch) { + if (s_base =3D=3D d_base && s_pitch =3D=3D d_pitch) { /* Determine direction of operation */ if (sy < dy) { /* +----------+ @@ -173,7 +173,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel, * +----------+ */ =20 - nDirection =3D BOTTOM_TO_TOP; + n_direction =3D BOTTOM_TO_TOP; } else if (sy > dy) { /* +----------+ * |D | @@ -185,7 +185,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel, * +----------+ */ =20 - nDirection =3D TOP_TO_BOTTOM; + n_direction =3D TOP_TO_BOTTOM; } else { /* sy =3D=3D dy */ =20 @@ -198,7 +198,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel, * +------+---+------+ */ =20 - nDirection =3D RIGHT_TO_LEFT; + n_direction =3D RIGHT_TO_LEFT; } else { /* sx > dx */ =20 @@ -210,12 +210,12 @@ int sm750_hw_copyarea(struct lynx_accel *accel, * +------+---+------+ */ =20 - nDirection =3D LEFT_TO_RIGHT; + n_direction =3D LEFT_TO_RIGHT; } } } =20 - if ((nDirection =3D=3D BOTTOM_TO_TOP) || (nDirection =3D=3D RIGHT_TO_LEFT= )) { + if ((n_direction =3D=3D BOTTOM_TO_TOP) || (n_direction =3D=3D RIGHT_TO_LE= FT)) { sx +=3D width - 1; sy +=3D height - 1; dx +=3D width - 1; @@ -234,14 +234,14 @@ int sm750_hw_copyarea(struct lynx_accel *accel, * It is an address offset (128 bit aligned) * from the beginning of frame buffer. */ - write_dpr(accel, DE_WINDOW_SOURCE_BASE, sBase); /* dpr40 */ + write_dpr(accel, DE_WINDOW_SOURCE_BASE, s_base); /* dpr40 */ =20 /* * 2D Destination Base. * It is an address offset (128 bit aligned) * from the beginning of frame buffer. */ - write_dpr(accel, DE_WINDOW_DESTINATION_BASE, dBase); /* dpr44 */ + write_dpr(accel, DE_WINDOW_DESTINATION_BASE, d_base); /* dpr44 */ =20 /* * Program pitch (distance between the 1st points of two adjacent lines). @@ -249,9 +249,9 @@ int sm750_hw_copyarea(struct lynx_accel *accel, * pixel values. Need Byte to pixel conversion. */ write_dpr(accel, DE_PITCH, - ((dPitch / Bpp << DE_PITCH_DESTINATION_SHIFT) & + ((d_pitch / bytes_per_pixel << DE_PITCH_DESTINATION_SHIFT) & DE_PITCH_DESTINATION_MASK) | - (sPitch / Bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */ + (s_pitch / bytes_per_pixel & DE_PITCH_SOURCE_MASK)); /* dpr10 */ =20 /* * Screen Window width in Pixels. @@ -259,9 +259,9 @@ int sm750_hw_copyarea(struct lynx_accel *accel, * for a given point. */ write_dpr(accel, DE_WINDOW_WIDTH, - ((dPitch / Bpp << DE_WINDOW_WIDTH_DST_SHIFT) & + ((d_pitch / bytes_per_pixel << DE_WINDOW_WIDTH_DST_SHIFT) & DE_WINDOW_WIDTH_DST_MASK) | - (sPitch / Bpp & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr3c */ + (s_pitch / bytes_per_pixel & DE_WINDOW_WIDTH_SRC_MASK)); /* dpr3c */ =20 if (accel->de_wait() !=3D 0) return -1; @@ -277,7 +277,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel, (height & DE_DIMENSION_Y_ET_MASK)); /* dpr08 */ =20 de_ctrl =3D (rop2 & DE_CONTROL_ROP_MASK) | DE_CONTROL_ROP_SELECT | - ((nDirection =3D=3D RIGHT_TO_LEFT) ? DE_CONTROL_DIRECTION : 0) | + ((n_direction =3D=3D RIGHT_TO_LEFT) ? DE_CONTROL_DIRECTION : 0) | DE_CONTROL_COMMAND_BITBLT | DE_CONTROL_STATUS; write_dpr(accel, DE_CONTROL, de_ctrl); /* dpr0c */ =20 @@ -299,38 +299,38 @@ static unsigned int de_get_transparency(struct lynx_a= ccel *accel) /** * sm750_hw_imageblit * @accel: Acceleration device data - * @pSrcbuf: pointer to start of source buffer in system memory - * @srcDelta: Pitch value (in bytes) of the source buffer, +ive means top = down - * and -ive mean button up - * @startBit: Mono data can start at any bit in a byte, this value should = be + * @src_buf: pointer to start of source buffer in system memory + * @src_delta: Pitch value (in bytes) of the source buffer, positive means= top down + * and negative mean bottom up + * @start_bit: Mono data can start at any bit in a byte, this value should= be * 0 to 7 - * @dBase: Address of destination: offset in frame buffer - * @dPitch: Pitch value of destination surface in BYTE - * @bytePerPixel: Color depth of destination surface + * @d_base: Address of destination: offset in frame buffer + * @d_pitch: Pitch value of destination surface in BYTE + * @byte_per_pixel: Color depth of destination surface * @dx: Starting x coordinate of destination surface * @dy: Starting y coordinate of destination surface * @width: width of rectangle in pixel value * @height: height of rectangle in pixel value - * @fColor: Foreground color (corresponding to a 1 in the monochrome data - * @bColor: Background color (corresponding to a 0 in the monochrome data + * @f_color: Foreground color (corresponding to a 1 in the monochrome data + * @b_color: Background color (corresponding to a 0 in the monochrome data * @rop2: ROP value */ -int sm750_hw_imageblit(struct lynx_accel *accel, const char *pSrcbuf, - u32 srcDelta, u32 startBit, u32 dBase, u32 dPitch, - u32 bytePerPixel, u32 dx, u32 dy, u32 width, - u32 height, u32 fColor, u32 bColor, u32 rop2) +int sm750_hw_imageblit(struct lynx_accel *accel, const char *src_buf, + u32 src_delta, u32 start_bit, u32 d_base, u32 d_pitch, + u32 byte_per_pixel, u32 dx, u32 dy, u32 width, + u32 height, u32 f_color, u32 b_color, u32 rop2) { - unsigned int ulBytesPerScan; - unsigned int ul4BytesPerScan; - unsigned int ulBytesRemain; + unsigned int bytes_per_scan; + unsigned int four_bytes_per_scan; + unsigned int bytes_remain; unsigned int de_ctrl =3D 0; - unsigned char ajRemain[4]; + unsigned char aj_remain[4]; int i, j; =20 - startBit &=3D 7; /* Just make sure the start bit is within legal range */ - ulBytesPerScan =3D (width + startBit + 7) / 8; - ul4BytesPerScan =3D ulBytesPerScan & ~3; - ulBytesRemain =3D ulBytesPerScan & 3; + start_bit &=3D 7; /* Just make sure the start bit is within legal range */ + bytes_per_scan =3D (width + start_bit + 7) / 8; + four_bytes_per_scan =3D bytes_per_scan & ~3; + bytes_remain =3D bytes_per_scan & 3; =20 if (accel->de_wait() !=3D 0) return -1; @@ -345,7 +345,7 @@ int sm750_hw_imageblit(struct lynx_accel *accel, const = char *pSrcbuf, * It is an address offset (128 bit aligned) * from the beginning of frame buffer. */ - write_dpr(accel, DE_WINDOW_DESTINATION_BASE, dBase); + write_dpr(accel, DE_WINDOW_DESTINATION_BASE, d_base); =20 /* * Program pitch (distance between the 1st points of two adjacent @@ -353,9 +353,9 @@ int sm750_hw_imageblit(struct lynx_accel *accel, const = char *pSrcbuf, * register uses pixel values. Need Byte to pixel conversion. */ write_dpr(accel, DE_PITCH, - ((dPitch / bytePerPixel << DE_PITCH_DESTINATION_SHIFT) & + ((d_pitch / byte_per_pixel << DE_PITCH_DESTINATION_SHIFT) & DE_PITCH_DESTINATION_MASK) | - (dPitch / bytePerPixel & DE_PITCH_SOURCE_MASK)); /* dpr10 */ + (d_pitch / byte_per_pixel & DE_PITCH_SOURCE_MASK)); /* dpr10 */ =20 /* * Screen Window width in Pixels. @@ -363,17 +363,17 @@ int sm750_hw_imageblit(struct lynx_accel *accel, cons= t char *pSrcbuf, * in frame buffer for a given point. */ write_dpr(accel, DE_WINDOW_WIDTH, - ((dPitch / bytePerPixel << DE_WINDOW_WIDTH_DST_SHIFT) & + ((d_pitch / byte_per_pixel << DE_WINDOW_WIDTH_DST_SHIFT) & DE_WINDOW_WIDTH_DST_MASK) | - (dPitch / bytePerPixel & DE_WINDOW_WIDTH_SRC_MASK)); + (d_pitch / byte_per_pixel & DE_WINDOW_WIDTH_SRC_MASK)); =20 /* * Note: For 2D Source in Host Write, only X_K1_MONO field is needed, * and Y_K2 field is not used. - * For mono bitmap, use startBit for X_K1. + * For mono bitmap, use start_bit for X_K1. */ write_dpr(accel, DE_SOURCE, - (startBit << DE_SOURCE_X_K1_SHIFT) & + (start_bit << DE_SOURCE_X_K1_SHIFT) & DE_SOURCE_X_K1_MONO_MASK); /* dpr00 */ =20 write_dpr(accel, DE_DESTINATION, @@ -384,8 +384,8 @@ int sm750_hw_imageblit(struct lynx_accel *accel, const = char *pSrcbuf, ((width << DE_DIMENSION_X_SHIFT) & DE_DIMENSION_X_MASK) | (height & DE_DIMENSION_Y_ET_MASK)); /* dpr08 */ =20 - write_dpr(accel, DE_FOREGROUND, fColor); - write_dpr(accel, DE_BACKGROUND, bColor); + write_dpr(accel, DE_FOREGROUND, f_color); + write_dpr(accel, DE_BACKGROUND, b_color); =20 de_ctrl =3D (rop2 & DE_CONTROL_ROP_MASK) | DE_CONTROL_ROP_SELECT | DE_CONTROL_COMMAND_HOST_WRITE | @@ -396,16 +396,16 @@ int sm750_hw_imageblit(struct lynx_accel *accel, cons= t char *pSrcbuf, /* Write MONO data (line by line) to 2D Engine data port */ for (i =3D 0; i < height; i++) { /* For each line, send the data in chunks of 4 bytes */ - for (j =3D 0; j < (ul4BytesPerScan / 4); j++) - write_dpPort(accel, *(unsigned int *)(pSrcbuf + (j * 4))); + for (j =3D 0; j < (four_bytes_per_scan / 4); j++) + write_dp_port(accel, *(unsigned int *)(src_buf + (j * 4))); =20 - if (ulBytesRemain) { - memcpy(ajRemain, pSrcbuf + ul4BytesPerScan, - ulBytesRemain); - write_dpPort(accel, *(unsigned int *)ajRemain); + if (bytes_remain) { + memcpy(aj_remain, src_buf + four_bytes_per_scan, + bytes_remain); + write_dp_port(accel, *(unsigned int *)aj_remain); } =20 - pSrcbuf +=3D srcDelta; + src_buf +=3D src_delta; } =20 return 0; diff --git a/drivers/staging/sm750fb/sm750_accel.h b/drivers/staging/sm750f= b/sm750_accel.h index 2c79cb730a0a..cae6d24d7009 100644 --- a/drivers/staging/sm750fb/sm750_accel.h +++ b/drivers/staging/sm750fb/sm750_accel.h @@ -190,19 +190,19 @@ void sm750_hw_set2dformat(struct lynx_accel *accel, i= nt fmt); void sm750_hw_de_init(struct lynx_accel *accel); =20 int sm750_hw_fillrect(struct lynx_accel *accel, - u32 base, u32 pitch, u32 Bpp, + u32 base, u32 pitch, u32 bytes_per_pixel, u32 x, u32 y, u32 width, u32 height, u32 color, u32 rop); =20 /** * sm750_hm_copyarea - * @sBase: Address of source: offset in frame buffer - * @sPitch: Pitch value of source surface in BYTE + * @s_base: Address of source: offset in frame buffer + * @s_pitch: Pitch value of source surface in BYTE * @sx: Starting x coordinate of source surface * @sy: Starting y coordinate of source surface - * @dBase: Address of destination: offset in frame buffer - * @dPitch: Pitch value of destination surface in BYTE - * @Bpp: Color depth of destination surface + * @d_base: Address of destination: offset in frame buffer + * @d_pitch: Pitch value of destination surface in BYTE + * @bytes_per_pixel: Color depth of destination surface * @dx: Starting x coordinate of destination surface * @dy: Starting y coordinate of destination surface * @width: width of rectangle in pixel value @@ -210,34 +210,34 @@ int sm750_hw_fillrect(struct lynx_accel *accel, * @rop2: ROP value */ int sm750_hw_copyarea(struct lynx_accel *accel, - unsigned int sBase, unsigned int sPitch, + unsigned int s_base, unsigned int s_pitch, unsigned int sx, unsigned int sy, - unsigned int dBase, unsigned int dPitch, - unsigned int Bpp, unsigned int dx, unsigned int dy, + unsigned int d_base, unsigned int d_pitch, + unsigned int bytes_per_pixel, unsigned int dx, unsigned int dy, unsigned int width, unsigned int height, unsigned int rop2); =20 /** * sm750_hw_imageblit - * @pSrcbuf: pointer to start of source buffer in system memory - * @srcDelta: Pitch value (in bytes) of the source buffer, +ive means top = down - *>----- and -ive mean button up - * @startBit: Mono data can start at any bit in a byte, this value should = be + * @src_buf: pointer to start of source buffer in system memory + * @src_delta: Pitch value (in bytes) of the source buffer, positive means= top down + *>----- and negative mean bottom up + * @start_bit: Mono data can start at any bit in a byte, this value should= be *>----- 0 to 7 - * @dBase: Address of destination: offset in frame buffer - * @dPitch: Pitch value of destination surface in BYTE - * @bytePerPixel: Color depth of destination surface + * @d_base: Address of destination: offset in frame buffer + * @d_pitch: Pitch value of destination surface in BYTE + * @byte_per_pixel: Color depth of destination surface * @dx: Starting x coordinate of destination surface * @dy: Starting y coordinate of destination surface * @width: width of rectangle in pixel value * @height: height of rectangle in pixel value - * @fColor: Foreground color (corresponding to a 1 in the monochrome data - * @bColor: Background color (corresponding to a 0 in the monochrome data + * @f_color: Foreground color (corresponding to a 1 in the monochrome data + * @b_color: Background color (corresponding to a 0 in the monochrome data * @rop2: ROP value */ -int sm750_hw_imageblit(struct lynx_accel *accel, const char *pSrcbuf, - u32 srcDelta, u32 startBit, u32 dBase, u32 dPitch, - u32 bytePerPixel, u32 dx, u32 dy, u32 width, - u32 height, u32 fColor, u32 bColor, u32 rop2); +int sm750_hw_imageblit(struct lynx_accel *accel, const char *src_buf, + u32 src_delta, u32 start_bit, u32 d_base, u32 d_pitch, + u32 byte_per_pixel, u32 dx, u32 dy, u32 width, + u32 height, u32 f_color, u32 b_color, u32 rop2); =20 #endif diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/s= m750_hw.c index a29faee91c78..b8bc55ba3c54 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -49,19 +49,19 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pc= i_dev *pdev) } =20 /* now map mmio and vidmem */ - sm750_dev->pvReg =3D + sm750_dev->v_reg =3D ioremap(sm750_dev->vidreg_start, sm750_dev->vidreg_size); - if (!sm750_dev->pvReg) { + if (!sm750_dev->v_reg) { pr_err("mmio failed\n"); ret =3D -EFAULT; goto exit; } - pr_info("mmio virtual addr =3D %p\n", sm750_dev->pvReg); + pr_info("mmio virtual addr =3D %p\n", sm750_dev->v_reg); =20 - sm750_dev->accel.dpr_base =3D sm750_dev->pvReg + DE_BASE_ADDR_TYPE1; - sm750_dev->accel.dp_port_base =3D sm750_dev->pvReg + DE_PORT_ADDR_TYPE1; + sm750_dev->accel.dpr_base =3D sm750_dev->v_reg + DE_BASE_ADDR_TYPE1; + sm750_dev->accel.dp_port_base =3D sm750_dev->v_reg + DE_PORT_ADDR_TYPE1; =20 - mmio750 =3D sm750_dev->pvReg; + mmio750 =3D sm750_dev->v_reg; sm750_set_chip_type(sm750_dev->devid, sm750_dev->revid); =20 sm750_dev->vidmem_start =3D pci_resource_start(pdev, 0); @@ -76,15 +76,15 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pc= i_dev *pdev) sm750_dev->vidmem_start, sm750_dev->vidmem_size); =20 /* reserve the vidmem space of smi adaptor */ - sm750_dev->pvMem =3D + sm750_dev->v_mem =3D ioremap_wc(sm750_dev->vidmem_start, sm750_dev->vidmem_size); - if (!sm750_dev->pvMem) { - iounmap(sm750_dev->pvReg); + if (!sm750_dev->v_mem) { + iounmap(sm750_dev->v_reg); pr_err("Map video memory failed\n"); ret =3D -EFAULT; goto exit; } - pr_info("video memory vaddr =3D %p\n", sm750_dev->pvMem); + pr_info("video memory vaddr =3D %p\n", sm750_dev->v_mem); exit: return ret; } @@ -134,12 +134,12 @@ int hw_sm750_inithw(struct sm750_dev *sm750_dev, stru= ct pci_dev *pdev) ~(PANEL_DISPLAY_CTRL_DUAL_DISPLAY | PANEL_DISPLAY_CTRL_DOUBLE_PIXEL); switch (sm750_dev->pnltype) { - case sm750_24TFT: + case sm750_24_tft: break; - case sm750_doubleTFT: + case sm750_double_tft: val |=3D PANEL_DISPLAY_CTRL_DOUBLE_PIXEL; break; - case sm750_dualTFT: + case sm750_dual_tft: val |=3D PANEL_DISPLAY_CTRL_DUAL_DISPLAY; break; } --=20 2.52.0