sony-vaio-z-series team mailing list archive
-
sony-vaio-z-series team
-
Mailing list archive
-
Message #00309
Re: Nvidia/Intel switching nightmare.
Hi all,
Didine: Your tutorial seems to work fine. In the version I looked at though there were no mention about the /etc/modprobe.d/sony-laptop.conf file (containing the "options sony-laptop speed_stamina=3" line). I also had some issues with the xorg.conf.NVIDIA file but it turned out that it was a copy and paste error.
I'm currently testing out Karmic Koala (2.6.30 kernel). The default module already handles most of the buttons which is nice, but does not contain any graphics switching features. When compiling and testing Eva Brucherseifer's sony-laptop module I had some issues. At the test loading of the module first it seemed to work fine but then the display froze up completely. To fix this I decided to install the kernel sources and make a diff between the main kernels sony-laptop driver and Eva's. I modified the file but still had a similar behaviour. After a restart however I got it working fine. Guess Eva's old sony-laptop module might still work fine but just in case I'm supplying a patch if anybody else has issues.
Thanks all for the great tips and hints.
//Jari
> Hello Didine,
>
> I just realized that I forgot the change to the kernel
> parameter at startup. In the attached PDF you will find this
> near the end.
>
> Cheers,
> Philipp
>
> 2009/6/7 Didine <didinux@xxxxxxxxx>
>
> Hello Philipp,
>
> Thanks a lot for this tutorial ! I'll Try it and let
> you know if there is any problem.
>
>
> --
> Didine
> Wayde.
>
>
>
> On Sun, Jun 7, 2009 at 4:34 PM,
> Philipp Blanke <philipp.blanke@xxxxxxxxxxxxxx>
> wrote:
>
>
>
> Hi all.
>
> I just compiled a tutorial for the configuration of the
> graphic cards. See the attached ODT or PDF.
>
> Feedback welcome. Please point out errors.
>
> Cheers,
> Philipp
>
>
>
>
>
> 2009/6/3 Didine Wayde <didinux@xxxxxxxxx>
>
>
>
>
> No one to help ?
>
>
>
> Best,
>
> Didine.
>
>
>
> On Fri, 2009-05-29 at 23:14 +0200, Didine Wayde wrote:
>
> > Hello,
>
> >
>
> > Klaus, Julius, can you please format a newbie tutorial
> with all the
>
> > steps (where to put the script for switching between
> the two xorg.conf
>
> > etc.. ) to get this work.
>
> >
>
> > Thanks a lot.
>
> > Best regards,
>
> >
>
> >
>
> > On Fri, 2009-05-29 at 20:20 +0200, Julius Donnert
> wrote:
>
> > > Hi all,
>
> > >
>
> > > i can confirm, that this works on my Z21WN/B
> !!!!
>
> > >
>
> > > Thanks a lot Klaus, how did you find out ?
>
> > >
>
> > > This is quite a step forward, as we now _dont_
> need an Xp cd /install
>
> > > anymore.
>
> > >
>
> > > Still i am not sure what exactly does the proper
> initialisation of the
>
> > > nvidia card. I did the following things:
>
> > >
>
> > > Boot with acpi_osi="!Windows 2006",
> without nvidia driver installed and
>
> > > with eva & matzes module in speed_stamina=3
> mode. i reloaded it in
>
> > > intel/stamina mode
>
> > > I quit X, killed gdm and installed the nvidia
> driver and modified the
>
> > > xorg.conf. A modprobe nvidia gave, that the card
> was not properly
>
> > > initialised - a known result.
>
> > > I did an "sudo halt" and at the next
> start, the nvidia card was
>
> > > working.
>
> > >
>
> > > Now the question is, can we make this work, so it
> recognises the Speed -
>
> > > Stamina switch ?
>
> > >
>
> > > Eva, Matze: Does the boot option give you a hint
> how to properly
>
> > > initialise the card ?
>
> > >
>
> > > it would be great, if we somehow managed to make
> it work only with a
>
> > > script and a reboot. So that the card is chosen
> on startup depending on
>
> > > the switch setting. Thats the second best option
> after on the fly
>
> > > switching, and actually as acceptable for me.
> Especially as Xorg ppl
>
> > > might take some years, until they are getting the
> infrastructure set up
>
> > > to handle this correctly ..
>
> > >
>
> > > Ciao
>
> > >
>
> > > Julius
>
> > >
>
> > >
>
> > >
>
> > >
>
> > > Klaus Addicks schrieb:
>
> > > > Hi all,
>
> > > >
>
> > > > switching works like a harm.
>
> > > > Just load Evas sony-laptop module with
> speed_stamina=3.
>
> > > > In my case i created a file called
> /etc/modprobe.d/sony-laptop.conf with
>
> > > > following line: options sony-laptop
> speed_stamina=3
>
> > > > You have to boot with this kernel parameter:
> acpi_osi="!Windows 2006"
>
> > > > Just put it in the kernel command line of
> your bootmanager.
>
> > > > Now you can switch between stamina and speed
> without booting to Windows.
>
> > > > But your laptop have to be completely
> poweroff!
>
> > > > For loading the correct xorg.conf, i use
> this little script before starting
>
> > > > xserver:
>
> > > >
>
> > > > #!/bin/sh
>
> > > > lspci | grep "00:02.1"
>
> > > > if [ $? -eq 0 ]; then
>
> > > > cp /etc/X11/xorg.INTEL
> /etc/X11/xorg.conf
>
> > > > else
>
> > > > cp /etc/X11/xorg.NVIDIA
> /etc/X11/xorg.conf
>
> > > > fi
>
> > > >
>
> > > > Greetings,
>
> > > > Klaus
>
> > > >
>
> > > >
>
> > > > Am Mittwoch 27. Mai 2009 21:58:08 schrieb
> Alexandre Kaspar:
>
> > > >
>
> > > >> The problem is actually that the module
> is great as long as you just
>
> > > >> want to use the intel graphic card.
>
> > > >> However, I suppose most people who
> bought the vaio-z did it since
>
> > > >> there was a possibility of using good
> advanced graphics (nvidia) as
>
> > > >> well as offering good running life
> (intel).
>
> > > >>
>
> > > >> Then, if you just get the running life
> (intel) working, you're missing
>
> > > >> something important (that's the case
> for me). Actually, I'm mostly
>
> > > >> using the nvidia card since I'm
> computing some opengl programs which
>
> > > >> need it. Therefore, I haven't even
> tested the module for the intel
>
> > > >> card since I know I currently have to be
> often on the nvidia switch.
>
> > > >> And since there's actually no way to
> switch from one to the other
>
> > > >> without going on win xp or using DSL,
> then I just stay on the nvidia
>
> > > >> state with acpi=ht.
>
> > > >> That's a problem since I can't
> use the intel one which would make the
>
> > > >> computer really useful. Now I can use
> the computer, but it isn't as
>
> > > >> portable (thinking of the battery life)
> as it should.
>
> > > >>
>
> > > >> However, I hope there'll be a
> solution. Some day, maybe...
>
> > > >>
>
> > > >> Alexandre Kaspar
>
> > > >>
>
> > > >
>
> > > >
>
> > > >
> _______________________________________________
>
> > > > Mailing list: https://launchpad.net/~sony-vaio-z-series
>
> > > > Post to : sony-vaio-z-series@xxxxxxxxxxxxxxxxxxx
>
> > > > Unsubscribe : https://launchpad.net/~sony-vaio-z-series
>
> > > > More help : https://help.launchpad.net/ListHelp
>
> > > >
>
> > > >
>
> > >
>
> > >
>
> > >
>
> > > _______________________________________________
>
> > > Mailing list: https://launchpad.net/~sony-vaio-z-series
>
> > > Post to : sony-vaio-z-series@xxxxxxxxxxxxxxxxxxx
>
> > > Unsubscribe : https://launchpad.net/~sony-vaio-z-series
>
> > > More help : https://help.launchpad.net/ListHelp
>
> >
>
>
>
>
>
> _______________________________________________
>
> Mailing list: https://launchpad.net/~sony-vaio-z-series
>
> Post to : sony-vaio-z-series@xxxxxxxxxxxxxxxxxxx
>
> Unsubscribe : https://launchpad.net/~sony-vaio-z-series
>
> More help : https://help.launchpad.net/ListHelp
>
>
>
>
> --
> Philipp Blanke
> Alte Dorfstr. 19
> 29690 Schwarmstedt
>
>
> _______________________________________________
>
> Mailing list: https://launchpad.net/~sony-vaio-z-series
>
> Post to : sony-vaio-z-series@xxxxxxxxxxxxxxxxxxx
>
> Unsubscribe : https://launchpad.net/~sony-vaio-z-series
>
> More help : https://help.launchpad.net/ListHelp
>
>
>
>
>
>
>
> --
> Philipp Blanke
> Alte Dorfstr. 19
> 29690 Schwarmstedt
>
>
> -----Infogad bilaga följer-----
>
> _______________________________________________
> Mailing list: https://launchpad.net/~sony-vaio-z-series
> Post to : sony-vaio-z-series@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~sony-vaio-z-series
> More help : https://help.launchpad.net/ListHelp
>
___________________________________________________
Sök efter kärleken!
Hitta din tvillingsjäl på Yahoo! Dejting: http://ad.doubleclick.net/clk;185753627;24584539;x?http://se.meetic.yahoo.net/index.php?mtcmk=148783
--- sony-laptop-zseries-0.9/sony-laptop.c 2009-03-30 22:33:02.000000000 +0200
+++ sony-laptop.c 2009-06-10 19:47:39.000000000 +0200
@@ -61,6 +61,7 @@
#include <acpi/acpi_drivers.h>
#include <acpi/acpi_bus.h>
#include <asm/uaccess.h>
+#include <linux/sonypi.h>
#include <linux/sony-laptop.h>
#include <linux/rfkill.h>
#ifdef CONFIG_SONYPI_COMPAT
@@ -68,7 +69,6 @@
#include <linux/miscdevice.h>
#endif
#include <linux/version.h>
-#include "sonypi.h"
#define DRV_PFX "sony-laptop: "
#define dprintk(msg...) do { \
@@ -113,8 +113,8 @@
static int camera; /* = 0 */
module_param(camera, int, 0444);
MODULE_PARM_DESC(camera,
- "set this to 1 to enable Motion Eye camera controls "
- "(only use it if you have a C1VE or C1VN model)");
+ "set this to 1 to enable Motion Eye camera controls "
+ "(only use it if you have a C1VE or C1VN model)");
static int speed_stamina;
module_param(speed_stamina, int, 0444);
@@ -323,7 +323,8 @@
struct input_dev *key_dev = sony_laptop_input.key_dev;
struct sony_laptop_keypress kp = { NULL };
- if (event == SONYPI_EVENT_FNKEY_RELEASED) {
+ if (event == SONYPI_EVENT_FNKEY_RELEASED ||
+ event == SONYPI_EVENT_ANYBUTTON_RELEASED) {
/* Nothing, not all VAIOs generate this event */
return;
}
@@ -403,7 +404,7 @@
sony_laptop_input.wq = create_singlethread_workqueue("sony-laptop");
if (!sony_laptop_input.wq) {
printk(KERN_ERR DRV_PFX
- "Unabe to create workqueue.\n");
+ "Unable to create workqueue.\n");
error = -ENXIO;
goto err_free_kfifo;
}
@@ -664,10 +665,10 @@
#ifdef CONFIG_PM
.resume_early = sony_pf_resume,
#endif
- .driver = {
- .name = "sony-laptop",
- .owner = THIS_MODULE,
- }
+ .driver = {
+ .name = "sony-laptop",
+ .owner = THIS_MODULE,
+ }
};
static struct platform_device *sony_pf_device;
@@ -1063,7 +1064,6 @@
{ 0x05, SONYPI_EVENT_ANYBUTTON_RELEASED },
{ 0x86, SONYPI_EVENT_PKEY_P5 },
{ 0x06, SONYPI_EVENT_ANYBUTTON_RELEASED },
- { 0x06, SONYPI_EVENT_ANYBUTTON_RELEASED },
{ 0x87, SONYPI_EVENT_SETTINGKEY_PRESSED },
{ 0x07, SONYPI_EVENT_ANYBUTTON_RELEASED },
{ 0, 0 },
@@ -1072,13 +1072,13 @@
/*
* ACPI callbacks
*/
-static void sony_acpi_notify(acpi_handle handle, u32 event, void *data)
+static void sony_nc_notify(struct acpi_device *device, u32 event)
{
u32 ev = event;
- int result;
if (ev >= 0x90) {
/* New-style event */
+ int result;
int key_handle = 0;
ev -= 0x90;
@@ -1090,62 +1090,43 @@
if (key_handle) {
struct sony_nc_event *key_event;
- if (sony_call_snc_handle(key_handle, 0x200, &result))
- dprintk("sony_acpi_notify, unable to decode"
+ if (sony_call_snc_handle(key_handle, 0x200, &result)) {
+ dprintk("sony_nc_notify, unable to decode"
" event 0x%.2x 0x%.2x\n", key_handle,
ev);
- else
+ /* restore the original event */
+ ev = event;
+ } else {
ev = result & 0xFF;
- if (key_handle == 0x100)
- key_event = sony_100_events;
- else
- key_event = sony_127_events;
-
- for (; key_event->data; key_event++) {
- if (key_event->data == ev) {
- ev = key_event->event;
- break;
+ if (key_handle == 0x100)
+ key_event = sony_100_events;
+ else
+ key_event = sony_127_events;
+
+ for (; key_event->data; key_event++) {
+ if (key_event->data == ev) {
+ ev = key_event->event;
+ break;
+ }
}
- }
-
- if (!key_event->data) {
- printk(KERN_INFO DRV_PFX
- "Unknown event: 0x%x 0x%x\n", key_handle,
- ev);
- } else
- sony_laptop_report_input_event(ev);
- /* mark event as translated */
- ev |= 0x40000000;
+ if (!key_event->data)
+ printk(KERN_INFO DRV_PFX
+ "Unknown event: 0x%x 0x%x\n",
+ key_handle,
+ ev);
+ else
+ sony_laptop_report_input_event(ev);
+ }
} else if (sony_find_snc_handle(0x124) == ev) {
sony_nc_rfkill_update();
- /* restore original event number */
- ev = event;
- } else if (ev == 0xc) {
- int result;
- if (!ACPI_SUCCESS(acpi_callgetfunc(
- handle, "HSC1", &result))) {
- dprintk("sony_acpi_notify: "
- "cannot query speed/stamina switch\n");
- return;
- }
-
- /* restore original event number */
- ev = event;
-
- if (result & 0x02)
- acpi_bus_generate_proc_event(
- sony_nc_acpi_device, 1, ev);
- else
- acpi_bus_generate_proc_event(
- sony_nc_acpi_device, 0, ev);
return;
}
} else
sony_laptop_report_input_event(ev);
-
- dprintk("sony_acpi_notify, event: 0x%.2x\n", ev);
+
+ dprintk("sony_nc_notify, event: 0x%.2x\n", ev);
acpi_bus_generate_proc_event(sony_nc_acpi_device, 1, ev);
}
@@ -1153,17 +1134,17 @@
void *context, void **return_value)
{
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)
- struct acpi_device_info *info;
- struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
+ struct acpi_device_info *info;
+ struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
- if (ACPI_SUCCESS(acpi_get_object_info(handle, &buffer))) {
- info = buffer.pointer;
-
- printk(KERN_WARNING DRV_PFX "method: name: %4.4s, args %X\n",
- (char *)&info->name, info->param_count);
+ if (ACPI_SUCCESS(acpi_get_object_info(handle, &buffer))) {
+ info = buffer.pointer;
- kfree(buffer.pointer);
- }
+ printk(KERN_WARNING DRV_PFX "method: name: %4.4s, args %X\n",
+ (char *)&info->name, info->param_count);
+
+ kfree(buffer.pointer);
+ }
#else
struct acpi_namespace_node *node;
union acpi_operand_object *operand;
@@ -1191,6 +1172,7 @@
sony_call_snc_handle(0x0100, 0, &result);
sony_call_snc_handle(0x0101, 0, &result);
sony_call_snc_handle(0x0102, 0x100, &result);
+ sony_call_snc_handle(0x0127, 0, &result);
return 0;
}
@@ -1227,7 +1209,7 @@
/* set the last requested brightness level */
if (sony_backlight_device &&
- !sony_backlight_update_status(sony_backlight_device))
+ sony_backlight_update_status(sony_backlight_device) < 0)
printk(KERN_WARNING DRV_PFX "unable to restore brightness level\n");
return 0;
@@ -1289,8 +1271,11 @@
err = rfkill_register(sony_wifi_rfkill);
if (err)
rfkill_free(sony_wifi_rfkill);
- else
+ else {
sony_rfkill_devices[SONY_WIFI] = sony_wifi_rfkill;
+ sony_nc_rfkill_set(sony_wifi_rfkill->data,
+ RFKILL_STATE_UNBLOCKED);
+ }
return err;
}
@@ -1311,8 +1296,11 @@
err = rfkill_register(sony_bluetooth_rfkill);
if (err)
rfkill_free(sony_bluetooth_rfkill);
- else
+ else {
sony_rfkill_devices[SONY_BLUETOOTH] = sony_bluetooth_rfkill;
+ sony_nc_rfkill_set(sony_bluetooth_rfkill->data,
+ RFKILL_STATE_UNBLOCKED);
+ }
return err;
}
@@ -1332,8 +1320,11 @@
err = rfkill_register(sony_wwan_rfkill);
if (err)
rfkill_free(sony_wwan_rfkill);
- else
+ else {
sony_rfkill_devices[SONY_WWAN] = sony_wwan_rfkill;
+ sony_nc_rfkill_set(sony_wwan_rfkill->data,
+ RFKILL_STATE_UNBLOCKED);
+ }
return err;
}
@@ -1353,8 +1344,11 @@
err = rfkill_register(sony_wimax_rfkill);
if (err)
rfkill_free(sony_wimax_rfkill);
- else
+ else {
sony_rfkill_devices[SONY_WIMAX] = sony_wimax_rfkill;
+ sony_nc_rfkill_set(sony_wimax_rfkill->data,
+ RFKILL_STATE_UNBLOCKED);
+ }
return err;
}
@@ -1459,19 +1453,10 @@
result = sony_laptop_setup_input(device);
if (result) {
printk(KERN_ERR DRV_PFX
- "Unabe to create input devices.\n");
+ "Unable to create input devices.\n");
goto outwalk;
}
- status = acpi_install_notify_handler(sony_nc_acpi_handle,
- ACPI_DEVICE_NOTIFY,
- sony_acpi_notify, NULL);
- if (ACPI_FAILURE(status)) {
- printk(KERN_WARNING DRV_PFX "unable to install notify handler (%u)\n", status);
- result = -ENODEV;
- goto outinput;
- }
-
if (acpi_video_backlight_support()) {
printk(KERN_INFO DRV_PFX "brightness ignored, must be "
"controlled by ACPI video driver\n");
@@ -1549,13 +1534,6 @@
if (sony_backlight_device)
backlight_device_unregister(sony_backlight_device);
- status = acpi_remove_notify_handler(sony_nc_acpi_handle,
- ACPI_DEVICE_NOTIFY,
- sony_acpi_notify);
- if (ACPI_FAILURE(status))
- printk(KERN_WARNING DRV_PFX "unable to remove notify handler\n");
-
- outinput:
sony_laptop_remove_input();
outwalk:
@@ -1565,7 +1543,6 @@
static int sony_nc_remove(struct acpi_device *device, int type)
{
- acpi_status status;
struct sony_nc_value *item;
if (sony_backlight_device)
@@ -1573,12 +1550,6 @@
sony_nc_acpi_device = NULL;
- status = acpi_remove_notify_handler(sony_nc_acpi_handle,
- ACPI_DEVICE_NOTIFY,
- sony_acpi_notify);
- if (ACPI_FAILURE(status))
- printk(KERN_WARNING DRV_PFX "unable to remove notify handler\n");
-
for (item = sony_nc_values; item->name; ++item) {
device_remove_file(&sony_pf_device->dev, &item->devattr);
}
@@ -1612,6 +1583,7 @@
.add = sony_nc_add,
.remove = sony_nc_remove,
.resume = sony_nc_resume,
+ .notify = sony_nc_notify,
},
};
@@ -1653,6 +1625,10 @@
struct sonypi_eventtypes *event_types;
};
+struct sony_pic_quirk_entry {
+ u8 set_wwan_power;
+};
+
struct sony_pic_dev {
struct device_ctrl *control;
struct acpi_device *acpi_dev;
@@ -1661,6 +1637,7 @@
struct list_head interrupts;
struct list_head ioports;
struct mutex lock;
+ struct sony_pic_quirk_entry *quirks;
u8 camera_power;
u8 bluetooth_power;
u8 wwan_power;
@@ -2354,12 +2331,7 @@
static int sonypi_misc_fasync(int fd, struct file *filp, int on)
{
- int retval;
-
- retval = fasync_helper(fd, filp, on, &sonypi_compat.fifo_async);
- if (retval < 0)
- return retval;
- return 0;
+ return fasync_helper(fd, filp, on, &sonypi_compat.fifo_async);
}
static int sonypi_misc_release(struct inode *inode, struct file *file)
@@ -3008,7 +2980,7 @@
result = sony_pic_possible_resources(device);
if (result) {
printk(KERN_ERR DRV_PFX
- "Unabe to read possible resources.\n");
+ "Unable to read possible resources.\n");
goto err_free_resources;
}
@@ -3016,7 +2988,7 @@
result = sony_laptop_setup_input(device);
if (result) {
printk(KERN_ERR DRV_PFX
- "Unabe to create input devices.\n");
+ "Unable to create input devices.\n");
goto err_free_resources;
}
@@ -3099,6 +3071,12 @@
if (result)
goto err_remove_pf;
+ if (spic_dev.quirks && spic_dev.quirks->set_wwan_power) {
+ /*
+ * Power isn't enabled by default.
+ */
+ __sony_pic_set_wwanpower(1);
+ }
return 0;
err_remove_pf:
@@ -3169,6 +3147,16 @@
},
};
+static struct sony_pic_quirk_entry sony_pic_vaio_vgn = {
+ .set_wwan_power = 1,
+};
+
+static int dmi_matched(const struct dmi_system_id *dmi)
+{
+ spic_dev.quirks = dmi->driver_data;
+ return 0;
+}
+
static struct dmi_system_id __initdata sonypi_dmi_table[] = {
{
.ident = "Sony Vaio",
@@ -3183,6 +3171,8 @@
DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
DMI_MATCH(DMI_PRODUCT_NAME, "VGN-"),
},
+ .callback = dmi_matched,
+ .driver_data = &sony_pic_vaio_vgn,
},
{ }
};