hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/video/fbdev/wm8505fb.c
....@@ -1,17 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * WonderMedia WM8505 Frame Buffer device driver
34 *
45 * Copyright (C) 2010 Ed Spiridonov <edo.rus@gmail.com>
56 * Based on vt8500lcdfb.c
6
- *
7
- * This software is licensed under the terms of the GNU General Public
8
- * License version 2, as published by the Free Software Foundation, and
9
- * may be copied, distributed, and modified under those terms.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
157 */
168
179 #include <linux/delay.h>
....@@ -184,6 +176,12 @@
184176
185177 static DEVICE_ATTR_RW(contrast);
186178
179
+static struct attribute *wm8505fb_attrs[] = {
180
+ &dev_attr_contrast.attr,
181
+ NULL,
182
+};
183
+ATTRIBUTE_GROUPS(wm8505fb);
184
+
187185 static inline u_int chan_to_field(u_int chan, struct fb_bitfield *bf)
188186 {
189187 chan &= 0xffff;
....@@ -248,7 +246,7 @@
248246 return 0;
249247 }
250248
251
-static struct fb_ops wm8505fb_ops = {
249
+static const struct fb_ops wm8505fb_ops = {
252250 .owner = THIS_MODULE,
253251 .fb_set_par = wm8505fb_set_par,
254252 .fb_setcolreg = wm8505fb_setcolreg,
....@@ -341,7 +339,7 @@
341339
342340 fbi->fb.fix.smem_start = fb_mem_phys;
343341 fbi->fb.fix.smem_len = fb_mem_len;
344
- fbi->fb.screen_base = fb_mem_virt;
342
+ fbi->fb.screen_buffer = fb_mem_virt;
345343 fbi->fb.screen_size = fb_mem_len;
346344
347345 fbi->contrast = 0x10;
....@@ -369,10 +367,6 @@
369367 return ret;
370368 }
371369
372
- ret = device_create_file(&pdev->dev, &dev_attr_contrast);
373
- if (ret < 0)
374
- fb_warn(&fbi->fb, "failed to register attributes (%d)\n", ret);
375
-
376370 fb_info(&fbi->fb, "%s frame buffer at 0x%lx-0x%lx\n",
377371 fbi->fb.fix.id, fbi->fb.fix.smem_start,
378372 fbi->fb.fix.smem_start + fbi->fb.fix.smem_len - 1);
....@@ -383,8 +377,6 @@
383377 static int wm8505fb_remove(struct platform_device *pdev)
384378 {
385379 struct wm8505fb_info *fbi = platform_get_drvdata(pdev);
386
-
387
- device_remove_file(&pdev->dev, &dev_attr_contrast);
388380
389381 unregister_framebuffer(&fbi->fb);
390382
....@@ -407,6 +399,7 @@
407399 .driver = {
408400 .name = DRIVER_NAME,
409401 .of_match_table = wmt_dt_ids,
402
+ .dev_groups = wm8505fb_groups,
410403 },
411404 };
412405