From: Ike Panhc <ike.pan@canonical.com>
To: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Matthew Garrett <mjg@redhat.com>
Subject: [PATCH 3/3] ideapad: Show negative when no camera
Date: Thu, 2 Jun 2011 17:24:47 +0800 [thread overview]
Message-ID: <1307006687-12736-1-git-send-email-ike.pan@canonical.com> (raw)
In-Reply-To: <1307006553-12667-1-git-send-email-ike.pan@canonical.com>
Signed-off-by: Ike Panhc <ike.pan@canonical.com>
---
drivers/platform/x86/ideapad-laptop.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 9c09891..4a54ed1 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -38,6 +38,7 @@
#define CFG_BT_BIT (16)
#define CFG_3G_BIT (17)
#define CFG_WIFI_BIT (18)
+#define CFG_CAMERA_BIT (19)
struct ideapad_private {
struct rfkill *rfk[IDEAPAD_RFKILL_DEV_NUM];
@@ -199,6 +200,10 @@ static ssize_t show_ideapad_cam(struct device *dev,
struct device_attribute *attr,
char *buf)
{
+ struct ideapad_private *priv = dev_get_drvdata(dev);
+
+ if (!test_bit(CFG_CAMERA_BIT, &(priv->cfg)))
+ return sprintf(buf, "-1\n");
return show_ideapad_helper(dev, attr, buf, 0x1D);
}
--
1.7.4.1
next prev parent reply other threads:[~2011-06-02 9:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-02 9:22 [PATCH 1/3] ideapad: Use define for cfg bits Ike Panhc
2011-06-02 9:24 ` [PATCH 2/3] ideapad: Add nodes in sysfs Ike Panhc
2011-06-02 9:48 ` Corentin Chary
2011-06-02 10:14 ` Ike Panhc
2011-06-02 11:22 ` Corentin Chary
2011-06-03 20:21 ` Dmitry Torokhov
2011-06-02 9:24 ` Ike Panhc [this message]
2011-06-02 9:43 ` [PATCH 3/3] ideapad: Show negative when no camera Corentin Chary
2011-06-02 10:17 ` Ike Panhc
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=1307006687-12736-1-git-send-email-ike.pan@canonical.com \
--to=ike.pan@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg@redhat.com \
--cc=platform-driver-x86@vger.kernel.org \
/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
all inboxes | Powered by JetHome®