92ecf120ba0830416f874017c2a00f3eb85ef041
[openwrt/staging/luka.git] /
1 From 6c8c9ca56ce6039ade09d26c069132538e4de9f0 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Sun, 28 Jul 2019 22:22:36 +0100
4 Subject: [PATCH] drivers: char: Use correct name for the Raspberry Pi
5 video decoder
6
7 Replace the old code name with a more appropriate name - RPiVid.
8
9 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
10 ---
11 arch/arm/boot/dts/bcm2838.dtsi | 10 +-
12 drivers/char/broadcom/Kconfig | 8 +-
13 drivers/char/broadcom/Makefile | 2 +-
14 .../broadcom/{argon-mem.c => rpivid-mem.c} | 105 +++++++++---------
15 drivers/mfd/bcm2835-pm.c | 12 +-
16 drivers/soc/bcm/bcm2835-power.c | 6 +-
17 include/linux/mfd/bcm2835-pm.h | 2 +-
18 8 files changed, 71 insertions(+), 76 deletions(-)
19 rename drivers/char/broadcom/{argon-mem.c => rpivid-mem.c} (69%)
20
21 --- a/arch/arm/boot/dts/bcm2838.dtsi
22 +++ b/arch/arm/boot/dts/bcm2838.dtsi
23 @@ -409,26 +409,26 @@
24 };
25
26 hevc-decoder@7eb00000 {
27 - compatible = "raspberrypi,argon-hevc-decoder";
28 + compatible = "raspberrypi,rpivid-hevc-decoder";
29 reg = <0x0 0x7eb00000 0x10000>;
30 status = "okay";
31 };
32
33 - argon-local-intc@7eb10000 {
34 - compatible = "raspberrypi,argon-local-intc";
35 + rpivid-local-intc@7eb10000 {
36 + compatible = "raspberrypi,rpivid-local-intc";
37 reg = <0x0 0x7eb10000 0x1000>;
38 status = "okay";
39 interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
40 };
41
42 h264-decoder@7eb20000 {
43 - compatible = "raspberrypi,argon-h264-decoder";
44 + compatible = "raspberrypi,rpivid-h264-decoder";
45 reg = <0x0 0x7eb20000 0x10000>;
46 status = "okay";
47 };
48
49 vp9-decoder@7eb30000 {
50 - compatible = "raspberrypi,argon-vp9-decoder";
51 + compatible = "raspberrypi,rpivid-vp9-decoder";
52 reg = <0x0 0x7eb30000 0x10000>;
53 status = "okay";
54 };
55 --- a/drivers/char/broadcom/Kconfig
56 +++ b/drivers/char/broadcom/Kconfig
57 @@ -50,10 +50,10 @@ config BCM2835_SMI_DEV
58 Broadcom's Secondary Memory interface. The low-level functionality is provided
59 by the SMI driver itself.
60
61 -config ARGON_MEM
62 - tristate "Character device driver for the Argon decoder hardware"
63 +config RPIVID_MEM
64 + tristate "Character device driver for the Raspberry Pi RPIVid video decoder hardware"
65 default n
66 help
67 This driver provides a character device interface for memory-map operations
68 - so userspace tools can access the control and status registers of the Argon
69 - video decoder hardware.
70 + so userspace tools can access the control and status registers of the
71 + Raspberry Pi RPiVid video decoder hardware.
72 --- a/drivers/char/broadcom/Makefile
73 +++ b/drivers/char/broadcom/Makefile
74 @@ -4,4 +4,4 @@ obj-$(CONFIG_BCM_VC_SM) += vc_sm
75
76 obj-$(CONFIG_BCM2835_DEVGPIOMEM)+= bcm2835-gpiomem.o
77 obj-$(CONFIG_BCM2835_SMI_DEV) += bcm2835_smi_dev.o
78 -obj-$(CONFIG_ARGON_MEM) += argon-mem.o
79 +obj-$(CONFIG_RPIVID_MEM) += rpivid-mem.o
80 --- a/drivers/char/broadcom/argon-mem.c
81 +++ /dev/null
82 @@ -1,277 +0,0 @@
83 -/**
84 - * argon-mem.c - character device access to the Argon decoder registers
85 - *
86 - * Based on bcm2835-gpiomem.c. Provides IO memory access to the decoder
87 - * register blocks such that ffmpeg plugins can access the hardware.
88 - *
89 - * Jonathan Bell <jonathan@raspberrypi.org>
90 - * Copyright (c) 2019, Raspberry Pi (Trading) Ltd.
91 - *
92 - * Redistribution and use in source and binary forms, with or without
93 - * modification, are permitted provided that the following conditions
94 - * are met:
95 - * 1. Redistributions of source code must retain the above copyright
96 - * notice, this list of conditions, and the following disclaimer,
97 - * without modification.
98 - * 2. Redistributions in binary form must reproduce the above copyright
99 - * notice, this list of conditions and the following disclaimer in the
100 - * documentation and/or other materials provided with the distribution.
101 - * 3. The names of the above-listed copyright holders may not be used
102 - * to endorse or promote products derived from this software without
103 - * specific prior written permission.
104 - *
105 - * ALTERNATIVELY, this software may be distributed under the terms of the
106 - * GNU General Public License ("GPL") version 2, as published by the Free
107 - * Software Foundation.
108 - *
109 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
110 - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
111 - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
112 - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
113 - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
114 - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
115 - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
116 - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
117 - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
118 - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
119 - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
120 - */
121 -
122 -#include <linux/kernel.h>
123 -#include <linux/module.h>
124 -#include <linux/of.h>
125 -#include <linux/of_device.h>
126 -#include <linux/platform_device.h>
127 -#include <linux/mm.h>
128 -#include <linux/slab.h>
129 -#include <linux/cdev.h>
130 -#include <linux/pagemap.h>
131 -#include <linux/io.h>
132 -
133 -#define DRIVER_NAME "argon-mem"
134 -#define DEVICE_MINOR 0
135 -
136 -struct argon_mem_priv {
137 - dev_t devid;
138 - struct class *class;
139 - struct cdev argon_mem_cdev;
140 - unsigned long regs_phys;
141 - unsigned long mem_window_len;
142 - struct device *dev;
143 - const char *name;
144 -};
145 -
146 -static int argon_mem_open(struct inode *inode, struct file *file)
147 -{
148 - int dev = iminor(inode);
149 - int ret = 0;
150 - struct argon_mem_priv *priv;
151 - if (dev != DEVICE_MINOR)
152 - ret = -ENXIO;
153 -
154 - priv = container_of(inode->i_cdev, struct argon_mem_priv,
155 - argon_mem_cdev);
156 - if (!priv)
157 - return -EINVAL;
158 - file->private_data = priv;
159 - return ret;
160 -}
161 -
162 -static int argon_mem_release(struct inode *inode, struct file *file)
163 -{
164 - int dev = iminor(inode);
165 - int ret = 0;
166 -
167 - if (dev != DEVICE_MINOR)
168 - ret = -ENXIO;
169 -
170 - return ret;
171 -}
172 -
173 -static const struct vm_operations_struct argon_mem_vm_ops = {
174 -#ifdef CONFIG_HAVE_IOREMAP_PROT
175 - .access = generic_access_phys
176 -#endif
177 -};
178 -
179 -static int argon_mem_mmap(struct file *file, struct vm_area_struct *vma)
180 -{
181 - struct argon_mem_priv *priv;
182 - unsigned long pages;
183 -
184 - priv = file->private_data;
185 - pages = priv->regs_phys >> PAGE_SHIFT;
186 - /*
187 - * The address decode is far larger than the actual number of registers.
188 - * Just map the whole lot in.
189 - */
190 - vma->vm_page_prot = phys_mem_access_prot(file, pages,
191 - priv->mem_window_len,
192 - vma->vm_page_prot);
193 - vma->vm_ops = &argon_mem_vm_ops;
194 - if (remap_pfn_range(vma, vma->vm_start,
195 - pages,
196 - priv->mem_window_len,
197 - vma->vm_page_prot)) {
198 - return -EAGAIN;
199 - }
200 - return 0;
201 -}
202 -
203 -static const struct file_operations
204 -argon_mem_fops = {
205 - .owner = THIS_MODULE,
206 - .open = argon_mem_open,
207 - .release = argon_mem_release,
208 - .mmap = argon_mem_mmap,
209 -};
210 -
211 -static const struct of_device_id argon_mem_of_match[];
212 -static int argon_mem_probe(struct platform_device *pdev)
213 -{
214 - int err;
215 - void *ptr_err;
216 - const struct of_device_id *id;
217 - struct device *dev = &pdev->dev;
218 - struct device *argon_mem_dev;
219 - struct resource *ioresource;
220 - struct argon_mem_priv *priv;
221 -
222 -
223 - /* Allocate buffers and instance data */
224 -
225 - priv = kzalloc(sizeof(struct argon_mem_priv), GFP_KERNEL);
226 -
227 - if (!priv) {
228 - err = -ENOMEM;
229 - goto failed_inst_alloc;
230 - }
231 - platform_set_drvdata(pdev, priv);
232 -
233 - priv->dev = dev;
234 - id = of_match_device(argon_mem_of_match, dev);
235 - if (!id)
236 - return -EINVAL;
237 - priv->name = id->data;
238 -
239 - ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
240 - if (ioresource) {
241 - priv->regs_phys = ioresource->start;
242 - priv->mem_window_len = ioresource->end - ioresource->start;
243 - } else {
244 - dev_err(priv->dev, "failed to get IO resource");
245 - err = -ENOENT;
246 - goto failed_get_resource;
247 - }
248 -
249 - /* Create character device entries */
250 -
251 - err = alloc_chrdev_region(&priv->devid,
252 - DEVICE_MINOR, 1, priv->name);
253 - if (err != 0) {
254 - dev_err(priv->dev, "unable to allocate device number");
255 - goto failed_alloc_chrdev;
256 - }
257 - cdev_init(&priv->argon_mem_cdev, &argon_mem_fops);
258 - priv->argon_mem_cdev.owner = THIS_MODULE;
259 - err = cdev_add(&priv->argon_mem_cdev, priv->devid, 1);
260 - if (err != 0) {
261 - dev_err(priv->dev, "unable to register device");
262 - goto failed_cdev_add;
263 - }
264 -
265 - /* Create sysfs entries */
266 -
267 - priv->class = class_create(THIS_MODULE, priv->name);
268 - ptr_err = priv->class;
269 - if (IS_ERR(ptr_err))
270 - goto failed_class_create;
271 -
272 - argon_mem_dev = device_create(priv->class, NULL,
273 - priv->devid, NULL,
274 - priv->name);
275 - ptr_err = argon_mem_dev;
276 - if (IS_ERR(ptr_err))
277 - goto failed_device_create;
278 -
279 - dev_info(priv->dev, "%s initialised: Registers at 0x%08lx length 0x%08lx",
280 - priv->name, priv->regs_phys, priv->mem_window_len);
281 -
282 - return 0;
283 -
284 -failed_device_create:
285 - class_destroy(priv->class);
286 -failed_class_create:
287 - cdev_del(&priv->argon_mem_cdev);
288 - err = PTR_ERR(ptr_err);
289 -failed_cdev_add:
290 - unregister_chrdev_region(priv->devid, 1);
291 -failed_alloc_chrdev:
292 -failed_get_resource:
293 - kfree(priv);
294 -failed_inst_alloc:
295 - dev_err(priv->dev, "could not load argon_mem");
296 - return err;
297 -}
298 -
299 -static int argon_mem_remove(struct platform_device *pdev)
300 -{
301 - struct device *dev = &pdev->dev;
302 - struct argon_mem_priv *priv = platform_get_drvdata(pdev);
303 -
304 - device_destroy(priv->class, priv->devid);
305 - class_destroy(priv->class);
306 - cdev_del(&priv->argon_mem_cdev);
307 - unregister_chrdev_region(priv->devid, 1);
308 - kfree(priv);
309 -
310 - dev_info(dev, "%s driver removed - OK", priv->name);
311 - return 0;
312 -}
313 -
314 -static const char argon_hevc_name[] = "argon-hevcmem";
315 -static const char argon_h264_name[] = "argon-h264mem";
316 -static const char argon_vp9_name[] = "argon-vp9mem";
317 -static const char argon_intc_name[] = "argon-intcmem";
318 -
319 -static const struct of_device_id argon_mem_of_match[] = {
320 - {
321 - .compatible = "raspberrypi,argon-hevc-decoder",
322 - .data = &argon_hevc_name,
323 - },
324 - {
325 - .compatible = "raspberrypi,argon-h264-decoder",
326 - .data = &argon_h264_name,
327 - },
328 - {
329 - .compatible = "raspberrypi,argon-vp9-decoder",
330 - .data = &argon_vp9_name,
331 - },
332 - /* The "intc" is included as this block of hardware contains the
333 - * "frame done" status flags.
334 - */
335 - {
336 - .compatible = "raspberrypi,argon-local-intc",
337 - .data = &argon_intc_name,
338 - },
339 - { /* sentinel */ },
340 -};
341 -
342 -MODULE_DEVICE_TABLE(of, argon_mem_of_match);
343 -
344 -static struct platform_driver argon_mem_driver = {
345 - .probe = argon_mem_probe,
346 - .remove = argon_mem_remove,
347 - .driver = {
348 - .name = DRIVER_NAME,
349 - .owner = THIS_MODULE,
350 - .of_match_table = argon_mem_of_match,
351 - },
352 -};
353 -
354 -module_platform_driver(argon_mem_driver);
355 -
356 -MODULE_ALIAS("platform:argon-mem");
357 -MODULE_LICENSE("GPL");
358 -MODULE_DESCRIPTION("Driver for accessing Argon decoder registers from userspace");
359 -MODULE_AUTHOR("Jonathan Bell <jonathan@raspberrypi.org>");
360 --- /dev/null
361 +++ b/drivers/char/broadcom/rpivid-mem.c
362 @@ -0,0 +1,272 @@
363 +/**
364 + * rpivid-mem.c - character device access to the RPiVid decoder registers
365 + *
366 + * Based on bcm2835-gpiomem.c. Provides IO memory access to the decoder
367 + * register blocks such that ffmpeg plugins can access the hardware.
368 + *
369 + * Jonathan Bell <jonathan@raspberrypi.org>
370 + * Copyright (c) 2019, Raspberry Pi (Trading) Ltd.
371 + *
372 + * Redistribution and use in source and binary forms, with or without
373 + * modification, are permitted provided that the following conditions
374 + * are met:
375 + * 1. Redistributions of source code must retain the above copyright
376 + * notice, this list of conditions, and the following disclaimer,
377 + * without modification.
378 + * 2. Redistributions in binary form must reproduce the above copyright
379 + * notice, this list of conditions and the following disclaimer in the
380 + * documentation and/or other materials provided with the distribution.
381 + * 3. The names of the above-listed copyright holders may not be used
382 + * to endorse or promote products derived from this software without
383 + * specific prior written permission.
384 + *
385 + * ALTERNATIVELY, this software may be distributed under the terms of the
386 + * GNU General Public License ("GPL") version 2, as published by the Free
387 + * Software Foundation.
388 + *
389 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
390 + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
391 + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
392 + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
393 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
394 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
395 + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
396 + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
397 + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
398 + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
399 + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
400 + */
401 +
402 +#include <linux/kernel.h>
403 +#include <linux/module.h>
404 +#include <linux/of.h>
405 +#include <linux/of_device.h>
406 +#include <linux/platform_device.h>
407 +#include <linux/mm.h>
408 +#include <linux/slab.h>
409 +#include <linux/cdev.h>
410 +#include <linux/pagemap.h>
411 +#include <linux/io.h>
412 +
413 +#define DRIVER_NAME "rpivid-mem"
414 +#define DEVICE_MINOR 0
415 +
416 +struct rpivid_mem_priv {
417 + dev_t devid;
418 + struct class *class;
419 + struct cdev rpivid_mem_cdev;
420 + unsigned long regs_phys;
421 + unsigned long mem_window_len;
422 + struct device *dev;
423 + const char *name;
424 +};
425 +
426 +static int rpivid_mem_open(struct inode *inode, struct file *file)
427 +{
428 + int dev = iminor(inode);
429 + int ret = 0;
430 + struct rpivid_mem_priv *priv;
431 + if (dev != DEVICE_MINOR)
432 + ret = -ENXIO;
433 +
434 + priv = container_of(inode->i_cdev, struct rpivid_mem_priv,
435 + rpivid_mem_cdev);
436 + if (!priv)
437 + return -EINVAL;
438 + file->private_data = priv;
439 + return ret;
440 +}
441 +
442 +static int rpivid_mem_release(struct inode *inode, struct file *file)
443 +{
444 + int dev = iminor(inode);
445 + int ret = 0;
446 +
447 + if (dev != DEVICE_MINOR)
448 + ret = -ENXIO;
449 +
450 + return ret;
451 +}
452 +
453 +static const struct vm_operations_struct rpivid_mem_vm_ops = {
454 +#ifdef CONFIG_HAVE_IOREMAP_PROT
455 + .access = generic_access_phys
456 +#endif
457 +};
458 +
459 +static int rpivid_mem_mmap(struct file *file, struct vm_area_struct *vma)
460 +{
461 + struct rpivid_mem_priv *priv;
462 + unsigned long pages;
463 +
464 + priv = file->private_data;
465 + pages = priv->regs_phys >> PAGE_SHIFT;
466 + /*
467 + * The address decode is far larger than the actual number of registers.
468 + * Just map the whole lot in.
469 + */
470 + vma->vm_page_prot = phys_mem_access_prot(file, pages,
471 + priv->mem_window_len,
472 + vma->vm_page_prot);
473 + vma->vm_ops = &rpivid_mem_vm_ops;
474 + if (remap_pfn_range(vma, vma->vm_start,
475 + pages,
476 + priv->mem_window_len,
477 + vma->vm_page_prot)) {
478 + return -EAGAIN;
479 + }
480 + return 0;
481 +}
482 +
483 +static const struct file_operations
484 +rpivid_mem_fops = {
485 + .owner = THIS_MODULE,
486 + .open = rpivid_mem_open,
487 + .release = rpivid_mem_release,
488 + .mmap = rpivid_mem_mmap,
489 +};
490 +
491 +static const struct of_device_id rpivid_mem_of_match[];
492 +static int rpivid_mem_probe(struct platform_device *pdev)
493 +{
494 + int err;
495 + void *ptr_err;
496 + const struct of_device_id *id;
497 + struct device *dev = &pdev->dev;
498 + struct device *rpivid_mem_dev;
499 + struct resource *ioresource;
500 + struct rpivid_mem_priv *priv;
501 +
502 +
503 + /* Allocate buffers and instance data */
504 +
505 + priv = kzalloc(sizeof(struct rpivid_mem_priv), GFP_KERNEL);
506 +
507 + if (!priv) {
508 + err = -ENOMEM;
509 + goto failed_inst_alloc;
510 + }
511 + platform_set_drvdata(pdev, priv);
512 +
513 + priv->dev = dev;
514 + id = of_match_device(rpivid_mem_of_match, dev);
515 + if (!id)
516 + return -EINVAL;
517 + priv->name = id->data;
518 +
519 + ioresource = platform_get_resource(pdev, IORESOURCE_MEM, 0);
520 + if (ioresource) {
521 + priv->regs_phys = ioresource->start;
522 + priv->mem_window_len = ioresource->end - ioresource->start;
523 + } else {
524 + dev_err(priv->dev, "failed to get IO resource");
525 + err = -ENOENT;
526 + goto failed_get_resource;
527 + }
528 +
529 + /* Create character device entries */
530 +
531 + err = alloc_chrdev_region(&priv->devid,
532 + DEVICE_MINOR, 1, priv->name);
533 + if (err != 0) {
534 + dev_err(priv->dev, "unable to allocate device number");
535 + goto failed_alloc_chrdev;
536 + }
537 + cdev_init(&priv->rpivid_mem_cdev, &rpivid_mem_fops);
538 + priv->rpivid_mem_cdev.owner = THIS_MODULE;
539 + err = cdev_add(&priv->rpivid_mem_cdev, priv->devid, 1);
540 + if (err != 0) {
541 + dev_err(priv->dev, "unable to register device");
542 + goto failed_cdev_add;
543 + }
544 +
545 + /* Create sysfs entries */
546 +
547 + priv->class = class_create(THIS_MODULE, priv->name);
548 + ptr_err = priv->class;
549 + if (IS_ERR(ptr_err))
550 + goto failed_class_create;
551 +
552 + rpivid_mem_dev = device_create(priv->class, NULL,
553 + priv->devid, NULL,
554 + priv->name);
555 + ptr_err = rpivid_mem_dev;
556 + if (IS_ERR(ptr_err))
557 + goto failed_device_create;
558 +
559 + dev_info(priv->dev, "%s initialised: Registers at 0x%08lx length 0x%08lx",
560 + priv->name, priv->regs_phys, priv->mem_window_len);
561 +
562 + return 0;
563 +
564 +failed_device_create:
565 + class_destroy(priv->class);
566 +failed_class_create:
567 + cdev_del(&priv->rpivid_mem_cdev);
568 + err = PTR_ERR(ptr_err);
569 +failed_cdev_add:
570 + unregister_chrdev_region(priv->devid, 1);
571 +failed_alloc_chrdev:
572 +failed_get_resource:
573 + kfree(priv);
574 +failed_inst_alloc:
575 + dev_err(priv->dev, "could not load rpivid_mem");
576 + return err;
577 +}
578 +
579 +static int rpivid_mem_remove(struct platform_device *pdev)
580 +{
581 + struct device *dev = &pdev->dev;
582 + struct rpivid_mem_priv *priv = platform_get_drvdata(pdev);
583 +
584 + device_destroy(priv->class, priv->devid);
585 + class_destroy(priv->class);
586 + cdev_del(&priv->rpivid_mem_cdev);
587 + unregister_chrdev_region(priv->devid, 1);
588 + kfree(priv);
589 +
590 + dev_info(dev, "%s driver removed - OK", priv->name);
591 + return 0;
592 +}
593 +
594 +static const struct of_device_id rpivid_mem_of_match[] = {
595 + {
596 + .compatible = "raspberrypi,rpivid-hevc-decoder",
597 + .data = "rpivid-hevcmem",
598 + },
599 + {
600 + .compatible = "raspberrypi,rpivid-h264-decoder",
601 + .data = "rpivid-h264mem",
602 + },
603 + {
604 + .compatible = "raspberrypi,rpivid-vp9-decoder",
605 + .data = "rpivid-vp9mem",
606 + },
607 + /* The "intc" is included as this block of hardware contains the
608 + * "frame done" status flags.
609 + */
610 + {
611 + .compatible = "raspberrypi,rpivid-local-intc",
612 + .data = "rpivid-intcmem",
613 + },
614 + { /* sentinel */ },
615 +};
616 +
617 +MODULE_DEVICE_TABLE(of, rpivid_mem_of_match);
618 +
619 +static struct platform_driver rpivid_mem_driver = {
620 + .probe = rpivid_mem_probe,
621 + .remove = rpivid_mem_remove,
622 + .driver = {
623 + .name = DRIVER_NAME,
624 + .owner = THIS_MODULE,
625 + .of_match_table = rpivid_mem_of_match,
626 + },
627 +};
628 +
629 +module_platform_driver(rpivid_mem_driver);
630 +
631 +MODULE_ALIAS("platform:rpivid-mem");
632 +MODULE_LICENSE("GPL");
633 +MODULE_DESCRIPTION("Driver for accessing RPiVid decoder registers from userspace");
634 +MODULE_AUTHOR("Jonathan Bell <jonathan@raspberrypi.org>");
635 --- a/drivers/mfd/bcm2835-pm.c
636 +++ b/drivers/mfd/bcm2835-pm.c
637 @@ -50,14 +50,14 @@ static int bcm2835_pm_probe(struct platf
638 if (ret)
639 return ret;
640
641 - /* Map the ARGON ASB regs if present. */
642 + /* Map the RPiVid ASB regs if present. */
643 res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
644 if (res) {
645 - pm->arg_asb = devm_ioremap_resource(dev, res);
646 - if (IS_ERR(pm->arg_asb)) {
647 - dev_err(dev, "Failed to map ARGON ASB: %ld\n",
648 - PTR_ERR(pm->arg_asb));
649 - return PTR_ERR(pm->arg_asb);
650 + pm->rpivid_asb = devm_ioremap_resource(dev, res);
651 + if (IS_ERR(pm->rpivid_asb)) {
652 + dev_err(dev, "Failed to map RPiVid ASB: %ld\n",
653 + PTR_ERR(pm->rpivid_asb));
654 + return PTR_ERR(pm->rpivid_asb);
655 }
656 }
657
658 --- a/drivers/soc/bcm/bcm2835-power.c
659 +++ b/drivers/soc/bcm/bcm2835-power.c
660 @@ -637,15 +637,15 @@ static int bcm2835_power_probe(struct pl
661 power->base = pm->base;
662 power->asb = pm->asb;
663
664 - /* 2711 hack: the new ARGON ASB took over V3D, which is our
665 + /* 2711 hack: the new RPiVid ASB took over V3D, which is our
666 * only consumer of this driver so far. The old ASB seems to
667 * still be present with ISP and H264 bits but no V3D, but I
668 * don't know if that's real or not. The V3D is in the same
669 * place in the new ASB as the old one, so just poke the new
670 * one for now.
671 */
672 - if (pm->arg_asb) {
673 - power->asb = pm->arg_asb;
674 + if (pm->rpivid_asb) {
675 + power->asb = pm->rpivid_asb;
676 power->is_2711 = true;
677 }
678
679 --- a/include/linux/mfd/bcm2835-pm.h
680 +++ b/include/linux/mfd/bcm2835-pm.h
681 @@ -9,7 +9,7 @@ struct bcm2835_pm {
682 struct device *dev;
683 void __iomem *base;
684 void __iomem *asb;
685 - void __iomem *arg_asb;
686 + void __iomem *rpivid_asb;
687 };
688
689 #endif /* BCM2835_MFD_PM_H */