* Re: [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
@ 2010-03-03 15:25 Joey Lee
2010-03-03 15:28 ` Matthew Garrett
0 siblings, 1 reply; 7+ messages in thread
From: Joey Lee @ 2010-03-03 15:25 UTC (permalink / raw)
To: mjg59; +Cc: mzxreary, gregkh, linux-kernel
Hi Matthew,
於 三,2010-03-03 於 13:46 +0000,Matthew Garrett 提到:
> On Tue, Mar 02, 2010 at 03:47:00PM -0800, Greg KH wrote:
> > On Tue, Mar 02, 2010 at 11:36:16PM +0000, Matthew Garrett wrote:
> > > On Tue, Mar 02, 2010 at 03:28:56PM -0800, Greg Kroah-Hartman wrote:
> > >
> > > > Add threeg sysfs file for support query 3G state by standard 66/62 ec
> > > > command, the MSI standard ec interface supported this feature.
> > >
> > > No. Just use the rfkill interface.
> >
> > Does rfkill support 3G? I thought it was only for wireless (80211)
> > stuff.
>
> rfkill has types for the majority of radios. A later patch adds the 3g
> rfkill device, so this one should just be dropped - there's no reason to
> add a non-standard radio control file now.
>
So, "wwan" does not mean "3g"? or 3g is included in "wwan"?
And, does the "non-standard radio control file" mean like "threeg",
"wlan" or "bluetooth" in /sys/devices/platform/xxxxx ?
In current x86/platform, there have a bit driver still used the
"non-standard control file". Does that mean we need replace all of
those control files by rfkill interface?
Thank's
Joey Lee
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
2010-03-03 15:25 [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command Joey Lee
@ 2010-03-03 15:28 ` Matthew Garrett
0 siblings, 0 replies; 7+ messages in thread
From: Matthew Garrett @ 2010-03-03 15:28 UTC (permalink / raw)
To: Joey Lee; +Cc: mzxreary, gregkh, linux-kernel
On Wed, Mar 03, 2010 at 08:25:38AM -0700, Joey Lee wrote:
> So, "wwan" does not mean "3g"? or 3g is included in "wwan"?
> And, does the "non-standard radio control file" mean like "threeg",
> "wlan" or "bluetooth" in /sys/devices/platform/xxxxx ?
wwan includes 3g, so it's the appropriate type to use here. The
non-standard ones are the threeg, wlan and bluetooth files.
> In current x86/platform, there have a bit driver still used the
> "non-standard control file". Does that mean we need replace all of
> those control files by rfkill interface?
Those are holdovers from before the rfkill interface was usable - we
should probably be deprecating them. I /think/ all the drivers that
provide them also provide an rfkill interface now, but if not we should
probably port them.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
2010-03-02 23:47 ` Greg KH
@ 2010-03-03 13:46 ` Matthew Garrett
0 siblings, 0 replies; 7+ messages in thread
From: Matthew Garrett @ 2010-03-03 13:46 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, Lee, Chun-Yi, Lennart Poettering
On Tue, Mar 02, 2010 at 03:47:00PM -0800, Greg KH wrote:
> On Tue, Mar 02, 2010 at 11:36:16PM +0000, Matthew Garrett wrote:
> > On Tue, Mar 02, 2010 at 03:28:56PM -0800, Greg Kroah-Hartman wrote:
> >
> > > Add threeg sysfs file for support query 3G state by standard 66/62 ec
> > > command, the MSI standard ec interface supported this feature.
> >
> > No. Just use the rfkill interface.
>
> Does rfkill support 3G? I thought it was only for wireless (80211)
> stuff.
rfkill has types for the majority of radios. A later patch adds the 3g
rfkill device, so this one should just be dropped - there's no reason to
add a non-standard radio control file now.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
@ 2010-03-03 8:55 Joey Lee
0 siblings, 0 replies; 7+ messages in thread
From: Joey Lee @ 2010-03-03 8:55 UTC (permalink / raw)
To: mjg59; +Cc: mzxreary, gregkh, linux-kernel
Hi Greg,
於 二,2010-03-02 於 15:47 -0800,Greg KH 提到:
> On Tue, Mar 02, 2010 at 11:36:16PM +0000, Matthew Garrett wrote:
> > On Tue, Mar 02, 2010 at 03:28:56PM -0800, Greg Kroah-Hartman wrote:
> >
> > > Add threeg sysfs file for support query 3G state by standard 66/62 ec
> > > command, the MSI standard ec interface supported this feature.
> >
> > No. Just use the rfkill interface.
>
> Does rfkill support 3G? I thought it was only for wireless (80211)
> stuff.
>
M......No, rfkill have wwan type and I have also generate it in patch.
So, this patch to msi-laptop driver will gnerate the following interface
on MSI N034 netbook when netbook have 3G hardware module:
- /sys/devices/platform/msi-laptop-pf/threeg
- /sys/class/rfkill/rfkill2
/sys/class/rfkill/rfkill2/type=wwan
I have reference acer-wmi.c then generate the threeg sysfs, and want to
follow the same style with "wlan" and "bluetooth" sysfs file
in /sys/devices/platform/msi-laptop-pf/rfkill
And, yes, userland just need control wwan by rfkill interface.
Do I need remove threeg sysfs file, now?
Thank's
Joey Lee
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
2010-03-02 23:36 ` Matthew Garrett
@ 2010-03-02 23:47 ` Greg KH
2010-03-03 13:46 ` Matthew Garrett
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2010-03-02 23:47 UTC (permalink / raw)
To: Matthew Garrett; +Cc: linux-kernel, Lee, Chun-Yi, Lennart Poettering
On Tue, Mar 02, 2010 at 11:36:16PM +0000, Matthew Garrett wrote:
> On Tue, Mar 02, 2010 at 03:28:56PM -0800, Greg Kroah-Hartman wrote:
>
> > Add threeg sysfs file for support query 3G state by standard 66/62 ec
> > command, the MSI standard ec interface supported this feature.
>
> No. Just use the rfkill interface.
Does rfkill support 3G? I thought it was only for wireless (80211)
stuff.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
2010-03-02 23:28 ` [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command Greg Kroah-Hartman
@ 2010-03-02 23:36 ` Matthew Garrett
2010-03-02 23:47 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Matthew Garrett @ 2010-03-02 23:36 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, Lee, Chun-Yi, Lennart Poettering
On Tue, Mar 02, 2010 at 03:28:56PM -0800, Greg Kroah-Hartman wrote:
> Add threeg sysfs file for support query 3G state by standard 66/62 ec
> command, the MSI standard ec interface supported this feature.
No. Just use the rfkill interface.
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
2010-03-02 23:36 ` Matthew Garrett
0 siblings, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
To: linux-kernel; +Cc: Lee, Chun-Yi, Lennart Poettering, Greg Kroah-Hartman
From: Lee, Chun-Yi <jlee@novell.com>
Add threeg sysfs file for support query 3G state by standard 66/62 ec
command, the MSI standard ec interface supported this feature.
Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Cc: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/platform/x86/msi-laptop.c | 31 ++++++++++++++++++++++++++++++-
1 files changed, 30 insertions(+), 1 deletions(-)
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 323e994..1784d55 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -70,6 +70,7 @@
#define MSI_STANDARD_EC_BLUETOOTH_MASK (1 << 0)
#define MSI_STANDARD_EC_WEBCAM_MASK (1 << 1)
#define MSI_STANDARD_EC_WLAN_MASK (1 << 3)
+#define MSI_STANDARD_EC_3G_MASK (1 << 4)
static int force;
module_param(force, bool, 0);
@@ -80,7 +81,7 @@ module_param(auto_brightness, int, 0);
MODULE_PARM_DESC(auto_brightness, "Enable automatic brightness control (0: disabled; 1: enabled; 2: don't touch)");
static bool old_ec_model;
-static int wlan_s, bluetooth_s;
+static int wlan_s, bluetooth_s, threeg_s;
/* Hardware access */
@@ -169,6 +170,8 @@ static int get_wireless_state_ec_standard(void)
bluetooth_s = !!(rdata & MSI_STANDARD_EC_BLUETOOTH_MASK);
+ threeg_s = !!(rdata & MSI_STANDARD_EC_3G_MASK);
+
return 0;
}
@@ -230,6 +233,23 @@ static ssize_t show_bluetooth(struct device *dev,
return sprintf(buf, "%i\n", enabled);
}
+static ssize_t show_threeg(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+
+ int ret;
+
+ /* old msi ec not support 3G */
+ if (old_ec_model)
+ return -1;
+
+ ret = get_wireless_state_ec_standard();
+ if (ret < 0)
+ return ret;
+
+ return sprintf(buf, "%i\n", threeg_s);
+}
+
static ssize_t show_lcd_level(struct device *dev,
struct device_attribute *attr, char *buf)
{
@@ -292,6 +312,7 @@ static DEVICE_ATTR(lcd_level, 0644, show_lcd_level, store_lcd_level);
static DEVICE_ATTR(auto_brightness, 0644, show_auto_brightness, store_auto_brightness);
static DEVICE_ATTR(bluetooth, 0444, show_bluetooth, NULL);
static DEVICE_ATTR(wlan, 0444, show_wlan, NULL);
+static DEVICE_ATTR(threeg, 0444, show_threeg, NULL);
static struct attribute *msipf_attributes[] = {
&dev_attr_lcd_level.attr,
@@ -412,6 +433,12 @@ static int __init msi_init(void)
if (ret)
goto fail_platform_device2;
+ if (!old_ec_model) {
+ ret = device_create_file(&msipf_device->dev, &dev_attr_threeg);
+ if (ret)
+ goto fail_platform_device2;
+ }
+
/* Disable automatic brightness control by default because
* this module was probably loaded to do brightness control in
* software. */
@@ -446,6 +473,8 @@ static void __exit msi_cleanup(void)
{
sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group);
+ if (!old_ec_model)
+ device_remove_file(&msipf_device->dev, &dev_attr_threeg);
platform_device_unregister(msipf_device);
platform_driver_unregister(&msipf_driver);
backlight_device_unregister(msibl_device);
--
1.7.0.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-03-03 15:29 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-03 15:25 [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command Joey Lee
2010-03-03 15:28 ` Matthew Garrett
-- strict thread matches above, loose matches on Subject: below --
2010-03-03 8:55 Joey Lee
2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
2010-03-02 23:28 ` [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command Greg Kroah-Hartman
2010-03-02 23:36 ` Matthew Garrett
2010-03-02 23:47 ` Greg KH
2010-03-03 13:46 ` Matthew Garrett
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.