Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285701
b: refs/heads/master
c: 1516524
h: refs/heads/master
i:
  285699: f65e1ea
v: v3
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Jan 6, 2012
1 parent cea0306 commit 31195a8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 100 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6807cfcb9ddb913e6d3d2c68f9a8bc1d1d94b87f
refs/heads/master: 1516524ff299d803ff530495fd66b514ec962f75
8 changes: 0 additions & 8 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -469,14 +469,6 @@ Who: Hans de Goede <hdegoede@redhat.com>

----------------------------

What: Driver specific sysfs API in the pwc driver
When: 3.3
Why: Setting pan/tilt should be done with v4l2 controls, like with other
cams. The button is available as a standard input device
Who: Hans de Goede <hdegoede@redhat.com>

----------------------------

What: Driver specific use of pixfmt.priv in the pwc driver
When: 3.3
Why: The .priv field never was intended for this, setting a framerate is
Expand Down
86 changes: 0 additions & 86 deletions trunk/drivers/media/video/pwc/pwc-if.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ static void pwc_snapshot_button(struct pwc_device *pdev, int down)
{
if (down) {
PWC_TRACE("Snapshot button pressed.\n");
pdev->snapshot_button_status = 1;
} else {
PWC_TRACE("Snapshot button released.\n");
}
Expand Down Expand Up @@ -531,84 +530,6 @@ static void pwc_cleanup_queued_bufs(struct pwc_device *pdev)
spin_unlock_irqrestore(&pdev->queued_bufs_lock, flags);
}

/*********
* sysfs
*********/
static struct pwc_device *cd_to_pwc(struct device *cd)
{
struct video_device *vdev = to_video_device(cd);
return video_get_drvdata(vdev);
}

static ssize_t show_pan_tilt(struct device *class_dev,
struct device_attribute *attr, char *buf)
{
struct pwc_device *pdev = cd_to_pwc(class_dev);
return sprintf(buf, "%d %d\n", pdev->pan_angle, pdev->tilt_angle);
}

static ssize_t store_pan_tilt(struct device *class_dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct pwc_device *pdev = cd_to_pwc(class_dev);
int pan, tilt;
int ret = -EINVAL;

if (strncmp(buf, "reset", 5) == 0)
ret = pwc_mpt_reset(pdev, 0x3);

else if (sscanf(buf, "%d %d", &pan, &tilt) > 0)
ret = pwc_mpt_set_angle(pdev, pan, tilt);

if (ret < 0)
return ret;
return strlen(buf);
}
static DEVICE_ATTR(pan_tilt, S_IRUGO | S_IWUSR, show_pan_tilt,
store_pan_tilt);

static ssize_t show_snapshot_button_status(struct device *class_dev,
struct device_attribute *attr, char *buf)
{
struct pwc_device *pdev = cd_to_pwc(class_dev);
int status = pdev->snapshot_button_status;
pdev->snapshot_button_status = 0;
return sprintf(buf, "%d\n", status);
}

static DEVICE_ATTR(button, S_IRUGO | S_IWUSR, show_snapshot_button_status,
NULL);

static int pwc_create_sysfs_files(struct pwc_device *pdev)
{
int rc;

rc = device_create_file(&pdev->vdev.dev, &dev_attr_button);
if (rc)
goto err;
if (pdev->features & FEATURE_MOTOR_PANTILT) {
rc = device_create_file(&pdev->vdev.dev, &dev_attr_pan_tilt);
if (rc)
goto err_button;
}

return 0;

err_button:
device_remove_file(&pdev->vdev.dev, &dev_attr_button);
err:
PWC_ERROR("Could not create sysfs files.\n");
return rc;
}

static void pwc_remove_sysfs_files(struct pwc_device *pdev)
{
if (pdev->features & FEATURE_MOTOR_PANTILT)
device_remove_file(&pdev->vdev.dev, &dev_attr_pan_tilt);
device_remove_file(&pdev->vdev.dev, &dev_attr_button);
}

#ifdef CONFIG_USB_PWC_DEBUG
static const char *pwc_sensor_type_to_string(unsigned int sensor_type)
{
Expand Down Expand Up @@ -1240,10 +1161,6 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
PWC_ERROR("Failed to register as video device (%d).\n", rc);
goto err_unregister_v4l2_dev;
}
rc = pwc_create_sysfs_files(pdev);
if (rc)
goto err_video_unreg;

PWC_INFO("Registered as %s.\n", video_device_node_name(&pdev->vdev));

#ifdef CONFIG_USB_PWC_INPUT_EVDEV
Expand All @@ -1252,7 +1169,6 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
if (!pdev->button_dev) {
PWC_ERROR("Err, insufficient memory for webcam snapshot button device.");
rc = -ENOMEM;
pwc_remove_sysfs_files(pdev);
goto err_video_unreg;
}

Expand All @@ -1270,7 +1186,6 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
if (rc) {
input_free_device(pdev->button_dev);
pdev->button_dev = NULL;
pwc_remove_sysfs_files(pdev);
goto err_video_unreg;
}
#endif
Expand Down Expand Up @@ -1304,7 +1219,6 @@ static void usb_pwc_disconnect(struct usb_interface *intf)

pwc_cleanup_queued_bufs(pdev);

pwc_remove_sysfs_files(pdev);
video_unregister_device(&pdev->vdev);
v4l2_device_unregister(&pdev->v4l2_dev);

Expand Down
5 changes: 0 additions & 5 deletions trunk/drivers/media/video/pwc/pwc.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,6 @@ struct pwc_device
int pan_angle; /* in degrees * 100 */
int tilt_angle; /* absolute angle; 0,0 is home */

/*
* Set to 1 when the user push the button, reset to 0
* when this value is read from sysfs.
*/
int snapshot_button_status;
#ifdef CONFIG_USB_PWC_INPUT_EVDEV
struct input_dev *button_dev; /* webcam snapshot button input */
char button_phys[64];
Expand Down

0 comments on commit 31195a8

Please sign in to comment.