From: malattia@linux.it
To: lenb@kernel.org
Cc: linux-acpi@vger.kernel.org, Stelian Pop <stelian@popies.net>,
Mattia Dongili <malattia@linux.it>
Subject: [patch 9/9 v2] sony-laptop: remove user visible camera controls as platform attributes
Date: Sat, 28 Apr 2007 23:36:40 +0900 [thread overview]
Message-ID: <20070428143640.GI5293@inferi.kami.home> (raw)
In-Reply-To: 20070428141557.GA4764@inferi.kami.home
[-- Attachment #1: 0016-remove-camera-platform-attributes.patch --]
[-- Type: text/plain, Size: 1894 bytes --]
Avoid giving the user the possibility to shoot his own foot and let
the meye driver enable/disable the camera wisely (PCI_ID based).
Signed-off-by: Mattia Dongili <malattia@linux.it>
---
Index: linux-2.6/drivers/misc/sony-laptop.c
===================================================================
--- linux-2.6.orig/drivers/misc/sony-laptop.c 2007-04-25 22:35:50.616962991 +0900
+++ linux-2.6/drivers/misc/sony-laptop.c 2007-04-25 22:36:37.119613026 +0900
@@ -1317,40 +1317,6 @@ static int __sony_pic_camera_on(void)
return 0;
}
-static ssize_t sony_pic_camerapower_store(struct device *dev,
- struct device_attribute *attr,
- const char *buffer, size_t count)
-{
- unsigned long value;
- int result;
- if (count > 31)
- return -EINVAL;
-
- value = simple_strtoul(buffer, NULL, 10);
-
- mutex_lock(&spic_dev.lock);
- if (value)
- result = __sony_pic_camera_on();
- else
- result = __sony_pic_camera_off();
- mutex_unlock(&spic_dev.lock);
-
- if (result)
- return result;
-
- return count;
-}
-
-static ssize_t sony_pic_camerapower_show(struct device *dev,
- struct device_attribute *attr, char *buffer)
-{
- ssize_t count;
- mutex_lock(&spic_dev.lock);
- count = snprintf(buffer, PAGE_SIZE, "%d\n", spic_dev.camera_power);
- mutex_unlock(&spic_dev.lock);
- return count;
-}
-
/* External camera command (exported to the motion eye v4l driver) */
int sony_pic_camera_command(int command, u8 value)
{
@@ -1522,13 +1488,11 @@ struct device_attribute spic_attr_##_nam
_mode, sony_pic_## _name ##_show, \
sony_pic_## _name ##_store)
-static SPIC_ATTR(camerapower, 0644);
static SPIC_ATTR(bluetoothpower, 0644);
static SPIC_ATTR(wwanpower, 0644);
static SPIC_ATTR(fanspeed, 0644);
static struct attribute *spic_attributes[] = {
- &spic_attr_camerapower.attr,
&spic_attr_bluetoothpower.attr,
&spic_attr_wwanpower.attr,
&spic_attr_fanspeed.attr,
--
mattia
:wq!
next prev parent reply other threads:[~2007-04-28 14:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-28 14:15 [patch 0/9 v2] sony drivers: finish rewriting sonypi and updates malattia
2007-04-28 14:18 ` [patch 1/9 v2] sony-laptop: add camera enable/disable parameter, better handle possible infinite loop malattia
2007-04-28 14:19 ` [patch 2/9 v2] sony-laptop: add locking on accesses to the ioport and global vars malattia
2007-04-28 14:21 ` [patch 3/9 v2] sony-laptop: add edge modem support (also called WWAN) malattia
2007-04-28 14:22 ` [patch 4/9 v2] sonypi: suggest sonypi users to try sony-laptop instead malattia
2007-04-28 14:34 ` [patch 5/9 v2] sonypi: try to detect if sony-laptop has already taken one of the known ioports malattia
2007-04-28 14:34 ` [patch 6/9 v2] sony-laptop: complete the motion eye camera support in sony-laptop malattia
2007-04-28 14:34 ` [patch 7/9 v2] sony-laptop: add a meye-usable include file for camera ops malattia
2007-04-28 14:36 ` [patch 8/9 v2] meye: make meye use sony-laptop instead of sonypi malattia
2007-04-28 14:36 ` malattia [this message]
2007-04-29 4:42 ` [patch 0/9 v2] sony drivers: finish rewriting sonypi and updates Len Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070428143640.GI5293@inferi.kami.home \
--to=malattia@linux.it \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=stelian@popies.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox