.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * WonderMedia WM8505 Frame Buffer device driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2010 Ed Spiridonov <edo.rus@gmail.com> |
---|
5 | 6 | * 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. |
---|
15 | 7 | */ |
---|
16 | 8 | |
---|
17 | 9 | #include <linux/delay.h> |
---|
.. | .. |
---|
184 | 176 | |
---|
185 | 177 | static DEVICE_ATTR_RW(contrast); |
---|
186 | 178 | |
---|
| 179 | +static struct attribute *wm8505fb_attrs[] = { |
---|
| 180 | + &dev_attr_contrast.attr, |
---|
| 181 | + NULL, |
---|
| 182 | +}; |
---|
| 183 | +ATTRIBUTE_GROUPS(wm8505fb); |
---|
| 184 | + |
---|
187 | 185 | static inline u_int chan_to_field(u_int chan, struct fb_bitfield *bf) |
---|
188 | 186 | { |
---|
189 | 187 | chan &= 0xffff; |
---|
.. | .. |
---|
248 | 246 | return 0; |
---|
249 | 247 | } |
---|
250 | 248 | |
---|
251 | | -static struct fb_ops wm8505fb_ops = { |
---|
| 249 | +static const struct fb_ops wm8505fb_ops = { |
---|
252 | 250 | .owner = THIS_MODULE, |
---|
253 | 251 | .fb_set_par = wm8505fb_set_par, |
---|
254 | 252 | .fb_setcolreg = wm8505fb_setcolreg, |
---|
.. | .. |
---|
341 | 339 | |
---|
342 | 340 | fbi->fb.fix.smem_start = fb_mem_phys; |
---|
343 | 341 | fbi->fb.fix.smem_len = fb_mem_len; |
---|
344 | | - fbi->fb.screen_base = fb_mem_virt; |
---|
| 342 | + fbi->fb.screen_buffer = fb_mem_virt; |
---|
345 | 343 | fbi->fb.screen_size = fb_mem_len; |
---|
346 | 344 | |
---|
347 | 345 | fbi->contrast = 0x10; |
---|
.. | .. |
---|
369 | 367 | return ret; |
---|
370 | 368 | } |
---|
371 | 369 | |
---|
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 | | - |
---|
376 | 370 | fb_info(&fbi->fb, "%s frame buffer at 0x%lx-0x%lx\n", |
---|
377 | 371 | fbi->fb.fix.id, fbi->fb.fix.smem_start, |
---|
378 | 372 | fbi->fb.fix.smem_start + fbi->fb.fix.smem_len - 1); |
---|
.. | .. |
---|
383 | 377 | static int wm8505fb_remove(struct platform_device *pdev) |
---|
384 | 378 | { |
---|
385 | 379 | struct wm8505fb_info *fbi = platform_get_drvdata(pdev); |
---|
386 | | - |
---|
387 | | - device_remove_file(&pdev->dev, &dev_attr_contrast); |
---|
388 | 380 | |
---|
389 | 381 | unregister_framebuffer(&fbi->fb); |
---|
390 | 382 | |
---|
.. | .. |
---|
407 | 399 | .driver = { |
---|
408 | 400 | .name = DRIVER_NAME, |
---|
409 | 401 | .of_match_table = wmt_dt_ids, |
---|
| 402 | + .dev_groups = wm8505fb_groups, |
---|
410 | 403 | }, |
---|
411 | 404 | }; |
---|
412 | 405 | |
---|