Lines Matching +full:auto +full:- +full:poll
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * drivers/media/radio/radio-si4713.c
7 * Copyright (c) 2008 Instituto Nokia de Tecnologia - INdT
18 #include <media/v4l2-device.h>
19 #include <media/v4l2-common.h>
20 #include <media/v4l2-ioctl.h>
21 #include <media/v4l2-fh.h>
22 #include <media/v4l2-ctrls.h>
23 #include <media/v4l2-event.h>
27 static int radio_nr = -1; /* radio device minor (-1 ==> auto assign) */
30 "Minor number for radio device (-1 ==> auto assign)");
36 MODULE_ALIAS("platform:radio-si4713");
45 /* radio_si4713_fops - file operations interface */
50 .poll = v4l2_ctrl_poll,
57 /* radio_si4713_querycap - query device capabilities */
61 strscpy(capability->driver, "radio-si4713", sizeof(capability->driver)); in radio_si4713_querycap()
62 strscpy(capability->card, "Silicon Labs Si4713 Modulator", in radio_si4713_querycap()
63 sizeof(capability->card)); in radio_si4713_querycap()
64 strscpy(capability->bus_info, "platform:radio-si4713", in radio_si4713_querycap()
65 sizeof(capability->bus_info)); in radio_si4713_querycap()
75 return &((struct radio_si4713_device *)video_drvdata(file))->v4l2_dev; in get_v4l2_dev()
125 /* radio_si4713_vdev_template - video device interface */
128 .name = "radio-si4713",
135 /* radio_si4713_pdriver_probe - probe for the device */
138 struct radio_si4713_platform_data *pdata = pdev->dev.platform_data; in radio_si4713_pdriver_probe()
144 dev_err(&pdev->dev, "Cannot proceed without platform data.\n"); in radio_si4713_pdriver_probe()
145 rval = -EINVAL; in radio_si4713_pdriver_probe()
149 rsdev = devm_kzalloc(&pdev->dev, sizeof(*rsdev), GFP_KERNEL); in radio_si4713_pdriver_probe()
151 dev_err(&pdev->dev, "Failed to alloc video device.\n"); in radio_si4713_pdriver_probe()
152 rval = -ENOMEM; in radio_si4713_pdriver_probe()
155 mutex_init(&rsdev->lock); in radio_si4713_pdriver_probe()
157 rval = v4l2_device_register(&pdev->dev, &rsdev->v4l2_dev); in radio_si4713_pdriver_probe()
159 dev_err(&pdev->dev, "Failed to register v4l2 device.\n"); in radio_si4713_pdriver_probe()
163 sd = i2c_get_clientdata(pdata->subdev); in radio_si4713_pdriver_probe()
164 rval = v4l2_device_register_subdev(&rsdev->v4l2_dev, sd); in radio_si4713_pdriver_probe()
166 dev_err(&pdev->dev, "Cannot get v4l2 subdevice\n"); in radio_si4713_pdriver_probe()
170 rsdev->radio_dev = radio_si4713_vdev_template; in radio_si4713_pdriver_probe()
171 rsdev->radio_dev.v4l2_dev = &rsdev->v4l2_dev; in radio_si4713_pdriver_probe()
172 rsdev->radio_dev.ctrl_handler = sd->ctrl_handler; in radio_si4713_pdriver_probe()
174 rsdev->radio_dev.lock = &rsdev->lock; in radio_si4713_pdriver_probe()
175 rsdev->radio_dev.device_caps = V4L2_CAP_MODULATOR | V4L2_CAP_RDS_OUTPUT; in radio_si4713_pdriver_probe()
176 video_set_drvdata(&rsdev->radio_dev, rsdev); in radio_si4713_pdriver_probe()
177 if (video_register_device(&rsdev->radio_dev, VFL_TYPE_RADIO, radio_nr)) { in radio_si4713_pdriver_probe()
178 dev_err(&pdev->dev, "Could not register video device.\n"); in radio_si4713_pdriver_probe()
179 rval = -EIO; in radio_si4713_pdriver_probe()
182 dev_info(&pdev->dev, "New device successfully probed\n"); in radio_si4713_pdriver_probe()
187 v4l2_device_unregister(&rsdev->v4l2_dev); in radio_si4713_pdriver_probe()
192 /* radio_si4713_pdriver_remove - remove the device */
199 video_unregister_device(&rsdev->radio_dev); in radio_si4713_pdriver_remove()
200 v4l2_device_unregister(&rsdev->v4l2_dev); in radio_si4713_pdriver_remove()
207 .name = "radio-si4713",