Skip to content

Commit de82d88

Browse files
author
Phil Elwell
committed
drivers: char: Use correct name for the Raspberry Pi video decoder
Replace the old code name with a more appropriate name - RPiVid. Signed-off-by: Phil Elwell <phil@raspberrypi.org>
1 parent 55a64b5 commit de82d88

8 files changed

Lines changed: 71 additions & 76 deletions

File tree

‎arch/arm/boot/dts/bcm2838.dtsi‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -409,26 +409,26 @@
409409
};
410410

411411
hevc-decoder@7eb00000 {
412-
compatible = "raspberrypi,argon-hevc-decoder";
412+
compatible = "raspberrypi,rpivid-hevc-decoder";
413413
reg = <0x0 0x7eb00000 0x10000>;
414414
status = "okay";
415415
};
416416

417-
argon-local-intc@7eb10000 {
418-
compatible = "raspberrypi,argon-local-intc";
417+
rpivid-local-intc@7eb10000 {
418+
compatible = "raspberrypi,rpivid-local-intc";
419419
reg = <0x0 0x7eb10000 0x1000>;
420420
status = "okay";
421421
interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;
422422
};
423423

424424
h264-decoder@7eb20000 {
425-
compatible = "raspberrypi,argon-h264-decoder";
425+
compatible = "raspberrypi,rpivid-h264-decoder";
426426
reg = <0x0 0x7eb20000 0x10000>;
427427
status = "okay";
428428
};
429429

430430
vp9-decoder@7eb30000 {
431-
compatible = "raspberrypi,argon-vp9-decoder";
431+
compatible = "raspberrypi,rpivid-vp9-decoder";
432432
reg = <0x0 0x7eb30000 0x10000>;
433433
status = "okay";
434434
};

‎arch/arm/configs/bcm2711_defconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ CONFIG_BRCM_CHAR_DRIVERS=y
602602
CONFIG_BCM_VCIO=y
603603
CONFIG_BCM_VC_SM=y
604604
CONFIG_BCM2835_DEVGPIOMEM=y
605-
CONFIG_ARGON_MEM=m
605+
CONFIG_RPIVID_MEM=m
606606
# CONFIG_LEGACY_PTYS is not set
607607
CONFIG_SERIAL_8250=y
608608
# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set

‎drivers/char/broadcom/Kconfig‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ config BCM2835_SMI_DEV
5050
Broadcom's Secondary Memory interface. The low-level functionality is provided
5151
by the SMI driver itself.
5252

53-
config ARGON_MEM
54-
tristate "Character device driver for the Argon decoder hardware"
53+
config RPIVID_MEM
54+
tristate "Character device driver for the Raspberry Pi RPIVid video decoder hardware"
5555
default n
5656
help
5757
This driver provides a character device interface for memory-map operations
58-
so userspace tools can access the control and status registers of the Argon
59-
video decoder hardware.
58+
so userspace tools can access the control and status registers of the
59+
Raspberry Pi RPiVid video decoder hardware.

‎drivers/char/broadcom/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ obj-$(CONFIG_BCM_VC_SM) += vc_sm/
44

55
obj-$(CONFIG_BCM2835_DEVGPIOMEM)+= bcm2835-gpiomem.o
66
obj-$(CONFIG_BCM2835_SMI_DEV) += bcm2835_smi_dev.o
7-
obj-$(CONFIG_ARGON_MEM) += argon-mem.o
7+
obj-$(CONFIG_RPIVID_MEM) += rpivid-mem.o
Lines changed: 50 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* argon-mem.c - character device access to the Argon decoder registers
2+
* rpivid-mem.c - character device access to the RPiVid decoder registers
33
*
44
* Based on bcm2835-gpiomem.c. Provides IO memory access to the decoder
55
* register blocks such that ffmpeg plugins can access the hardware.
@@ -48,36 +48,36 @@
4848
#include <linux/pagemap.h>
4949
#include <linux/io.h>
5050

51-
#define DRIVER_NAME "argon-mem"
51+
#define DRIVER_NAME "rpivid-mem"
5252
#define DEVICE_MINOR 0
5353

54-
struct argon_mem_priv {
54+
struct rpivid_mem_priv {
5555
dev_t devid;
5656
struct class *class;
57-
struct cdev argon_mem_cdev;
57+
struct cdev rpivid_mem_cdev;
5858
unsigned long regs_phys;
5959
unsigned long mem_window_len;
6060
struct device *dev;
6161
const char *name;
6262
};
6363

64-
static int argon_mem_open(struct inode *inode, struct file *file)
64+
static int rpivid_mem_open(struct inode *inode, struct file *file)
6565
{
6666
int dev = iminor(inode);
6767
int ret = 0;
68-
struct argon_mem_priv *priv;
68+
struct rpivid_mem_priv *priv;
6969
if (dev != DEVICE_MINOR)
7070
ret = -ENXIO;
7171

72-
priv = container_of(inode->i_cdev, struct argon_mem_priv,
73-
argon_mem_cdev);
72+
priv = container_of(inode->i_cdev, struct rpivid_mem_priv,
73+
rpivid_mem_cdev);
7474
if (!priv)
7575
return -EINVAL;
7676
file->private_data = priv;
7777
return ret;
7878
}
7979

80-
static int argon_mem_release(struct inode *inode, struct file *file)
80+
static int rpivid_mem_release(struct inode *inode, struct file *file)
8181
{
8282
int dev = iminor(inode);
8383
int ret = 0;
@@ -88,15 +88,15 @@ static int argon_mem_release(struct inode *inode, struct file *file)
8888
return ret;
8989
}
9090

91-
static const struct vm_operations_struct argon_mem_vm_ops = {
91+
static const struct vm_operations_struct rpivid_mem_vm_ops = {
9292
#ifdef CONFIG_HAVE_IOREMAP_PROT
9393
.access = generic_access_phys
9494
#endif
9595
};
9696

97-
static int argon_mem_mmap(struct file *file, struct vm_area_struct *vma)
97+
static int rpivid_mem_mmap(struct file *file, struct vm_area_struct *vma)
9898
{
99-
struct argon_mem_priv *priv;
99+
struct rpivid_mem_priv *priv;
100100
unsigned long pages;
101101

102102
priv = file->private_data;
@@ -108,7 +108,7 @@ static int argon_mem_mmap(struct file *file, struct vm_area_struct *vma)
108108
vma->vm_page_prot = phys_mem_access_prot(file, pages,
109109
priv->mem_window_len,
110110
vma->vm_page_prot);
111-
vma->vm_ops = &argon_mem_vm_ops;
111+
vma->vm_ops = &rpivid_mem_vm_ops;
112112
if (remap_pfn_range(vma, vma->vm_start,
113113
pages,
114114
priv->mem_window_len,
@@ -119,28 +119,28 @@ static int argon_mem_mmap(struct file *file, struct vm_area_struct *vma)
119119
}
120120

121121
static const struct file_operations
122-
argon_mem_fops = {
122+
rpivid_mem_fops = {
123123
.owner = THIS_MODULE,
124-
.open = argon_mem_open,
125-
.release = argon_mem_release,
126-
.mmap = argon_mem_mmap,
124+
.open = rpivid_mem_open,
125+
.release = rpivid_mem_release,
126+
.mmap = rpivid_mem_mmap,
127127
};
128128

129-
static const struct of_device_id argon_mem_of_match[];
130-
static int argon_mem_probe(struct platform_device *pdev)
129+
static const struct of_device_id rpivid_mem_of_match[];
130+
static int rpivid_mem_probe(struct platform_device *pdev)
131131
{
132132
int err;
133133
void *ptr_err;
134134
const struct of_device_id *id;
135135
struct device *dev = &pdev->dev;
136-
struct device *argon_mem_dev;
136+
struct device *rpivid_mem_dev;
137137
struct resource *ioresource;
138-
struct argon_mem_priv *priv;
138+
struct rpivid_mem_priv *priv;
139139

140140

141141
/* Allocate buffers and instance data */
142142

143-
priv = kzalloc(sizeof(struct argon_mem_priv), GFP_KERNEL);
143+
priv = kzalloc(sizeof(struct rpivid_mem_priv), GFP_KERNEL);
144144

145145
if (!priv) {
146146
err = -ENOMEM;
@@ -149,7 +149,7 @@ static int argon_mem_probe(struct platform_device *pdev)
149149
platform_set_drvdata(pdev, priv);
150150

151151
priv->dev = dev;
152-
id = of_match_device(argon_mem_of_match, dev);
152+
id = of_match_device(rpivid_mem_of_match, dev);
153153
if (!id)
154154
return -EINVAL;
155155
priv->name = id->data;
@@ -172,9 +172,9 @@ static int argon_mem_probe(struct platform_device *pdev)
172172
dev_err(priv->dev, "unable to allocate device number");
173173
goto failed_alloc_chrdev;
174174
}
175-
cdev_init(&priv->argon_mem_cdev, &argon_mem_fops);
176-
priv->argon_mem_cdev.owner = THIS_MODULE;
177-
err = cdev_add(&priv->argon_mem_cdev, priv->devid, 1);
175+
cdev_init(&priv->rpivid_mem_cdev, &rpivid_mem_fops);
176+
priv->rpivid_mem_cdev.owner = THIS_MODULE;
177+
err = cdev_add(&priv->rpivid_mem_cdev, priv->devid, 1);
178178
if (err != 0) {
179179
dev_err(priv->dev, "unable to register device");
180180
goto failed_cdev_add;
@@ -187,10 +187,10 @@ static int argon_mem_probe(struct platform_device *pdev)
187187
if (IS_ERR(ptr_err))
188188
goto failed_class_create;
189189

190-
argon_mem_dev = device_create(priv->class, NULL,
190+
rpivid_mem_dev = device_create(priv->class, NULL,
191191
priv->devid, NULL,
192192
priv->name);
193-
ptr_err = argon_mem_dev;
193+
ptr_err = rpivid_mem_dev;
194194
if (IS_ERR(ptr_err))
195195
goto failed_device_create;
196196

@@ -202,76 +202,71 @@ static int argon_mem_probe(struct platform_device *pdev)
202202
failed_device_create:
203203
class_destroy(priv->class);
204204
failed_class_create:
205-
cdev_del(&priv->argon_mem_cdev);
205+
cdev_del(&priv->rpivid_mem_cdev);
206206
err = PTR_ERR(ptr_err);
207207
failed_cdev_add:
208208
unregister_chrdev_region(priv->devid, 1);
209209
failed_alloc_chrdev:
210210
failed_get_resource:
211211
kfree(priv);
212212
failed_inst_alloc:
213-
dev_err(priv->dev, "could not load argon_mem");
213+
dev_err(priv->dev, "could not load rpivid_mem");
214214
return err;
215215
}
216216

217-
static int argon_mem_remove(struct platform_device *pdev)
217+
static int rpivid_mem_remove(struct platform_device *pdev)
218218
{
219219
struct device *dev = &pdev->dev;
220-
struct argon_mem_priv *priv = platform_get_drvdata(pdev);
220+
struct rpivid_mem_priv *priv = platform_get_drvdata(pdev);
221221

222222
device_destroy(priv->class, priv->devid);
223223
class_destroy(priv->class);
224-
cdev_del(&priv->argon_mem_cdev);
224+
cdev_del(&priv->rpivid_mem_cdev);
225225
unregister_chrdev_region(priv->devid, 1);
226226
kfree(priv);
227227

228228
dev_info(dev, "%s driver removed - OK", priv->name);
229229
return 0;
230230
}
231231

232-
static const char argon_hevc_name[] = "argon-hevcmem";
233-
static const char argon_h264_name[] = "argon-h264mem";
234-
static const char argon_vp9_name[] = "argon-vp9mem";
235-
static const char argon_intc_name[] = "argon-intcmem";
236-
237-
static const struct of_device_id argon_mem_of_match[] = {
232+
static const struct of_device_id rpivid_mem_of_match[] = {
238233
{
239-
.compatible = "raspberrypi,argon-hevc-decoder",
240-
.data = &argon_hevc_name,
234+
.compatible = "raspberrypi,rpivid-hevc-decoder",
235+
.data = "rpivid-hevcmem",
241236
},
242237
{
243-
.compatible = "raspberrypi,argon-h264-decoder",
244-
.data = &argon_h264_name,
238+
.compatible = "raspberrypi,rpivid-h264-decoder",
239+
.data = "rpivid-h264mem",
245240
},
246241
{
247-
.compatible = "raspberrypi,argon-vp9-decoder",
248-
.data = &argon_vp9_name,
242+
.compatible = "raspberrypi,rpivid-vp9-decoder",
243+
.data = "rpivid-vp9mem",
249244
},
250245
/* The "intc" is included as this block of hardware contains the
251246
* "frame done" status flags.
252247
*/
253248
{
254-
.compatible = "raspberrypi,argon-local-intc",
255-
.data = &argon_intc_name,
249+
.compatible = "raspberrypi,rpivid-local-intc",
250+
.data = "rpivid-intcmem",
256251
},
257252
{ /* sentinel */ },
258253
};
259254

260-
MODULE_DEVICE_TABLE(of, argon_mem_of_match);
255+
MODULE_DEVICE_TABLE(of, rpivid_mem_of_match);
261256

262-
static struct platform_driver argon_mem_driver = {
263-
.probe = argon_mem_probe,
264-
.remove = argon_mem_remove,
257+
static struct platform_driver rpivid_mem_driver = {
258+
.probe = rpivid_mem_probe,
259+
.remove = rpivid_mem_remove,
265260
.driver = {
266261
.name = DRIVER_NAME,
267262
.owner = THIS_MODULE,
268-
.of_match_table = argon_mem_of_match,
263+
.of_match_table = rpivid_mem_of_match,
269264
},
270265
};
271266

272-
module_platform_driver(argon_mem_driver);
267+
module_platform_driver(rpivid_mem_driver);
273268

274-
MODULE_ALIAS("platform:argon-mem");
269+
MODULE_ALIAS("platform:rpivid-mem");
275270
MODULE_LICENSE("GPL");
276-
MODULE_DESCRIPTION("Driver for accessing Argon decoder registers from userspace");
271+
MODULE_DESCRIPTION("Driver for accessing RPiVid decoder registers from userspace");
277272
MODULE_AUTHOR("Jonathan Bell <jonathan@raspberrypi.org>");

‎drivers/mfd/bcm2835-pm.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ static int bcm2835_pm_probe(struct platform_device *pdev)
5050
if (ret)
5151
return ret;
5252

53-
/* Map the ARGON ASB regs if present. */
53+
/* Map the RPiVid ASB regs if present. */
5454
res = platform_get_resource(pdev, IORESOURCE_MEM, 2);
5555
if (res) {
56-
pm->arg_asb = devm_ioremap_resource(dev, res);
57-
if (IS_ERR(pm->arg_asb)) {
58-
dev_err(dev, "Failed to map ARGON ASB: %ld\n",
59-
PTR_ERR(pm->arg_asb));
60-
return PTR_ERR(pm->arg_asb);
56+
pm->rpivid_asb = devm_ioremap_resource(dev, res);
57+
if (IS_ERR(pm->rpivid_asb)) {
58+
dev_err(dev, "Failed to map RPiVid ASB: %ld\n",
59+
PTR_ERR(pm->rpivid_asb));
60+
return PTR_ERR(pm->rpivid_asb);
6161
}
6262
}
6363

‎drivers/soc/bcm/bcm2835-power.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -637,15 +637,15 @@ static int bcm2835_power_probe(struct platform_device *pdev)
637637
power->base = pm->base;
638638
power->asb = pm->asb;
639639

640-
/* 2711 hack: the new ARGON ASB took over V3D, which is our
640+
/* 2711 hack: the new RPiVid ASB took over V3D, which is our
641641
* only consumer of this driver so far. The old ASB seems to
642642
* still be present with ISP and H264 bits but no V3D, but I
643643
* don't know if that's real or not. The V3D is in the same
644644
* place in the new ASB as the old one, so just poke the new
645645
* one for now.
646646
*/
647-
if (pm->arg_asb) {
648-
power->asb = pm->arg_asb;
647+
if (pm->rpivid_asb) {
648+
power->asb = pm->rpivid_asb;
649649
power->is_2711 = true;
650650
}
651651

‎include/linux/mfd/bcm2835-pm.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ struct bcm2835_pm {
99
struct device *dev;
1010
void __iomem *base;
1111
void __iomem *asb;
12-
void __iomem *arg_asb;
12+
void __iomem *rpivid_asb;
1313
};
1414

1515
#endif /* BCM2835_MFD_PM_H */

0 commit comments

Comments
 (0)