Skip to content

Instantly share code, notes, and snippets.

@max630
Created April 12, 2015 04:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save max630/70080d38e8e9951b58a4 to your computer and use it in GitHub Desktop.
Save max630/70080d38e8e9951b58a4 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
diff --cc Documentation/DocBook/.gitignore
index c102c02,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..c102c02
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/DocBook/.gitignore
+++ b/Documentation/DocBook/.gitignore
diff --cc Documentation/block/barrier.txt
index 0397151,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..0397151
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/block/barrier.txt
+++ b/Documentation/block/barrier.txt
diff --cc Documentation/block/stat.txt
index 0dbc946,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..0dbc946
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/block/stat.txt
+++ b/Documentation/block/stat.txt
diff --cc Documentation/cpu-hotplug.txt
index 08c5d04,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..08c5d04
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/cpu-hotplug.txt
+++ b/Documentation/cpu-hotplug.txt
diff --cc Documentation/drivers/edac/edac.txt
index d37191f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..d37191f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/drivers/edac/edac.txt
+++ b/Documentation/drivers/edac/edac.txt
diff --cc Documentation/fb/cyblafb/whatsnew
index 76c07a2,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..76c07a2
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/fb/cyblafb/whatsnew
+++ b/Documentation/fb/cyblafb/whatsnew
diff --cc Documentation/filesystems/configfs/configfs.txt
index c4ff96b,c4ff96b,0000000,0000000,0000000,0000000,0000000,0000000,c4ff96b,0000000,c4ff96b,c4ff96b..c4ff96b
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/Documentation/filesystems/configfs/configfs.txt
+++ b/Documentation/filesystems/configfs/configfs.txt
diff --cc Documentation/filesystems/configfs/configfs_example.c
index f3c6e49,f3c6e49,0000000,0000000,0000000,0000000,0000000,0000000,f3c6e49,0000000,f3c6e49,f3c6e49..f3c6e49
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/Documentation/filesystems/configfs/configfs_example.c
+++ b/Documentation/filesystems/configfs/configfs_example.c
diff --cc Documentation/filesystems/dlmfs.txt
index 9afab84,9afab84,0000000,0000000,0000000,0000000,0000000,0000000,9afab84,0000000,9afab84,9afab84..9afab84
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/Documentation/filesystems/dlmfs.txt
+++ b/Documentation/filesystems/dlmfs.txt
diff --cc Documentation/filesystems/ext3.txt
index afb1335,9840d5b,9840d5b,9ab7f44,9840d5b,9ab7f44,9ab7f44,9ab7f44,9840d5b,9840d5b,9840d5b,9840d5b..afb1335
--- a/Documentation/filesystems/ext3.txt
+++ b/Documentation/filesystems/ext3.txt
@@@@@@@@@@@@@ -52,33 -46,32 -46,32 -46,32 -46,32 -46,32 -46,32 -46,32 -46,32 -46,32 -46,32 -46,32 +52,33 @@@@@@@@@@@@@ commit=nrsec (*) Ext3 can be told to sy
Setting it to very large values will improve
performance.
-----------barrier=1 This enables/disables barriers. barrier=0 disables it,
----------- barrier=1 enables it.
+++++++++++barrier=1 This enables/disables barriers. barrier=0 disables
+++++++++++ it, barrier=1 enables it.
-----------orlov (*) This enables the new Orlov block allocator. It's enabled
----------- by default.
+++++++++++orlov (*) This enables the new Orlov block allocator. It is
+++++++++++ enabled by default.
-----------oldalloc This disables the Orlov block allocator and enables the
----------- old block allocator. Orlov should have better performance,
----------- we'd like to get some feedback if it's the contrary for
----------- you.
+++++++++++oldalloc This disables the Orlov block allocator and enables
+++++++++++ the old block allocator. Orlov should have better
+++++++++++ performance - we'd like to get some feedback if it's
+++++++++++ the contrary for you.
-- - ----user_xattr Enables Extended User Attributes. Additionally, you need
-- - ---- to have extended attribute support enabled in the kernel
-- - ---- configuration (CONFIG_EXT3_FS_XATTR). See the attr(5)
-- - ---- manual page and http://acl.bestbits.at to learn more
-- - ---- about extended attributes.
- --- user_xattr (*) Enables POSIX Extended Attributes. It's enabled by
- --- default, however you need to confifure its support
- --- (CONFIG_EXT3_FS_XATTR). This is neccesary if you want
- --- to use POSIX Acces Control Lists support. You can visit
- --- http://acl.bestbits.at to know more about POSIX Extended
- --- attributes.
+++++++++++user_xattr Enables Extended User Attributes. Additionally, you
+++++++++++ need to have extended attribute support enabled in the
+++++++++++ kernel configuration (CONFIG_EXT3_FS_XATTR). See the
+++++++++++ attr(5) manual page and http://acl.bestbits.at/ to
+++++++++++ learn more about extended attributes.
- --- nouser_xattr Disables POSIX Extended Attributes.
+ +++ nouser_xattr Disables Extended User Attributes.
-- - ----acl Enables POSIX Access Control Lists support. Additionally,
-- - ---- you need to have ACL support enabled in the kernel
-- - ---- configuration (CONFIG_EXT3_FS_POSIX_ACL). See the acl(5)
-- - ---- manual page and http://acl.bestbits.at for more
-- - ---- information.
- --- acl (*) Enables POSIX Access Control Lists support. This is
- --- enabled by default, however you need to configure
- --- its support (CONFIG_EXT3_FS_POSIX_ACL). If you want
- --- to know more about ACLs visit http://acl.bestbits.at
+++++++++++acl Enables POSIX Access Control Lists support.
+++++++++++ Additionally, you need to have ACL support enabled in
+++++++++++ the kernel configuration (CONFIG_EXT3_FS_POSIX_ACL).
+++++++++++ See the acl(5) manual page and http://acl.bestbits.at/
+++++++++++ for more information.
-----------noacl This option disables POSIX Access Control List support.
+++++++++++noacl This option disables POSIX Access Control List
+++++++++++ support.
reservation
diff --cc Documentation/filesystems/ocfs2.txt
index f2595ca,f2595ca,0000000,0000000,0000000,0000000,0000000,0000000,f2595ca,0000000,f2595ca,f2595ca..f2595ca
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/Documentation/filesystems/ocfs2.txt
+++ b/Documentation/filesystems/ocfs2.txt
diff --cc Documentation/filesystems/spufs.txt
index 8edc395,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..8edc395
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/filesystems/spufs.txt
+++ b/Documentation/filesystems/spufs.txt
diff --cc Documentation/hrtimers.txt
index 7620ff7,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..7620ff7
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/hrtimers.txt
+++ b/Documentation/hrtimers.txt
diff --cc Documentation/kernel-parameters.txt
index 1cbcf65,a482fde,5dffcfe,5dffcfe,5dffcfe,2ad64ef,5dffcfe,5dffcfe,a482fde,5dffcfe,a482fde,a482fde..8437036
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@@@@@@@@@@@@ -712,17 -711,9 -703,9 -703,9 -703,9 -708,9 -703,9 -703,9 -711,9 -703,9 -711,9 -711,9 +717,17 @@@@@@@@@@@@@ running once the system is up
load_ramdisk= [RAM] List of ramdisks to load from floppy
See Documentation/ramdisk.txt.
----------- lockd.udpport= [NFS]
+++++++++++ lockd.nlm_grace_period=P [NFS] Assign grace period.
+++++++++++ Format: <integer>
+++++++++++
+++++++++++ lockd.nlm_tcpport=N [NFS] Assign TCP port.
+++++++++++ Format: <integer>
++++ ++++++
- lockd.tcpport= [NFS]
+++++++++++ lockd.nlm_timeout=T [NFS] Assign timeout value.
+++++++++++ Format: <integer>
+
---- ------ lockd.tcpport= [NFS]
+++++++++++ lockd.nlm_udpport=M [NFS] Assign UDP port.
+++++++++++ Format: <integer>
logibm.irq= [HW,MOUSE] Logitech Bus Mouse Driver
Format: <irq>
diff --cc Documentation/mutex-design.txt
index cbf7988,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..cbf7988
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/mutex-design.txt
+++ b/Documentation/mutex-design.txt
diff --cc Documentation/networking/gianfar.txt
index ad474ea,ad474ea,0000000,0000000,0000000,0000000,0000000,0000000,ad474ea,0000000,ad474ea,ad474ea..ad474ea
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/Documentation/networking/gianfar.txt
+++ b/Documentation/networking/gianfar.txt
diff --cc Documentation/pci-error-recovery.txt
index d089967,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..d089967
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/pci-error-recovery.txt
+++ b/Documentation/pci-error-recovery.txt
diff --cc Documentation/scsi/aacraid.txt
index 820fd07,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..820fd07
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/scsi/aacraid.txt
+++ b/Documentation/scsi/aacraid.txt
diff --cc Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
index e651ed8,4963d83,260334c,260334c,260334c,260334c,260334c,260334c,4963d83,260334c,4963d83,4963d83..e651ed8
--- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
@@@@@@@@@@@@@ -5577,24 -5577,24 -5530,18 -5530,18 -5530,18 -5530,18 -5530,18 -5530,18 -5577,24 -5530,18 -5577,24 -5577,24 +5577,24 @@@@@@@@@@@@@ struct _snd_pcm_runtime
<informalexample>
<programlisting>
<![CDATA[
- - -- static int mychip_suspend(strut pci_dev *pci, pm_message_t state)
------ - static int mychip_suspend(snd_card_t *card, pm_message_t state)
+++++++++++ static int mychip_suspend(struct pci_dev *pci, pm_message_t state)
{
/* (1) */
------ - mychip_t *chip = card->pm_private_data;
++++++ + struct snd_card *card = pci_get_drvdata(pci);
++++++ + struct mychip *chip = card->private_data;
/* (2) */
------ - snd_pcm_suspend_all(chip->pcm);
++++++ + snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
/* (3) */
------ - snd_mychip_save_registers(chip);
++++++ + snd_pcm_suspend_all(chip->pcm);
/* (4) */
------ - snd_mychip_stop_hardware(chip);
++++++ + snd_ac97_suspend(chip->ac97);
/* (5) */
------ - pci_disable_device(chip->pci);
++++++ + snd_mychip_save_registers(chip);
++++++ + /* (6) */
++++++ + snd_mychip_stop_hardware(chip);
++++++ + /* (7) */
++++++ + pci_disable_device(pci);
++++++ + pci_save_state(pci);
return 0;
}
]]>
diff --cc Documentation/spi/butterfly
index a2e8c8d,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..a2e8c8d
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/spi/butterfly
+++ b/Documentation/spi/butterfly
diff --cc Documentation/spi/spi-summary
index a5ffba3,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..a5ffba3
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/spi/spi-summary
+++ b/Documentation/spi/spi-summary
diff --cc Documentation/x86_64/cpu-hotplug-spec
index 5c0fa34,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..5c0fa34
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/x86_64/cpu-hotplug-spec
+++ b/Documentation/x86_64/cpu-hotplug-spec
diff --cc MAINTAINERS
index 3f8a90a,bce7123,da6973a,a74a0c7,6af6830,a74a0c7,a74a0c7,a74a0c7,bce7123,6af6830,bce7123,bce7123..3f8a90a
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@@@@@@@@@@@@ -543,9 -543,16 -536,16 -536,15 -536,16 -536,15 -536,15 -536,15 -543,16 -536,16 -543,16 -543,16 +543,9 @@@@@@@@@@@@@ P: Mauro Carvalho Cheha
M: mchehab@brturbo.com.br
L: video4linux-list@redhat.com
W: http://linuxtv.org
- T: quilt http://www.linuxtv.org/download/quilt/
-- --- S: Maintained
-- ---
-- --- BUSLOGIC SCSI DRIVER
-- --- P: Leonard N. Zubkoff
-- --- M: Leonard N. Zubkoff <lnz@dandelion.com>
-- --- L: linux-scsi@vger.kernel.org
-- --- W: http://www.dandelion.com/Linux/
++ +++ T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
S: Maintained
- - ----BUSLOGIC SCSI DRIVER
- - ----P: Leonard N. Zubkoff
- - ----M: Leonard N. Zubkoff <lnz@dandelion.com>
- - ----L: linux-scsi@vger.kernel.org
- - ----W: http://www.dandelion.com/Linux/
- - ----S: Maintained
- - ----
COMMON INTERNET FILE SYSTEM (CIFS)
P: Steve French
M: sfrench@samba.org
@@@@@@@@@@@@@ -839,7 -844,7 -834,7 -833,6 -834,7 -833,6 -833,6 -833,6 -844,7 -834,7 -844,7 -844,7 +839,7 @@@@@@@@@@@@@ P: LinuxTV.org Projec
M: linux-dvb-maintainer@linuxtv.org
L: linux-dvb@linuxtv.org (subscription required)
W: http://linuxtv.org/
- T: quilt http://www.linuxtv.org/download/quilt/
++ +++ T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
S: Supported
EATA-DMA SCSI DRIVER
@@@@@@@@@@@@@ -1914,20 -1897,20 -1894,11 -1883,11 -1894,11 -1883,11 -1883,11 -1883,11 -1897,20 -1894,11 -1897,20 -1897,20 +1914,20 @@@@@@@@@@@@@ W: http://linux-ntfs.sf.net
T: git kernel.org:/pub/scm/linux/kernel/git/aia21/ntfs-2.6.git
S: Maintained
-----------NVIDIA (RIVA) FRAMEBUFFER DRIVER
-----------P: Ani Joshi
-----------M: ajoshi@shell.unixbox.com
-----------L: linux-nvidia@lists.surfsouth.com
-----------S: Maintained
+++++++++++NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER
+++++++++++P: Antonino Daplas
+++++++++++M: adaplas@pol.net
+++++++++++L: linux-fbdev-devel@lists.sourceforge.net
+++++++++++S: Maintained
++++++ +
++++++ + ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
++++++ + P: Mark Fasheh
++++++ + M: mark.fasheh@oracle.com
++++++ + P: Kurt Hackel
++++++ + M: kurt.hackel@oracle.com
++++++ + L: ocfs2-devel@oss.oracle.com
++++++ + W: http://oss.oracle.com/projects/ocfs2/
++++++ + S: Supported
OLYMPIC NETWORK DRIVER
P: Peter De Shrijver
@@@@@@@@@@@@@ -2949,15 -2913,15 -2896,9 -2885,8 -2896,9 -2885,8 -2885,8 -2885,8 -2913,15 -2896,9 -2913,15 -2913,15 +2949,15 @@@@@@@@@@@@@ P: Mauro Carvalho Cheha
M: mchehab@brturbo.com.br
L: video4linux-list@redhat.com
W: http://linuxtv.org
- T: quilt http://www.linuxtv.org/download/quilt/
++ +++ T: git kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb.git
++ +++ S: Maintained
++ +++
++++++ + VT8231 HARDWARE MONITOR DRIVER
++++++ + P: Roger Lucas
++++++ + M: roger@planbit.co.uk
++++++ + L: lm-sensors@lm-sensors.org
+ + S: Maintained
+ +
W1 DALLAS'S 1-WIRE BUS
P: Evgeniy Polyakov
M: johnpol@2ka.mipt.ru
diff --cc Makefile
index 252a659,599e744,ad457e1,5187fee,497884d,4643d57,5187fee,5187fee,599e744,f937f1f,599e744,599e744..252a659
--- a/Makefile
+++ b/Makefile
@@@@@@@@@@@@@ -1,8 -1,8 -1,8 -1,8 -1,8 -1,8 -1,8 -1,8 -1,8 -1,8 -1,8 -1,8 +1,8 @@@@@@@@@@@@@
VERSION = 2
PATCHLEVEL = 6
-----------SUBLEVEL = 15
- - - --EXTRAVERSION =
- EXTRAVERSION =-rc5
- -- EXTRAVERSION =-rc3
- EXTRAVERSION =-rc4
-- --- NAME=Affluent Albatross
- EXTRAVERSION =-rc7
+++++++++++SUBLEVEL = 16
+++++++++++EXTRAVERSION =-rc1
++ +++ NAME=Sliding Snow Leopard
# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
diff --cc arch/arm/boot/compressed/head-at91rm9200.S
index 2119ea6,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..2119ea6
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/boot/compressed/head-at91rm9200.S
+++ b/arch/arm/boot/compressed/head-at91rm9200.S
diff --cc arch/arm/boot/compressed/head-epxa10db.S
index 0000000,757681f,757681f,757681f,757681f,757681f,757681f,757681f,757681f,757681f,757681f,757681f..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/boot/compressed/head-epxa10db.S
+++ /dev/null
diff --cc arch/arm/common/amba.c
index 0000000,c95ec9e,e101311,e101311,e101311,e101311,e101311,e101311,c95ec9e,e101311,c95ec9e,c95ec9e..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/common/amba.c
+++ /dev/null
@@@@@@@@@@@@@ -1,0 -1,359 -1,359 -1,359 -1,359 -1,359 -1,359 -1,359 -1,359 -1,359 -1,359 -1,359 +1,0 @@@@@@@@@@@@@
-----------/*
----------- * linux/arch/arm/common/amba.c
----------- *
----------- * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved.
----------- *
----------- * This program is free software; you can redistribute it and/or modify
----------- * it under the terms of the GNU General Public License version 2 as
----------- * published by the Free Software Foundation.
----------- */
-----------#include <linux/module.h>
-----------#include <linux/init.h>
-----------#include <linux/device.h>
-----------#include <linux/string.h>
-----------#include <linux/slab.h>
-----------
-----------#include <asm/io.h>
-----------#include <asm/irq.h>
-----------#include <asm/hardware/amba.h>
-----------#include <asm/sizes.h>
-----------
-----------#define to_amba_device(d) container_of(d, struct amba_device, dev)
-----------#define to_amba_driver(d) container_of(d, struct amba_driver, drv)
-----------
-----------static struct amba_id *
-----------amba_lookup(struct amba_id *table, struct amba_device *dev)
-----------{
----------- int ret = 0;
-----------
----------- while (table->mask) {
----------- ret = (dev->periphid & table->mask) == table->id;
----------- if (ret)
----------- break;
----------- table++;
----------- }
-----------
----------- return ret ? table : NULL;
-----------}
-----------
-----------static int amba_match(struct device *dev, struct device_driver *drv)
-----------{
----------- struct amba_device *pcdev = to_amba_device(dev);
----------- struct amba_driver *pcdrv = to_amba_driver(drv);
-----------
----------- return amba_lookup(pcdrv->id_table, pcdev) != NULL;
-----------}
-----------
-----------#ifdef CONFIG_HOTPLUG
- - --static int amba_uevent(struct device *dev, char **envp, int nr_env, char *buf, int bufsz)
------ - static int amba_hotplug(struct device *dev, char **envp, int nr_env, char *buf, int bufsz)
-----------{
----------- struct amba_device *pcdev = to_amba_device(dev);
-----------
----------- if (nr_env < 2)
----------- return -ENOMEM;
-----------
----------- snprintf(buf, bufsz, "AMBA_ID=%08x", pcdev->periphid);
----------- *envp++ = buf;
----------- *envp++ = NULL;
----------- return 0;
-----------}
-----------#else
- - --#define amba_uevent NULL
------ - #define amba_hotplug NULL
-----------#endif
-----------
-----------static int amba_suspend(struct device *dev, pm_message_t state)
-----------{
----------- struct amba_driver *drv = to_amba_driver(dev->driver);
----------- int ret = 0;
-----------
----------- if (dev->driver && drv->suspend)
----------- ret = drv->suspend(to_amba_device(dev), state);
----------- return ret;
-----------}
-----------
-----------static int amba_resume(struct device *dev)
-----------{
----------- struct amba_driver *drv = to_amba_driver(dev->driver);
----------- int ret = 0;
-----------
----------- if (dev->driver && drv->resume)
----------- ret = drv->resume(to_amba_device(dev));
----------- return ret;
-----------}
-----------
-----------/*
----------- * Primecells are part of the Advanced Microcontroller Bus Architecture,
----------- * so we call the bus "amba".
----------- */
-----------static struct bus_type amba_bustype = {
----------- .name = "amba",
----------- .match = amba_match,
- - -- .uevent = amba_uevent,
------ - .hotplug = amba_hotplug,
----------- .suspend = amba_suspend,
----------- .resume = amba_resume,
-----------};
-----------
-----------static int __init amba_init(void)
-----------{
----------- return bus_register(&amba_bustype);
-----------}
-----------
-----------postcore_initcall(amba_init);
-----------
-----------/*
----------- * These are the device model conversion veneers; they convert the
----------- * device model structures to our more specific structures.
----------- */
-----------static int amba_probe(struct device *dev)
-----------{
----------- struct amba_device *pcdev = to_amba_device(dev);
----------- struct amba_driver *pcdrv = to_amba_driver(dev->driver);
----------- struct amba_id *id;
-----------
----------- id = amba_lookup(pcdrv->id_table, pcdev);
-----------
----------- return pcdrv->probe(pcdev, id);
-----------}
-----------
-----------static int amba_remove(struct device *dev)
-----------{
----------- struct amba_driver *drv = to_amba_driver(dev->driver);
----------- return drv->remove(to_amba_device(dev));
-----------}
-----------
-----------static void amba_shutdown(struct device *dev)
-----------{
----------- struct amba_driver *drv = to_amba_driver(dev->driver);
----------- drv->shutdown(to_amba_device(dev));
-----------}
-----------
-----------/**
----------- * amba_driver_register - register an AMBA device driver
----------- * @drv: amba device driver structure
----------- *
----------- * Register an AMBA device driver with the Linux device model
----------- * core. If devices pre-exist, the drivers probe function will
----------- * be called.
----------- */
-----------int amba_driver_register(struct amba_driver *drv)
-----------{
----------- drv->drv.bus = &amba_bustype;
-----------
-----------#define SETFN(fn) if (drv->fn) drv->drv.fn = amba_##fn
----------- SETFN(probe);
----------- SETFN(remove);
----------- SETFN(shutdown);
-----------
----------- return driver_register(&drv->drv);
-----------}
-----------
-----------/**
----------- * amba_driver_unregister - remove an AMBA device driver
----------- * @drv: AMBA device driver structure to remove
----------- *
----------- * Unregister an AMBA device driver from the Linux device
----------- * model. The device model will call the drivers remove function
----------- * for each device the device driver is currently handling.
----------- */
-----------void amba_driver_unregister(struct amba_driver *drv)
-----------{
----------- driver_unregister(&drv->drv);
-----------}
-----------
-----------
-----------static void amba_device_release(struct device *dev)
-----------{
----------- struct amba_device *d = to_amba_device(dev);
-----------
----------- if (d->res.parent)
----------- release_resource(&d->res);
----------- kfree(d);
-----------}
-----------
-----------#define amba_attr(name,fmt,arg...) \
-----------static ssize_t show_##name(struct device *_dev, struct device_attribute *attr, char *buf) \
-----------{ \
----------- struct amba_device *dev = to_amba_device(_dev); \
----------- return sprintf(buf, fmt, arg); \
-----------} \
-----------static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)
-----------
-----------amba_attr(id, "%08x\n", dev->periphid);
-----------amba_attr(irq0, "%u\n", dev->irq[0]);
-----------amba_attr(irq1, "%u\n", dev->irq[1]);
-----------amba_attr(resource, "\t%08lx\t%08lx\t%08lx\n",
----------- dev->res.start, dev->res.end, dev->res.flags);
-----------
-----------/**
----------- * amba_device_register - register an AMBA device
----------- * @dev: AMBA device to register
----------- * @parent: parent memory resource
----------- *
----------- * Setup the AMBA device, reading the cell ID if present.
----------- * Claim the resource, and register the AMBA device with
----------- * the Linux device manager.
----------- */
-----------int amba_device_register(struct amba_device *dev, struct resource *parent)
-----------{
----------- u32 pid, cid;
----------- void __iomem *tmp;
----------- int i, ret;
-----------
----------- dev->dev.release = amba_device_release;
----------- dev->dev.bus = &amba_bustype;
----------- dev->dev.dma_mask = &dev->dma_mask;
----------- dev->res.name = dev->dev.bus_id;
-----------
----------- if (!dev->dev.coherent_dma_mask && dev->dma_mask)
----------- dev_warn(&dev->dev, "coherent dma mask is unset\n");
-----------
----------- ret = request_resource(parent, &dev->res);
----------- if (ret == 0) {
----------- tmp = ioremap(dev->res.start, SZ_4K);
----------- if (!tmp) {
----------- ret = -ENOMEM;
----------- goto out;
----------- }
-----------
----------- for (pid = 0, i = 0; i < 4; i++)
----------- pid |= (readl(tmp + 0xfe0 + 4 * i) & 255) << (i * 8);
----------- for (cid = 0, i = 0; i < 4; i++)
----------- cid |= (readl(tmp + 0xff0 + 4 * i) & 255) << (i * 8);
-----------
----------- iounmap(tmp);
-----------
----------- if (cid == 0xb105f00d)
----------- dev->periphid = pid;
-----------
----------- if (dev->periphid)
----------- ret = device_register(&dev->dev);
----------- else
----------- ret = -ENODEV;
-----------
----------- if (ret == 0) {
----------- device_create_file(&dev->dev, &dev_attr_id);
----------- if (dev->irq[0] != NO_IRQ)
----------- device_create_file(&dev->dev, &dev_attr_irq0);
----------- if (dev->irq[1] != NO_IRQ)
----------- device_create_file(&dev->dev, &dev_attr_irq1);
----------- device_create_file(&dev->dev, &dev_attr_resource);
----------- } else {
----------- out:
----------- release_resource(&dev->res);
----------- }
----------- }
----------- return ret;
-----------}
-----------
-----------/**
----------- * amba_device_unregister - unregister an AMBA device
----------- * @dev: AMBA device to remove
----------- *
----------- * Remove the specified AMBA device from the Linux device
----------- * manager. All files associated with this object will be
----------- * destroyed, and device drivers notified that the device has
----------- * been removed. The AMBA device's resources including
----------- * the amba_device structure will be freed once all
----------- * references to it have been dropped.
----------- */
-----------void amba_device_unregister(struct amba_device *dev)
-----------{
----------- device_unregister(&dev->dev);
-----------}
-----------
-----------
-----------struct find_data {
----------- struct amba_device *dev;
----------- struct device *parent;
----------- const char *busid;
----------- unsigned int id;
----------- unsigned int mask;
-----------};
-----------
-----------static int amba_find_match(struct device *dev, void *data)
-----------{
----------- struct find_data *d = data;
----------- struct amba_device *pcdev = to_amba_device(dev);
----------- int r;
-----------
----------- r = (pcdev->periphid & d->mask) == d->id;
----------- if (d->parent)
----------- r &= d->parent == dev->parent;
----------- if (d->busid)
----------- r &= strcmp(dev->bus_id, d->busid) == 0;
-----------
----------- if (r) {
----------- get_device(dev);
----------- d->dev = pcdev;
----------- }
-----------
----------- return r;
-----------}
-----------
-----------/**
----------- * amba_find_device - locate an AMBA device given a bus id
----------- * @busid: bus id for device (or NULL)
----------- * @parent: parent device (or NULL)
----------- * @id: peripheral ID (or 0)
----------- * @mask: peripheral ID mask (or 0)
----------- *
----------- * Return the AMBA device corresponding to the supplied parameters.
----------- * If no device matches, returns NULL.
----------- *
----------- * NOTE: When a valid device is found, its refcount is
----------- * incremented, and must be decremented before the returned
----------- * reference.
----------- */
-----------struct amba_device *
-----------amba_find_device(const char *busid, struct device *parent, unsigned int id,
----------- unsigned int mask)
-----------{
----------- struct find_data data;
-----------
----------- data.dev = NULL;
----------- data.parent = parent;
----------- data.busid = busid;
----------- data.id = id;
----------- data.mask = mask;
-----------
----------- bus_for_each_dev(&amba_bustype, NULL, &data, amba_find_match);
-----------
----------- return data.dev;
-----------}
-----------
-----------/**
----------- * amba_request_regions - request all mem regions associated with device
----------- * @dev: amba_device structure for device
----------- * @name: name, or NULL to use driver name
----------- */
-----------int amba_request_regions(struct amba_device *dev, const char *name)
-----------{
----------- int ret = 0;
-----------
----------- if (!name)
----------- name = dev->dev.driver->name;
-----------
----------- if (!request_mem_region(dev->res.start, SZ_4K, name))
----------- ret = -EBUSY;
-----------
----------- return ret;
-----------}
-----------
-----------/**
----------- * amba_release_regions - release mem regions assoicated with device
----------- * @dev: amba_device structure for device
----------- *
----------- * Release regions claimed by a successful call to amba_request_regions.
----------- */
-----------void amba_release_regions(struct amba_device *dev)
-----------{
----------- release_mem_region(dev->res.start, SZ_4K);
-----------}
-----------
-----------EXPORT_SYMBOL(amba_driver_register);
-----------EXPORT_SYMBOL(amba_driver_unregister);
-----------EXPORT_SYMBOL(amba_device_register);
-----------EXPORT_SYMBOL(amba_device_unregister);
-----------EXPORT_SYMBOL(amba_find_device);
-----------EXPORT_SYMBOL(amba_request_regions);
-----------EXPORT_SYMBOL(amba_release_regions);
diff --cc arch/arm/common/sharpsl_pm.c
index 978d32e,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..978d32e
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/common/sharpsl_pm.c
+++ b/arch/arm/common/sharpsl_pm.c
diff --cc arch/arm/common/vic.c
index a45ed16,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..a45ed16
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
diff --cc arch/arm/configs/at91rm9200dk_defconfig
index 5cdd13a,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..5cdd13a
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/configs/at91rm9200dk_defconfig
+++ b/arch/arm/configs/at91rm9200dk_defconfig
diff --cc arch/arm/configs/at91rm9200ek_defconfig
index 20838cc,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..20838cc
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/configs/at91rm9200ek_defconfig
+++ b/arch/arm/configs/at91rm9200ek_defconfig
diff --cc arch/arm/configs/csb337_defconfig
index 885a318,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..885a318
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/configs/csb337_defconfig
+++ b/arch/arm/configs/csb337_defconfig
diff --cc arch/arm/configs/csb637_defconfig
index 95a96a5,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..95a96a5
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/configs/csb637_defconfig
+++ b/arch/arm/configs/csb637_defconfig
diff --cc arch/arm/configs/epxa10db_defconfig
index 0000000,9fb8b58,9fb8b58,9fb8b58,9fb8b58,9fb8b58,9fb8b58,9fb8b58,9fb8b58,9fb8b58,9fb8b58,9fb8b58..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/configs/epxa10db_defconfig
+++ /dev/null
diff --cc arch/arm/kernel/calls.S
index 75e6f9a,55076a7,2ad4aa2,2ad4aa2,55076a7,2ad4aa2,2ad4aa2,2ad4aa2,55076a7,55076a7,55076a7,55076a7..75e6f9a
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@@@@@@@@@@@@ -131,7 -131,7 -131,7 -131,7 -131,7 -131,7 -131,7 -131,7 -131,7 -131,7 -131,7 -131,7 +131,7 @@@@@@@@@@@@@
.long sys_wait4
/* 115 */ .long sys_swapoff
.long sys_sysinfo
- - ---- .long sys_ipc
-- --- .long sys_ipc_wrapper
+++++++++++ .long OBSOLETE(ABI(sys_ipc, sys_oabi_ipc))
.long sys_fsync
.long sys_sigreturn_wrapper
/* 120 */ .long sys_clone_wrapper
@@@@@@@@@@@@@ -280,11 -280,11 -280,11 -280,11 -280,11 -280,11 -280,11 -280,11 -280,11 -280,11 -280,11 -280,11 +280,11 @@@@@@@@@@@@@
.long sys_clock_gettime
.long sys_clock_getres
/* 265 */ .long sys_clock_nanosleep
----------- .long sys_statfs64
----------- .long sys_fstatfs64
+++++++++++ .long sys_statfs64_wrapper
+++++++++++ .long sys_fstatfs64_wrapper
.long sys_tgkill
.long sys_utimes
-- --- /* 270 */ .long sys_arm_fadvise64_64_wrapper
++ +++ /* 270 */ .long sys_arm_fadvise64_64
.long sys_pciconfig_iobase
.long sys_pciconfig_read
.long sys_pciconfig_write
@@@@@@@@@@@@@ -333,11 -333,12 -333,12 -333,12 -333,12 -333,12 -333,12 -333,12 -333,12 -333,12 -333,12 -333,12 +333,11 @@@@@@@@@@@@@
.long sys_inotify_init
.long sys_inotify_add_watch
.long sys_inotify_rm_watch
-- --- .long sys_mbind_wrapper
++ +++ .long sys_mbind
/* 320 */ .long sys_get_mempolicy
.long sys_set_mempolicy
-----------__syscall_end:
----------- .rept NR_syscalls - (__syscall_end - __syscall_start) / 4
+++++++++++ .rept NR_syscalls - (. - 100b) / 4
.long sys_ni_syscall
.endr
#endif
diff --cc arch/arm/kernel/entry-common.S
index 2b92ce8,e2b4299,f7f1830,f7f1830,e2b4299,f7f1830,f7f1830,f7f1830,e2b4299,e2b4299,e2b4299,e2b4299..2b92ce8
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@@@@@@@@@@@@ -175,26 -145,13 -145,13 -145,13 -145,13 -145,13 -145,13 -145,13 -145,13 -145,13 -145,13 -145,13 +175,26 @@@@@@@@@@@@@ ENTRY(vector_swi
#endif
enable_irq
- - ---- stmdb sp!, {r4, r5} @ push fifth and sixth args
-- --- str r4, [sp, #-S_OFF]! @ push fifth arg
-----------
get_thread_info tsk
+++++++++++ adr tbl, sys_call_table @ load syscall table pointer
ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing
+++++++++++
+++++++++++#if defined(CONFIG_OABI_COMPAT)
+++++++++++ /*
+++++++++++ * If the swi argument is zero, this is an EABI call and we do nothing.
+++++++++++ *
+++++++++++ * If this is an old ABI call, get the syscall number into scno and
+++++++++++ * get the old ABI syscall table address.
+++++++++++ */
+++++++++++ bics r10, r10, #0xff000000
+++++++++++ eorne scno, r10, #__NR_OABI_SYSCALL_BASE
+++++++++++ ldrne tbl, =sys_oabi_call_table
+++++++++++#elif !defined(CONFIG_AEABI)
bic scno, scno, #0xff000000 @ mask off SWI op-code
eor scno, scno, #__NR_SYSCALL_BASE @ check OS number
----------- adr tbl, sys_call_table @ load syscall table pointer
+++++++++++#endif
+++++++++++
+++++++++++ stmdb sp!, {r4, r5} @ push fifth and sixth args
tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls?
bne __sys_trace
@@@@@@@@@@@@@ -264,10 -204,10 -204,10 -204,10 -204,10 -204,10 -204,10 -204,10 -204,10 -204,10 -204,10 -204,10 +264,10 @@@@@@@@@@@@@ ENTRY(sys_call_table
* Special system call wrappers
*/
@ r0 = syscall number
-- --- @ r5 = syscall table
++ +++ @ r8 = syscall table
.type sys_syscall, #function
sys_syscall:
----------- eor scno, r0, #__NR_SYSCALL_BASE
+++++++++++ eor scno, r0, #__NR_OABI_SYSCALL_BASE
cmp scno, #__NR_syscall - __NR_SYSCALL_BASE
cmpne scno, #NR_syscalls @ check range
stmloia sp, {r5, r6} @ shuffle args
@@@@@@@@@@@@@ -315,16 -255,6 -255,22 -255,22 -255,6 -255,22 -255,22 -255,22 -255,6 -255,6 -255,6 -255,6 +315,16 @@@@@@@@@@@@@ sys_sigaltstack_wrapper
ldr r2, [sp, #S_OFF + S_SP]
b do_sigaltstack
-- --- sys_futex_wrapper:
-- --- str r5, [sp, #4] @ push sixth arg
-- --- b sys_futex
-- ---
-- --- sys_arm_fadvise64_64_wrapper:
-- --- str r5, [sp, #4] @ push r5 to stack
-- --- b sys_arm_fadvise64_64
+++++++++++sys_statfs64_wrapper:
+++++++++++ teq r1, #88
+++++++++++ moveq r1, #84
+++++++++++ b sys_statfs64
+ + ++++
-- --- sys_mbind_wrapper:
-- --- str r5, [sp, #4]
-- --- b sys_mbind
-- ---
-- --- sys_ipc_wrapper:
-- --- str r5, [sp, #4] @ push sixth arg
-- --- b sys_ipc
+++++++++++sys_fstatfs64_wrapper:
+++++++++++ teq r1, #88
+++++++++++ moveq r1, #84
+++++++++++ b sys_fstatfs64
+ + ++++
/*
* Note: off_4k (r5) is always units of 4K. If we can't do the requested
* offset, we return EINVAL.
diff --cc arch/arm/kernel/sys_oabi-compat.c
index eafa8e5,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..eafa8e5
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/kernel/sys_oabi-compat.c
+++ b/arch/arm/kernel/sys_oabi-compat.c
diff --cc arch/arm/mach-at91rm9200/Kconfig
index 4b7218f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..4b7218f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/Kconfig
+++ b/arch/arm/mach-at91rm9200/Kconfig
diff --cc arch/arm/mach-at91rm9200/Makefile
index 75e6ee3,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..75e6ee3
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/Makefile
+++ b/arch/arm/mach-at91rm9200/Makefile
diff --cc arch/arm/mach-at91rm9200/Makefile.boot
index e667dcc,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..e667dcc
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/Makefile.boot
+++ b/arch/arm/mach-at91rm9200/Makefile.boot
diff --cc arch/arm/mach-at91rm9200/board-csb337.c
index 54022e5,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..54022e5
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/board-csb337.c
+++ b/arch/arm/mach-at91rm9200/board-csb337.c
diff --cc arch/arm/mach-at91rm9200/board-csb637.c
index 8195f9d,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..8195f9d
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/board-csb637.c
+++ b/arch/arm/mach-at91rm9200/board-csb637.c
diff --cc arch/arm/mach-at91rm9200/board-dk.c
index 8a78336,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..8a78336
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/board-dk.c
+++ b/arch/arm/mach-at91rm9200/board-dk.c
diff --cc arch/arm/mach-at91rm9200/board-ek.c
index fd0752e,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..fd0752e
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/board-ek.c
+++ b/arch/arm/mach-at91rm9200/board-ek.c
diff --cc arch/arm/mach-at91rm9200/clock.c
index ec8195a,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..ec8195a
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/clock.c
+++ b/arch/arm/mach-at91rm9200/clock.c
diff --cc arch/arm/mach-at91rm9200/common.c
index 3848fd2,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..3848fd2
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/common.c
+++ b/arch/arm/mach-at91rm9200/common.c
diff --cc arch/arm/mach-at91rm9200/devices.c
index 8df3e52,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..8df3e52
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/devices.c
+++ b/arch/arm/mach-at91rm9200/devices.c
diff --cc arch/arm/mach-at91rm9200/generic.h
index 9bd541e,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..9bd541e
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/generic.h
+++ b/arch/arm/mach-at91rm9200/generic.h
diff --cc arch/arm/mach-at91rm9200/gpio.c
index 2fd2ef5,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..2fd2ef5
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/gpio.c
+++ b/arch/arm/mach-at91rm9200/gpio.c
diff --cc arch/arm/mach-at91rm9200/irq.c
index cb62bc8,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..cb62bc8
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/irq.c
+++ b/arch/arm/mach-at91rm9200/irq.c
diff --cc arch/arm/mach-at91rm9200/time.c
index 1b6dd2d,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..1b6dd2d
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-at91rm9200/time.c
+++ b/arch/arm/mach-at91rm9200/time.c
diff --cc arch/arm/mach-clps711x/dma.c
index 0000000,af5a4de,af5a4de,af5a4de,af5a4de,af5a4de,af5a4de,af5a4de,af5a4de,af5a4de,af5a4de,af5a4de..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/mach-clps711x/dma.c
+++ /dev/null
diff --cc arch/arm/mach-epxa10db/Kconfig
index 0000000,55d896d,55d896d,55d896d,55d896d,55d896d,55d896d,55d896d,55d896d,55d896d,55d896d,55d896d..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/mach-epxa10db/Kconfig
+++ /dev/null
diff --cc arch/arm/mach-epxa10db/Makefile
index 0000000,24fbd7d,24fbd7d,24fbd7d,24fbd7d,24fbd7d,24fbd7d,24fbd7d,24fbd7d,24fbd7d,24fbd7d,24fbd7d..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/mach-epxa10db/Makefile
+++ /dev/null
diff --cc arch/arm/mach-epxa10db/Makefile.boot
index 0000000,28bec7d,28bec7d,28bec7d,28bec7d,28bec7d,28bec7d,28bec7d,28bec7d,28bec7d,28bec7d,28bec7d..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/mach-epxa10db/Makefile.boot
+++ /dev/null
diff --cc arch/arm/mach-epxa10db/arch.c
index 0000000,44c5657,44c5657,44c5657,44c5657,44c5657,44c5657,44c5657,44c5657,44c5657,44c5657,44c5657..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/mach-epxa10db/arch.c
+++ /dev/null
diff --cc arch/arm/mach-epxa10db/dma.c
index 0000000,0151e9f,0151e9f,0151e9f,0151e9f,0151e9f,0151e9f,0151e9f,0151e9f,0151e9f,0151e9f,0151e9f..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/mach-epxa10db/dma.c
+++ /dev/null
diff --cc arch/arm/mach-epxa10db/irq.c
index 0000000,9bf927e,9bf927e,9bf927e,9bf927e,9bf927e,9bf927e,9bf927e,9bf927e,9bf927e,9bf927e,9bf927e..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/mach-epxa10db/irq.c
+++ /dev/null
diff --cc arch/arm/mach-epxa10db/mm.c
index 0000000,cfd0d21,cfd0d21,cfd0d21,cfd0d21,cfd0d21,cfd0d21,cfd0d21,cfd0d21,cfd0d21,cfd0d21,cfd0d21..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/mach-epxa10db/mm.c
+++ /dev/null
diff --cc arch/arm/mach-epxa10db/time.c
index 0000000,4b1084d,4b1084d,4b1084d,4b1084d,4b1084d,4b1084d,4b1084d,4b1084d,4b1084d,4b1084d,4b1084d..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/mach-epxa10db/time.c
+++ /dev/null
diff --cc arch/arm/mach-integrator/dma.c
index 0000000,aae6f23,aae6f23,aae6f23,aae6f23,aae6f23,aae6f23,aae6f23,aae6f23,aae6f23,aae6f23,aae6f23..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/arm/mach-integrator/dma.c
+++ /dev/null
diff --cc arch/arm/mach-ixp4xx/nas100d-pci.c
index 26b7c00,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..26b7c00
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-ixp4xx/nas100d-pci.c
+++ b/arch/arm/mach-ixp4xx/nas100d-pci.c
diff --cc arch/arm/mach-ixp4xx/nas100d-power.c
index 2bec69b,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..2bec69b
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-ixp4xx/nas100d-power.c
+++ b/arch/arm/mach-ixp4xx/nas100d-power.c
diff --cc arch/arm/mach-ixp4xx/nas100d-setup.c
index 856d56f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..856d56f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
diff --cc arch/frv/kernel/Makefile
index 5a827b3,422f30e,981c2c7,981c2c7,981c2c7,981c2c7,981c2c7,981c2c7,422f30e,981c2c7,422f30e,422f30e..5a827b3
--- a/arch/frv/kernel/Makefile
+++ b/arch/frv/kernel/Makefile
@@@@@@@@@@@@@ -20,5 -20,4 -20,3 -20,3 -20,3 -20,3 -20,3 -20,3 -20,4 -20,3 -20,4 -20,4 +20,5 @@@@@@@@@@@@@ obj-$(CONFIG_FUJITSU_MB93493) += irq-mb
obj-$(CONFIG_PM) += pm.o cmode.o
obj-$(CONFIG_MB93093_PDK) += pm-mb93093.o
obj-$(CONFIG_SYSCTL) += sysctl.o
++++++ + obj-$(CONFIG_FUTEX) += futex.o
+++++++++++obj-$(CONFIG_MODULES) += module.o
diff --cc arch/frv/kernel/futex.c
index eae874a,eae874a,0000000,0000000,0000000,0000000,0000000,0000000,eae874a,0000000,eae874a,eae874a..eae874a
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/frv/kernel/futex.c
+++ b/arch/frv/kernel/futex.c
diff --cc arch/frv/kernel/module.c
index 850d168,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..850d168
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/frv/kernel/module.c
+++ b/arch/frv/kernel/module.c
diff --cc arch/frv/kernel/signal.c
index 679c1d5,5b7146f,d4ccc07,d4ccc07,d4ccc07,d4ccc07,d4ccc07,d4ccc07,5b7146f,d4ccc07,5b7146f,5b7146f..679c1d5
--- a/arch/frv/kernel/signal.c
+++ b/arch/frv/kernel/signal.c
@@@@@@@@@@@@@ -35,6 -35,8 -35,8 -35,8 -35,8 -35,8 -35,8 -35,8 -35,8 -35,8 -35,8 -35,8 +35,6 @@@@@@@@@@@@@ struct fdpic_func_descriptor
unsigned long GOT;
};
- - --static int do_signal(sigset_t *oldset);
------ - asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset);
-----------
/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
@@@@@@@@@@@@@ -47,10 -51,58 -51,58 -51,58 -51,58 -51,58 -51,58 -51,58 -51,58 -51,58 -51,58 -51,58 +47,10 @@@@@@@@@@@@@ asmlinkage int sys_sigsuspend(int histo
recalc_sigpending();
spin_unlock_irq(&current->sighand->siglock);
----------- __frame->gr8 = -EINTR;
----------- while (1) {
----------- current->state = TASK_INTERRUPTIBLE;
----------- schedule();
- - -- if (do_signal(&saveset))
------ - if (do_signal(__frame, &saveset))
----------- /* return the signal number as the return value of this function
----------- * - this is an utterly evil hack. syscalls should not invoke do_signal()
----------- * as entry.S sets regs->gr8 to the return value of the system call
----------- * - we can't just use sigpending() as we'd have to discard SIG_IGN signals
----------- * and call waitpid() if SIGCHLD needed discarding
----------- * - this only works on the i386 because it passes arguments to the signal
----------- * handler on the stack, and the return value in EAX is effectively
----------- * discarded
----------- */
----------- return __frame->gr8;
----------- }
-----------}
-----------
-----------asmlinkage int sys_rt_sigsuspend(sigset_t __user *unewset, size_t sigsetsize)
-----------{
----------- sigset_t saveset, newset;
-----------
----------- /* XXX: Don't preclude handling different sized sigset_t's. */
----------- if (sigsetsize != sizeof(sigset_t))
----------- return -EINVAL;
-----------
----------- if (copy_from_user(&newset, unewset, sizeof(newset)))
----------- return -EFAULT;
----------- sigdelsetmask(&newset, ~_BLOCKABLE);
-----------
----------- spin_lock_irq(&current->sighand->siglock);
----------- saveset = current->blocked;
----------- current->blocked = newset;
----------- recalc_sigpending();
----------- spin_unlock_irq(&current->sighand->siglock);
-----------
----------- __frame->gr8 = -EINTR;
----------- while (1) {
----------- current->state = TASK_INTERRUPTIBLE;
----------- schedule();
- - -- if (do_signal(&saveset))
------ - if (do_signal(__frame, &saveset))
----------- /* return the signal number as the return value of this function
----------- * - this is an utterly evil hack. syscalls should not invoke do_signal()
----------- * as entry.S sets regs->gr8 to the return value of the system call
----------- * - we can't just use sigpending() as we'd have to discard SIG_IGN signals
----------- * and call waitpid() if SIGCHLD needed discarding
----------- * - this only works on the i386 because it passes arguments to the signal
----------- * handler on the stack, and the return value in EAX is effectively
----------- * discarded
----------- */
----------- return __frame->gr8;
----------- }
+++++++++++ current->state = TASK_INTERRUPTIBLE;
+++++++++++ schedule();
+++++++++++ set_thread_flag(TIF_RESTORE_SIGMASK);
+++++++++++ return -ERESTARTNOHAND;
}
asmlinkage int sys_sigaction(int sig,
@@@@@@@@@@@@@ -310,22 -362,22 -362,18 -362,18 -362,18 -362,18 -362,18 -362,18 -362,22 -362,18 -362,22 -362,22 +310,22 @@@@@@@@@@@@@ static int setup_frame(int sig, struct
set_fs(USER_DS);
++++++ + /* the tracer may want to single-step inside the handler */
++++++ + if (test_thread_flag(TIF_SINGLESTEP))
++++++ + ptrace_notify(SIGTRAP);
++++++ +
#if DEBUG_SIG
printk("SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n",
------ - sig, current->comm, current->pid, frame, regs->pc, frame->pretcode);
++++++ + sig, current->comm, current->pid, frame, __frame->pc,
++++++ + frame->pretcode);
#endif
- - -- return 1;
------ - return;
+++++++++++ return 0;
give_sigsegv:
------ - if (sig == SIGSEGV)
------ - ka->sa.sa_handler = SIG_DFL;
------ -
force_sig(SIGSEGV, current);
- - -- return 0;
+++++++++++ return -EFAULT;
++++++ +
} /* end setup_frame() */
/*****************************************************************************/
@@@@@@@@@@@@@ -409,21 -461,21 -457,17 -457,17 -457,17 -457,17 -457,17 -457,17 -461,21 -457,17 -461,21 -461,21 +409,21 @@@@@@@@@@@@@ static int setup_rt_frame(int sig, stru
set_fs(USER_DS);
++++++ + /* the tracer may want to single-step inside the handler */
++++++ + if (test_thread_flag(TIF_SINGLESTEP))
++++++ + ptrace_notify(SIGTRAP);
++++++ +
#if DEBUG_SIG
printk("SIG deliver %d (%s:%d): sp=%p pc=%lx ra=%p\n",
------ - sig, current->comm, current->pid, frame, regs->pc, frame->pretcode);
++++++ + sig, current->comm, current->pid, frame, __frame->pc,
++++++ + frame->pretcode);
#endif
- - -- return 1;
------ - return;
+++++++++++ return 0;
give_sigsegv:
------ - if (sig == SIGSEGV)
------ - ka->sa.sa_handler = SIG_DFL;
force_sig(SIGSEGV, current);
- - -- return 0;
+++++++++++ return -EFAULT;
} /* end setup_rt_frame() */
@@@@@@@@@@@@@ -460,22 -512,22 -502,16 -502,16 -502,16 -502,16 -502,16 -502,16 -512,22 -502,16 -512,22 -512,22 +460,22 @@@@@@@@@@@@@ static int handle_signal(unsigned long
/* Set up the stack frame */
if (ka->sa.sa_flags & SA_SIGINFO)
------ - setup_rt_frame(sig, ka, info, oldset, regs);
++++++ + ret = setup_rt_frame(sig, ka, info, oldset);
else
------ - setup_frame(sig, ka, oldset, regs);
++++++ + ret = setup_frame(sig, ka, oldset);
++++++ +
- - -- if (ret) {
+++++++++++ if (ret == 0) {
++++++ + spin_lock_irq(&current->sighand->siglock);
++++++ + sigorsets(&current->blocked, &current->blocked,
++++++ + &ka->sa.sa_mask);
++++++ + if (!(ka->sa.sa_flags & SA_NODEFER))
++++++ + sigaddset(&current->blocked, sig);
++++++ + recalc_sigpending();
++++++ + spin_unlock_irq(&current->sighand->siglock);
++++++ + }
++++++ +
++++++ + return ret;
------ - spin_lock_irq(&current->sighand->siglock);
------ - sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
------ - if (!(ka->sa.sa_flags & SA_NODEFER))
------ - sigaddset(&current->blocked, sig);
------ - recalc_sigpending();
------ - spin_unlock_irq(&current->sighand->siglock);
} /* end handle_signal() */
/*****************************************************************************/
@@@@@@@@@@@@@ -484,7 -536,7 -520,7 -520,7 -520,7 -520,7 -520,7 -520,7 -536,7 -520,7 -536,7 -536,7 +484,7 @@@@@@@@@@@@@
* want to handle. Thus you cannot kill init even with a SIGKILL even by
* mistake.
*/
- - --static int do_signal(sigset_t *oldset)
------ - int do_signal(struct pt_regs *regs, sigset_t *oldset)
+++++++++++static void do_signal(void)
{
struct k_sigaction ka;
siginfo_t info;
@@@@@@@@@@@@@ -497,57 -548,38 -532,39 -532,39 -532,39 -532,39 -532,39 -532,39 -548,38 -532,39 -548,38 -548,38 +497,57 @@@@@@@@@@@@@
* kernel mode. Just return without doing anything
* if so.
*/
------ - if (!user_mode(regs))
------ - return 1;
++++++ + if (!user_mode(__frame))
- - -- return 1;
+++++++++++ return;
if (try_to_freeze())
goto no_signal;
----------- if (!oldset)
+++++++++++ if (test_thread_flag(TIF_RESTORE_SIGMASK))
+++++++++++ oldset = &current->saved_sigmask;
+++++++++++ else
oldset = &current->blocked;
------ - signr = get_signal_to_deliver(&info, &ka, regs, NULL);
++++++ + signr = get_signal_to_deliver(&info, &ka, __frame, NULL);
- - -- if (signr > 0)
- - -- return handle_signal(signr, &info, &ka, oldset);
+ + ++ if (signr > 0) {
------ - handle_signal(signr, &info, &ka, oldset, regs);
------ - return 1;
+++++++++++ if (handle_signal(signr, &info, &ka, oldset) == 0) {
+++++++++++ /* a signal was successfully delivered; the saved
+++++++++++ * sigmask will have been stored in the signal frame,
+++++++++++ * and will be restored by sigreturn, so we can simply
+++++++++++ * clear the TIF_RESTORE_SIGMASK flag */
+++++++++++ if (test_thread_flag(TIF_RESTORE_SIGMASK))
+++++++++++ clear_thread_flag(TIF_RESTORE_SIGMASK);
+++++++++++ }
+++++++++++
+++++++++++ return;
+ + ++ }
------ - no_signal:
++++++ + no_signal:
/* Did we come from a system call? */
------ - if (regs->syscallno >= 0) {
++++++ + if (__frame->syscallno >= 0) {
/* Restart the system call - no handlers present */
- - -- if (__frame->gr8 == -ERESTARTNOHAND ||
- - -- __frame->gr8 == -ERESTARTSYS ||
- - -- __frame->gr8 == -ERESTARTNOINTR) {
------ - if (regs->gr8 == -ERESTARTNOHAND ||
------ - regs->gr8 == -ERESTARTSYS ||
------ - regs->gr8 == -ERESTARTNOINTR) {
------ - regs->gr8 = regs->orig_gr8;
------ - regs->pc -= 4;
------ - }
+++++++++++ switch (__frame->gr8) {
+++++++++++ case -ERESTARTNOHAND:
+++++++++++ case -ERESTARTSYS:
+++++++++++ case -ERESTARTNOINTR:
++++++ + __frame->gr8 = __frame->orig_gr8;
++++++ + __frame->pc -= 4;
- - -- }
+++++++++++ break;
- - -- if (__frame->gr8 == -ERESTART_RESTARTBLOCK){
------ - if (regs->gr8 == -ERESTART_RESTARTBLOCK){
------ - regs->gr8 = __NR_restart_syscall;
------ - regs->pc -= 4;
+++++++++++ case -ERESTART_RESTARTBLOCK:
++++++ + __frame->gr8 = __NR_restart_syscall;
++++++ + __frame->pc -= 4;
+++++++++++ break;
}
}
----------- return 0;
+++++++++++ /* if there's no signal to deliver, we just put the saved sigmask
+++++++++++ * back */
+++++++++++ if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
+++++++++++ clear_thread_flag(TIF_RESTORE_SIGMASK);
+++++++++++ sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL);
+++++++++++ }
++++++ +
} /* end do_signal() */
/*****************************************************************************/
@@@@@@@@@@@@@ -562,7 -594,7 -579,7 -579,7 -579,7 -579,7 -579,7 -579,7 -594,7 -579,7 -594,7 -594,7 +562,7 @@@@@@@@@@@@@ asmlinkage void do_notify_resume(__u32
clear_thread_flag(TIF_SINGLESTEP);
/* deal with pending signal delivery */
----------- if (thread_info_flags & _TIF_SIGPENDING)
- - -- do_signal(NULL);
------ - do_signal(__frame, NULL);
+++++++++++ if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK))
+++++++++++ do_signal();
} /* end do_notify_resume() */
diff --cc arch/frv/lib/__ucmpdi2.S
index d892f16,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..d892f16
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/frv/lib/__ucmpdi2.S
+++ b/arch/frv/lib/__ucmpdi2.S
diff --cc arch/frv/mb93090-mb00/pci-iomap.c
index 068fa04,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..068fa04
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/frv/mb93090-mb00/pci-iomap.c
+++ b/arch/frv/mb93090-mb00/pci-iomap.c
diff --cc arch/i386/kernel/acpi/processor.c
index 0000000,0000000,0000000,0000000,0000000,0000000,9f4cc02,0000000,0000000,0000000,0000000,0000000..9f4cc02
mode 000000,000000,000000,000000,000000,000000,100644,000000,000000,000000,000000,000000..100644
--- a/arch/i386/kernel/acpi/processor.c
+++ b/arch/i386/kernel/acpi/processor.c
diff --cc arch/i386/kernel/cpu/changelog
index 0000000,cef76b8,cef76b8,cef76b8,cef76b8,cef76b8,cef76b8,cef76b8,cef76b8,cef76b8,cef76b8,cef76b8..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/i386/kernel/cpu/changelog
+++ /dev/null
diff --cc arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 7975e79,871366b,871366b,871366b,871366b,871366b,8a5e159,871366b,871366b,871366b,871366b,871366b..3852d0a
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@@@@@@@@@@@@ -365,16 -367,15 -367,15 -367,15 -367,15 -367,15 -305,8 -367,15 -367,15 -367,15 -367,15 -367,15 +303,9 @@@@@@@@@@@@@ acpi_cpufreq_cpu_init
unsigned int cpu = policy->cpu;
struct cpufreq_acpi_io *data;
unsigned int result = 0;
----- -----
----- ----- union acpi_object arg0 = {ACPI_TYPE_BUFFER};
----- ----- u32 arg0_buf[3];
----- ----- struct acpi_object_list arg_list = {1, &arg0};
+++++++++++ struct cpuinfo_x86 *c = &cpu_data[policy->cpu];
- union acpi_object arg0 = {ACPI_TYPE_BUFFER};
- u32 arg0_buf[3];
- struct acpi_object_list arg_list = {1, &arg0};
-
dprintk("acpi_cpufreq_cpu_init\n");
------ ----- /* setup arg_list for _PDC settings */
------ ----- arg0.buffer.length = 12;
------ ----- arg0.buffer.pointer = (u8 *) arg0_buf;
data = kzalloc(sizeof(struct cpufreq_acpi_io), GFP_KERNEL);
if (!data)
diff --cc arch/i386/kernel/cpu/cpufreq/speedstep-est-common.h
index 0000000,5ce995c,5ce995c,5ce995c,5ce995c,5ce995c,5ce995c,5ce995c,5ce995c,5ce995c,5ce995c,5ce995c..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/i386/kernel/cpu/cpufreq/speedstep-est-common.h
+++ /dev/null
diff --cc arch/i386/kernel/cpu/mtrr/changelog
index 0000000,af13685,af13685,af13685,af13685,af13685,af13685,af13685,af13685,af13685,af13685,af13685..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/i386/kernel/cpu/mtrr/changelog
+++ /dev/null
diff --cc arch/i386/kernel/crash_dump.c
index 3f532df,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..3f532df
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/i386/kernel/crash_dump.c
+++ b/arch/i386/kernel/crash_dump.c
diff --cc arch/i386/kernel/process.c
index 2185377,45e7f0a,df6c2bc,df6c2bc,2333aea,df6c2bc,df6c2bc,df6c2bc,45e7f0a,df6c2bc,45e7f0a,45e7f0a..2185377
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@@@@@@@@@@@@ -529,7 -539,12 -551,10 -551,10 -551,12 -551,10 -551,10 -551,10 -539,12 -551,10 -539,12 -539,12 +529,7 @@@@@@@@@@@@@ EXPORT_SYMBOL(dump_thread)
*/
int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
{
----------- struct pt_regs ptregs;
-----------
----------- ptregs = *(struct pt_regs *)
- - - -- ((unsigned long)tsk->thread_info +
- - - -- /* see comments in copy_thread() about -8 */
- - - -- THREAD_SIZE - sizeof(ptregs) - 8);
-- --- - ((unsigned long)tsk->thread_info+THREAD_SIZE - sizeof(ptregs));
+++++++++++ struct pt_regs ptregs = *task_pt_regs(tsk);
ptregs.xcs &= 0xffff;
ptregs.xds &= 0xffff;
ptregs.xes &= 0xffff;
diff --cc arch/i386/mm/ioremap.c
index 247fde7,247fde7,8498b5a,5d09de8,247fde7,5d09de8,5d09de8,5d09de8,247fde7,247fde7,247fde7,247fde7..247fde7
--- a/arch/i386/mm/ioremap.c
+++ b/arch/i386/mm/ioremap.c
@@@@@@@@@@@@@ -245,27 -245,27 -245,27 -239,14 -245,27 -239,14 -239,14 -239,14 -245,27 -245,27 -245,27 -245,27 +245,27 @@@@@@@@@@@@@ void iounmap(volatile void __iomem *add
addr < phys_to_virt(ISA_END_ADDRESS))
return;
- addr = (volatile void *)(PAGE_MASK & (unsigned long __force)addr);
- --- write_lock(&vmlist_lock);
- --- p = __remove_vm_area((void *)(PAGE_MASK & (unsigned long __force)addr));
- --- if (!p) {
- --- printk(KERN_WARNING "iounmap: bad address %p\n", addr);
++ +++ addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long __force)addr);
+ +++
+ +++ /* Use the vm area unlocked, assuming the caller
+ +++ ensures there isn't another iounmap for the same address
+ +++ in parallel. Reuse of the virtual address is prevented by
+ +++ leaving it in the global lists until we're done with it.
+ +++ cpa takes care of the direct mappings. */
+ +++ read_lock(&vmlist_lock);
+ +++ for (p = vmlist; p; p = p->next) {
+ +++ if (p->addr == addr)
+ +++ break;
+ +++ }
+ +++ read_unlock(&vmlist_lock);
+ +++
+ +++ if (!p) {
+ +++ printk("iounmap: bad address %p\n", addr);
dump_stack();
- --- goto out_unlock;
+ +++ return;
}
+ +++ /* Reset the direct mapping. Can block */
if ((p->flags >> 20) && p->phys_addr < virt_to_phys(high_memory) - 1) {
change_page_attr(virt_to_page(__va(p->phys_addr)),
p->size >> PAGE_SHIFT,
diff --cc arch/i386/pci/irq.c
index e715aa9,ee8e016,19e6f48,19e6f48,19e6f48,19e6f48,19e6f48,19e6f48,ee8e016,19e6f48,ee8e016,ee8e016..e715aa9
--- a/arch/i386/pci/irq.c
+++ b/arch/i386/pci/irq.c
@@@@@@@@@@@@@ -847,12 -846,9 -846,9 -846,9 -846,9 -846,9 -846,9 -846,9 -846,9 -846,9 -846,9 -846,9 +847,12 @@@@@@@@@@@@@ static int pcibios_lookup_irq(struct pc
* reported by the device if possible.
*/
newirq = dev->irq;
------ - if (!((1 << newirq) & mask)) {
++++++ + if (newirq && !((1 << newirq) & mask)) {
if ( pci_probe & PCI_USE_PIRQ_MASK) newirq = 0;
----------- else printk(KERN_WARNING "PCI: IRQ %i for device %s doesn't match PIRQ mask - try pci=usepirqmask\n", newirq, pci_name(dev));
+++++++++++ else printk("\n" KERN_WARNING
+++++++++++ "PCI: IRQ %i for device %s doesn't match PIRQ mask "
+++++++++++ "- try pci=usepirqmask\n" KERN_DEBUG, newirq,
+++++++++++ pci_name(dev));
}
if (!newirq && assign) {
for (i = 0; i < 16; i++) {
diff --cc arch/i386/pci/mmconfig.c
index 4bb4d4b,4bb4d4b,08a0849,dfbf80c,4bb4d4b,dfbf80c,dfbf80c,dfbf80c,4bb4d4b,4bb4d4b,4bb4d4b,4bb4d4b..4bb4d4b
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@@@@@@@@@@@@ -130,37 -130,37 -130,37 -116,6 -130,37 -116,6 -116,6 -116,6 -130,37 -130,37 -130,37 -130,37 +130,37 @@@@@@@@@@@@@ static struct pci_raw_ops pci_mmcfg =
.write = pci_mmcfg_write,
};
+ +++ /* K8 systems have some devices (typically in the builtin northbridge)
+ +++ that are only accessible using type1
+ +++ Normally this can be expressed in the MCFG by not listing them
+ +++ and assigning suitable _SEGs, but this isn't implemented in some BIOS.
+ +++ Instead try to discover all devices on bus 0 that are unreachable using MM
+ +++ and fallback for them.
+ +++ We only do this for bus 0/seg 0 */
+ +++ static __init void unreachable_devices(void)
+ +++ {
+ +++ int i;
+ +++ unsigned long flags;
+ +++
+ +++ for (i = 0; i < 32; i++) {
+ +++ u32 val1;
+ +++ u32 addr;
+ +++
+ +++ pci_conf1_read(0, 0, PCI_DEVFN(i, 0), 0, 4, &val1);
+ +++ if (val1 == 0xffffffff)
+ +++ continue;
+ +++
+ +++ /* Locking probably not needed, but safer */
+ +++ spin_lock_irqsave(&pci_config_lock, flags);
+ +++ addr = get_base_addr(0, 0, PCI_DEVFN(i, 0));
+ +++ if (addr != 0)
+ +++ pci_exp_set_dev_base(addr, 0, PCI_DEVFN(i, 0));
- if (addr == 0 || readl((u32 *)addr) != val1)
++ +++ if (addr == 0 || readl((u32 __iomem *)mmcfg_virt_addr) != val1)
+ +++ set_bit(i, fallback_slots);
+ +++ spin_unlock_irqrestore(&pci_config_lock, flags);
+ +++ }
+ +++ }
+ +++
static int __init pci_mmcfg_init(void)
{
if ((pci_probe & PCI_PROBE_MMCONF) == 0)
diff --cc arch/ia64/configs/sn2_defconfig
index 3cb503b,ff8bb37,e1924cc,87cfd31,ff8bb37,87cfd31,87cfd31,87cfd31,ff8bb37,ff8bb37,ff8bb37,ff8bb37..3cb503b
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@@@@@@@@@@@@ -111,9 -111,9 -111,9 -90,13 -111,9 -90,13 -90,13 -90,13 -111,9 -111,9 -111,9 -111,9 +111,9 @@@@@@@@@@@@@ CONFIG_IA64_L1_CACHE_SHIFT=
# CONFIG_IA64_CYCLONE is not set
CONFIG_IOSAPIC=y
CONFIG_IA64_SGI_SN_XP=m
- --- CONFIG_FORCE_MAX_ZONEORDER=18
+ +++ CONFIG_FORCE_MAX_ZONEORDER=17
CONFIG_SMP=y
-- --- CONFIG_NR_CPUS=512
++ +++ CONFIG_NR_CPUS=1024
# CONFIG_HOTPLUG_CPU is not set
CONFIG_SCHED_SMT=y
CONFIG_PREEMPT=y
diff --cc arch/ia64/ia32/ia32_ioctl.c
index 0000000,8873939,8873939,8873939,8873939,8873939,8873939,8873939,8873939,8873939,8873939,8873939..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ia64/ia32/ia32_ioctl.c
+++ /dev/null
diff --cc arch/ia64/kernel/acpi-processor.c
index 0000000,0000000,0000000,0000000,0000000,0000000,e683630,0000000,0000000,0000000,0000000,0000000..e683630
mode 000000,000000,000000,000000,000000,000000,100644,000000,000000,000000,000000,000000..100644
--- a/arch/ia64/kernel/acpi-processor.c
+++ b/arch/ia64/kernel/acpi-processor.c
diff --cc arch/ia64/kernel/perfmon_montecito.h
index cd06ac6,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..cd06ac6
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/ia64/kernel/perfmon_montecito.h
+++ b/arch/ia64/kernel/perfmon_montecito.h
diff --cc arch/ia64/kernel/process.c
index 309d596,e9904c7,e9904c7,2e33665,e9904c7,2e33665,2e33665,2e33665,e9904c7,e9904c7,e9904c7,e9904c7..309d596
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@@@@@@@@@@@@ -721,13 -721,13 -721,13 -721,8 -721,13 -721,8 -721,8 -721,8 -721,13 -721,13 -721,13 -721,13 +721,13 @@@@@@@@@@@@@ flush_thread (void
/* drop floating-point and debug-register state if it exists: */
current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID);
ia64_drop_fpu(current);
- --- if (IS_IA32_PROCESS(ia64_task_regs(current)))
+ +++ #ifdef CONFIG_IA32_SUPPORT
-- - ---- if (IS_IA32_PROCESS(ia64_task_regs(current))) {
+++++++++++ if (IS_IA32_PROCESS(task_pt_regs(current))) {
ia32_drop_partial_page_list(current);
+ +++ current->thread.task_size = IA32_PAGE_OFFSET;
+ +++ set_fs(USER_DS);
+ +++ }
+ +++ #endif
}
/*
diff --cc arch/ia64/kernel/salinfo.c
index 9d5a823,1461dc6,1461dc6,ca68e6e,1461dc6,ca68e6e,ca68e6e,ca68e6e,1461dc6,1461dc6,1461dc6,1461dc6..9d5a823
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@@@@@@@@@@@@ -308,11 -289,11 -289,11 -289,11 -289,11 -289,11 -289,11 -289,11 -289,11 -289,11 -289,11 -289,11 +308,11 @@@@@@@@@@@@@ salinfo_event_read(struct file *file, c
int i, n, cpu = -1;
retry:
----------- if (down_trylock(&data->sem)) {
+++++++++++ if (cpus_empty(data->cpu_event) && down_trylock(&data->mutex)) {
if (file->f_flags & O_NONBLOCK)
return -EAGAIN;
----------- if (down_interruptible(&data->sem))
- --- return -ERESTARTSYS;
+++++++++++ if (down_interruptible(&data->mutex))
+ +++ return -EINTR;
}
n = data->cpu_check;
diff --cc arch/ia64/sn/kernel/io_init.c
index 00700f7,318087e,318087e,05e4ea8,318087e,05e4ea8,05e4ea8,05e4ea8,318087e,318087e,318087e,318087e..00700f7
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@@@@@@@@@@@@ -148,62 -147,25 -147,25 -147,7 -147,25 -147,7 -147,7 -147,7 -147,25 -147,25 -147,25 -147,25 +148,62 @@@@@@@@@@@@@ sal_get_pcidev_info(u64 segment, u64 bu
}
/*
- --- * sn_fixup_ionodes() - This routine initializes the HUB data strcuture for
+ +++ * sn_pcidev_info_get() - Retrieve the pcidev_info struct for the specified
+ +++ * device.
+ +++ */
+ +++ inline struct pcidev_info *
+ +++ sn_pcidev_info_get(struct pci_dev *dev)
+ +++ {
+ +++ struct pcidev_info *pcidev;
+ +++
+ +++ list_for_each_entry(pcidev,
+ +++ &(SN_PCI_CONTROLLER(dev)->pcidev_info), pdi_list) {
+ +++ if (pcidev->pdi_linux_pcidev == dev) {
+ +++ return pcidev;
+ +++ }
+ +++ }
+ +++ return NULL;
+ +++ }
+ +++
+++++++++++/* Older PROM flush WAR
+++++++++++ *
+++++++++++ * 01/16/06 -- This war will be in place until a new official PROM is released.
+++++++++++ * Additionally note that the struct sn_flush_device_war also has to be
+++++++++++ * removed from arch/ia64/sn/include/xtalk/hubdev.h
+++++++++++ */
+++++++++++static u8 war_implemented = 0;
+++++++++++
+++++++++++static void sn_device_fixup_war(u64 nasid, u64 widget, int device,
+++++++++++ struct sn_flush_device_common *common)
+++++++++++{
+++++++++++ struct sn_flush_device_war *war_list;
+++++++++++ struct sn_flush_device_war *dev_entry;
+++++++++++ struct ia64_sal_retval isrv = {0,0,0,0};
+++++++++++
+++++++++++ if (!war_implemented) {
+++++++++++ printk(KERN_WARNING "PROM version < 4.50 -- implementing old "
+++++++++++ "PROM flush WAR\n");
+++++++++++ war_implemented = 1;
+++++++++++ }
+++++++++++
+++++++++++ war_list = kzalloc(DEV_PER_WIDGET * sizeof(*war_list), GFP_KERNEL);
+++++++++++ if (!war_list)
+++++++++++ BUG();
+++++++++++
+++++++++++ SAL_CALL_NOLOCK(isrv, SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST,
+++++++++++ nasid, widget, __pa(war_list), 0, 0, 0 ,0);
+++++++++++ if (isrv.status)
+++++++++++ panic("sn_device_fixup_war failed: %s\n",
+++++++++++ ia64_sal_strerror(isrv.status));
+++++++++++
+++++++++++ dev_entry = war_list + device;
+++++++++++ memcpy(common,dev_entry, sizeof(*common));
+++++++++++
+++++++++++ kfree(war_list);
+++++++++++}
+++++++++++
+ +++ /*
-- - ---- * sn_fixup_ionodes() - This routine initializes the HUB data strcuture for
+++++++++++ * sn_fixup_ionodes() - This routine initializes the HUB data strcuture for
* each node in the system.
*/
static void sn_fixup_ionodes(void)
@@@@@@@@@@@@@ -251,104 -213,82 -213,82 -195,38 -213,82 -195,38 -195,38 -195,38 -213,82 -213,82 -213,82 -213,82 +251,104 @@@@@@@@@@@@@
hubdev->hdi_flush_nasid_list.widget_p =
kmalloc((HUB_WIDGET_ID_MAX + 1) *
----------- sizeof(struct sn_flush_device_list *), GFP_KERNEL);
-----------
+++++++++++ sizeof(struct sn_flush_device_kernel *),
+++++++++++ GFP_KERNEL);
memset(hubdev->hdi_flush_nasid_list.widget_p, 0x0,
(HUB_WIDGET_ID_MAX + 1) *
----------- sizeof(struct sn_flush_device_list *));
+++++++++++ sizeof(struct sn_flush_device_kernel *));
for (widget = 0; widget <= HUB_WIDGET_ID_MAX; widget++) {
----------- sn_flush_device_list = kmalloc(DEV_PER_WIDGET *
----------- sizeof(struct
----------- sn_flush_device_list),
----------- GFP_KERNEL);
----------- memset(sn_flush_device_list, 0x0,
+++++++++++ sn_flush_device_kernel = kmalloc(DEV_PER_WIDGET *
+++++++++++ sizeof(struct
+++++++++++ sn_flush_device_kernel),
+++++++++++ GFP_KERNEL);
+++++++++++ if (!sn_flush_device_kernel)
+++++++++++ BUG();
+++++++++++ memset(sn_flush_device_kernel, 0x0,
DEV_PER_WIDGET *
----------- sizeof(struct sn_flush_device_list));
-----------
----------- status =
----------- sal_get_widget_dmaflush_list(nasid, widget,
----------- (uint64_t)
----------- __pa
----------- (sn_flush_device_list));
----------- if (status) {
----------- kfree(sn_flush_device_list);
----------- continue;
+++++++++++ sizeof(struct sn_flush_device_kernel));
+++++++++++
+++++++++++ dev_entry = sn_flush_device_kernel;
+++++++++++ for (device = 0; device < DEV_PER_WIDGET;
+++++++++++ device++,dev_entry++) {
+++++++++++ dev_entry->common = kmalloc(sizeof(struct
+++++++++++ sn_flush_device_common),
+++++++++++ GFP_KERNEL);
+++++++++++ if (!dev_entry->common)
+++++++++++ BUG();
+++++++++++ memset(dev_entry->common, 0x0, sizeof(struct
+++++++++++ sn_flush_device_common));
+++++++++++
+++++++++++ status = sal_get_device_dmaflush_list(nasid,
+++++++++++ widget,
+++++++++++ device,
+++++++++++ (u64)(dev_entry->common));
+++++++++++ if (status) {
+++++++++++ if (sn_sal_rev() < 0x0450) {
+++++++++++ /* shortlived WAR for older
+++++++++++ * PROM images
+++++++++++ */
+++++++++++ sn_device_fixup_war(nasid,
+++++++++++ widget,
+++++++++++ device,
+++++++++++ dev_entry->common);
+++++++++++ }
+++++++++++ else
+++++++++++ BUG();
+++++++++++ }
+++++++++++
+++++++++++ spin_lock_init(&dev_entry->sfdl_flush_lock);
}
----------- spin_lock_init(&sn_flush_device_list->sfdl_flush_lock);
----------- hubdev->hdi_flush_nasid_list.widget_p[widget] =
----------- sn_flush_device_list;
----------- }
-- - ----
+++++++++++ if (sn_flush_device_kernel)
+++++++++++ hubdev->hdi_flush_nasid_list.widget_p[widget] =
+++++++++++ sn_flush_device_kernel;
+++++++++++ }
+ +++ }
-- - ----
+ +++ }
+ +++
+ +++ /*
+ +++ * sn_pci_window_fixup() - Create a pci_window for each device resource.
+ +++ * Until ACPI support is added, we need this code
+ +++ * to setup pci_windows for use by
+ +++ * pcibios_bus_to_resource(),
+ +++ * pcibios_resource_to_bus(), etc.
+ +++ */
+ +++ static void
+ +++ sn_pci_window_fixup(struct pci_dev *dev, unsigned int count,
-- - ---- int64_t * pci_addrs)
+++++++++++ s64 * pci_addrs)
+ +++ {
+ +++ struct pci_controller *controller = PCI_CONTROLLER(dev->bus);
+ +++ unsigned int i;
+ +++ unsigned int idx;
+ +++ unsigned int new_count;
+ +++ struct pci_window *new_window;
+ +++
+ +++ if (count == 0)
+ +++ return;
+ +++ idx = controller->windows;
+ +++ new_count = controller->windows + count;
+ +++ new_window = kcalloc(new_count, sizeof(struct pci_window), GFP_KERNEL);
+ +++ if (new_window == NULL)
+ +++ BUG();
+ +++ if (controller->window) {
+ +++ memcpy(new_window, controller->window,
+ +++ sizeof(struct pci_window) * controller->windows);
+ +++ kfree(controller->window);
+ +++ }
+ +++ /* Setup a pci_window for each device resource. */
+ +++ for (i = 0; i <= PCI_ROM_RESOURCE; i++) {
+ +++ if (pci_addrs[i] == -1)
+ +++ continue;
+ +++
+ +++ new_window[idx].offset = dev->resource[i].start - pci_addrs[i];
+ +++ new_window[idx].resource = dev->resource[i];
+ +++ idx++;
}
+ +++ controller->windows = new_count;
+ +++ controller->window = new_window;
}
void sn_pci_unfixup_slot(struct pci_dev *dev)
@@@@@@@@@@@@@ -375,8 -315,8 -315,8 -252,6 -315,8 -252,6 -252,6 -252,6 -315,8 -315,8 -315,8 -315,8 +375,8 @@@@@@@@@@@@@ void sn_pci_fixup_slot(struct pci_dev *
struct pcibus_bussoft *bs;
struct pci_bus *host_pci_bus;
struct pci_dev *host_pci_dev;
+ +++ struct pcidev_info *pcidev_info;
-- - ---- int64_t pci_addrs[PCI_ROM_RESOURCE + 1];
+++++++++++ s64 pci_addrs[PCI_ROM_RESOURCE + 1];
struct sn_irq_info *sn_irq_info;
unsigned long size;
unsigned int bus_no, devfn;
diff --cc arch/ia64/sn/kernel/tiocx.c
index d263d3e,768c21d,0d8592a,0d8592a,0d8592a,0d8592a,0d8592a,0d8592a,768c21d,0d8592a,768c21d,768c21d..d263d3e
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@@@@@@@@@@@@ -77,6 -76,12 -76,12 -76,12 -76,12 -76,12 -76,12 -76,12 -76,12 -76,12 -76,12 -76,12 +77,6 @@@@@@@@@@@@@ static void tiocx_bus_release(struct de
kfree(to_cx_dev(dev));
}
-----------struct bus_type tiocx_bus_type = {
----------- .name = "tiocx",
----------- .match = tiocx_match,
- - -- .uevent = tiocx_uevent,
------ - .hotplug = tiocx_hotplug,
-----------};
-----------
/**
* cx_device_match - Find cx_device in the id table.
* @ids: id table from driver
diff --cc arch/ia64/sn/kernel/xpc.h
index 0000000,5483a9f,5483a9f,5483a9f,5483a9f,5483a9f,5483a9f,5483a9f,5483a9f,5483a9f,5483a9f,5483a9f..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ia64/sn/kernel/xpc.h
+++ /dev/null
diff --cc arch/ia64/sn/pci/pcibr/pcibr_reg.c
index 8b8bbd5,79fdb91,5d53409,5d53409,79fdb91,5d53409,5d53409,5d53409,79fdb91,79fdb91,79fdb91,79fdb91..8b8bbd5
--- a/arch/ia64/sn/pci/pcibr/pcibr_reg.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_reg.c
@@@@@@@@@@@@@ -23,9 -23,9 -23,9 -23,9 -23,9 -23,9 -23,9 -23,9 -23,9 -23,9 -23,9 -23,9 +23,9 @@@@@@@@@@@@@ union br_ptr
/*
* Control Register Access -- Read/Write 0000_0020
*/
-----------void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits)
+++++++++++void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, u64 bits)
{
-- --- union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base;
++ +++ union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
@@@@@@@@@@@@@ -43,9 -43,9 -43,9 -43,9 -43,9 -43,9 -43,9 -43,9 -43,9 -43,9 -43,9 -43,9 +43,9 @@@@@@@@@@@@@
}
}
-----------void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
+++++++++++void pcireg_control_bit_set(struct pcibus_info *pcibus_info, u64 bits)
{
-- --- union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base;
++ +++ union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
@@@@@@@@@@@@@ -66,10 -66,10 -66,10 -66,10 -66,10 -66,10 -66,10 -66,10 -66,10 -66,10 -66,10 -66,10 +66,10 @@@@@@@@@@@@@
/*
* PCI/PCIX Target Flush Register Access -- Read Only 0000_0050
*/
-----------uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info)
+++++++++++u64 pcireg_tflush_get(struct pcibus_info *pcibus_info)
{
-- --- union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base;
-- --- uint64_t ret = 0;
++ +++ union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
- - ---- uint64_t ret = 0;
+++++++++++ u64 ret = 0;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
@@@@@@@@@@@@@ -96,10 -96,10 -96,10 -96,10 -96,10 -96,10 -96,10 -96,10 -96,10 -96,10 -96,10 -96,10 +96,10 @@@@@@@@@@@@@
/*
* Interrupt Status Register Access -- Read Only 0000_0100
*/
-----------uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info)
+++++++++++u64 pcireg_intr_status_get(struct pcibus_info * pcibus_info)
{
-- --- union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base;
-- --- uint64_t ret = 0;
++ +++ union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
- - ---- uint64_t ret = 0;
+++++++++++ u64 ret = 0;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
@@@@@@@@@@@@@ -121,9 -121,9 -121,9 -121,9 -121,9 -121,9 -121,9 -121,9 -121,9 -121,9 -121,9 -121,9 +121,9 @@@@@@@@@@@@@
/*
* Interrupt Enable Register Access -- Read/Write 0000_0108
*/
-----------void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits)
+++++++++++void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, u64 bits)
{
-- --- union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base;
++ +++ union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
@@@@@@@@@@@@@ -141,9 -141,9 -141,9 -141,9 -141,9 -141,9 -141,9 -141,9 -141,9 -141,9 -141,9 -141,9 +141,9 @@@@@@@@@@@@@
}
}
-----------void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
+++++++++++void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, u64 bits)
{
-- --- union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base;
++ +++ union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
@@@@@@@@@@@@@ -165,9 -165,9 -165,9 -165,9 -165,9 -165,9 -165,9 -165,9 -165,9 -165,9 -165,9 -165,9 +165,9 @@@@@@@@@@@@@
* Intr Host Address Register (int_addr) -- Read/Write 0000_0130 - 0000_0168
*/
void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n,
----------- uint64_t addr)
+++++++++++ u64 addr)
{
-- --- union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base;
++ +++ union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
@@@@@@@@@@@@@ -217,10 -217,10 -217,10 -217,10 -217,10 -217,10 -217,10 -217,10 -217,10 -217,10 -217,10 -217,10 +217,10 @@@@@@@@@@@@@ void pcireg_force_intr_set(struct pcibu
/*
* Device(x) Write Buffer Flush Reg Access -- Read Only 0000_0240 - 0000_0258
*/
-----------uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device)
+++++++++++u64 pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device)
{
-- --- union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base;
-- --- uint64_t ret = 0;
++ +++ union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
- - ---- uint64_t ret = 0;
+++++++++++ u64 ret = 0;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
@@@@@@@@@@@@@ -242,9 -242,9 -242,9 -242,9 -242,9 -242,9 -242,9 -242,9 -242,9 -242,9 -242,9 -242,9 +242,9 @@@@@@@@@@@@@
}
void pcireg_int_ate_set(struct pcibus_info *pcibus_info, int ate_index,
----------- uint64_t val)
+++++++++++ u64 val)
{
-- --- union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base;
++ +++ union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
@@@@@@@@@@@@@ -262,10 -262,10 -262,10 -262,10 -262,10 -262,10 -262,10 -262,10 -262,10 -262,10 -262,10 -262,10 +262,10 @@@@@@@@@@@@@
}
}
- - ----uint64_t __iomem *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index)
-- --- uint64_t *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index)
+++++++++++u64 __iomem *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index)
{
-- --- union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base;
-- --- uint64_t *ret = (uint64_t *) 0;
++ +++ union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
- - ---- uint64_t __iomem *ret = NULL;
+++++++++++ u64 __iomem *ret = NULL;
if (pcibus_info) {
switch (pcibus_info->pbi_bridge_type) {
diff --cc arch/ia64/sn/pci/tioca_provider.c
index 7571a40,27aa184,46b646a,46b646a,27aa184,46b646a,46b646a,46b646a,27aa184,27aa184,27aa184,27aa184..7571a40
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@@@@@@@@@@@@ -34,14 -34,14 -34,14 -34,14 -34,14 -34,14 -34,14 -34,14 -34,14 -34,14 -34,14 -34,14 +34,14 @@@@@@@@@@@@@ static int tioca_gart_init(struct tioca
static int
tioca_gart_init(struct tioca_kernel *tioca_kern)
{
----------- uint64_t ap_reg;
----------- uint64_t offset;
+++++++++++ u64 ap_reg;
+++++++++++ u64 offset;
struct page *tmp;
struct tioca_common *tioca_common;
-- --- struct tioca *ca_base;
++ +++ struct tioca __iomem *ca_base;
tioca_common = tioca_kern->ca_common;
-- --- ca_base = (struct tioca *)tioca_common->ca_common.bs_base;
++ +++ ca_base = (struct tioca __iomem *)tioca_common->ca_common.bs_base;
if (list_empty(tioca_kern->ca_devices))
return 0;
@@@@@@@@@@@@@ -214,8 -214,8 -214,8 -214,8 -214,8 -214,8 -214,8 -214,8 -214,8 -214,8 -214,8 -214,8 +214,8 @@@@@@@@@@@@@ voi
tioca_fastwrite_enable(struct tioca_kernel *tioca_kern)
{
int cap_ptr;
----------- uint32_t reg;
-- --- struct tioca *tioca_base;
+++++++++++ u32 reg;
++ +++ struct tioca __iomem *tioca_base;
struct pci_dev *pdev;
struct tioca_common *common;
@@@@@@@@@@@@@ -318,15 -318,15 -318,15 -318,15 -318,15 -318,15 -318,15 -318,15 -318,15 -318,15 -318,15 -318,15 +318,15 @@@@@@@@@@@@@ tioca_dma_d64(unsigned long paddr
* and so a given CA can only directly target nodes in the range
* xxx - xxx+255.
*/
-----------static uint64_t
-----------tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr)
+++++++++++static u64
+++++++++++tioca_dma_d48(struct pci_dev *pdev, u64 paddr)
{
struct tioca_common *tioca_common;
-- --- struct tioca *ca_base;
-- --- uint64_t ct_addr;
++ +++ struct tioca __iomem *ca_base;
- - ---- uint64_t ct_addr;
+++++++++++ u64 ct_addr;
dma_addr_t bus_addr;
----------- uint32_t node_upper;
----------- uint64_t agp_dma_extn;
+++++++++++ u32 node_upper;
+++++++++++ u64 agp_dma_extn;
struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(pdev);
tioca_common = (struct tioca_common *)pcidev_info->pdi_pcibus_info;
diff --cc arch/m32r/kernel/io_m32104ut.c
index d26adab,d26adab,0000000,0000000,0000000,0000000,0000000,0000000,d26adab,0000000,d26adab,d26adab..d26adab
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/m32r/kernel/io_m32104ut.c
+++ b/arch/m32r/kernel/io_m32104ut.c
diff --cc arch/m32r/kernel/setup_m32104ut.c
index 6328e13,6328e13,0000000,0000000,0000000,0000000,0000000,0000000,6328e13,0000000,6328e13,6328e13..6328e13
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/m32r/kernel/setup_m32104ut.c
+++ b/arch/m32r/kernel/setup_m32104ut.c
diff --cc arch/m32r/m32104ut/defconfig.m32104ut
index 454de33,454de33,0000000,0000000,0000000,0000000,0000000,0000000,454de33,0000000,454de33,454de33..454de33
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/m32r/m32104ut/defconfig.m32104ut
+++ b/arch/m32r/m32104ut/defconfig.m32104ut
diff --cc arch/mips/configs/malta_defconfig
index da0677a,d1c4421,d1c4421,e48e1de,d1c4421,e48e1de,e48e1de,e48e1de,d1c4421,d1c4421,d1c4421,d1c4421..da0677a
--- a/arch/mips/configs/malta_defconfig
+++ b/arch/mips/configs/malta_defconfig
@@@@@@@@@@@@@ -1,7 -1,7 -1,7 -1,7 -1,7 -1,7 -1,7 -1,7 -1,7 -1,7 -1,7 -1,7 +1,7 @@@@@@@@@@@@@
#
# Automatically generated make config: don't edit
-- - ----# Linux kernel version: 2.6.15-rc2
-- - ----# Thu Nov 24 01:06:35 2005
- --- # Linux kernel version: 2.6.14
- --- # Thu Nov 10 13:42:55 2005
+++++++++++# Linux kernel version: 2.6.15-rc5
+++++++++++# Fri Dec 23 02:21:03 2005
#
CONFIG_MIPS=y
diff --cc arch/mips/kernel/ioctl32.c
index 0000000,9ea1fc7,9ea1fc7,9ea1fc7,9ea1fc7,9ea1fc7,9ea1fc7,9ea1fc7,9ea1fc7,9ea1fc7,9ea1fc7,9ea1fc7..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/mips/kernel/ioctl32.c
+++ /dev/null
diff --cc arch/parisc/kernel/ioctl32.c
index 0000000,4eada1b,4eada1b,4eada1b,4eada1b,4eada1b,4eada1b,4eada1b,4eada1b,4eada1b,4eada1b,4eada1b..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/parisc/kernel/ioctl32.c
+++ /dev/null
diff --cc arch/powerpc/boot/.gitignore
index 45c9ad2,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..45c9ad2
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/boot/.gitignore
+++ b/arch/powerpc/boot/.gitignore
diff --cc arch/powerpc/boot/dummy.c
index 31dbf45,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..31dbf45
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/boot/dummy.c
+++ b/arch/powerpc/boot/dummy.c
diff --cc arch/powerpc/boot/hack-coff.c
index 5e5a657,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..5e5a657
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/boot/hack-coff.c
+++ b/arch/powerpc/boot/hack-coff.c
diff --cc arch/powerpc/boot/rs6000.h
index 433f450,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..433f450
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/boot/rs6000.h
+++ b/arch/powerpc/boot/rs6000.h
diff --cc arch/powerpc/boot/stdio.c
index b5aa522,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..b5aa522
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/boot/stdio.c
+++ b/arch/powerpc/boot/stdio.c
diff --cc arch/powerpc/boot/zImage.coff.lds
index 6016251,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..6016251
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/boot/zImage.coff.lds
+++ b/arch/powerpc/boot/zImage.coff.lds
diff --cc arch/powerpc/configs/mpc834x_sys_defconfig
index 3bff761,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..3bff761
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/configs/mpc834x_sys_defconfig
+++ b/arch/powerpc/configs/mpc834x_sys_defconfig
diff --cc arch/powerpc/configs/pmac32_defconfig
index 2ace57d,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..2ace57d
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/configs/pmac32_defconfig
+++ b/arch/powerpc/configs/pmac32_defconfig
diff --cc arch/powerpc/kernel/crash.c
index 8c21d37,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..8c21d37
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
diff --cc arch/powerpc/kernel/crash_dump.c
index 211d726,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..211d726
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/kernel/crash_dump.c
+++ b/arch/powerpc/kernel/crash_dump.c
diff --cc arch/powerpc/kernel/ibmebus.c
index e47d40a,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..e47d40a
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/kernel/ibmebus.c
+++ b/arch/powerpc/kernel/ibmebus.c
diff --cc arch/powerpc/kernel/ioctl32.c
index 0000000,0fa3d27,0fa3d27,0fa3d27,0fa3d27,0fa3d27,0fa3d27,0fa3d27,0fa3d27,0fa3d27,0fa3d27,0fa3d27..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/powerpc/kernel/ioctl32.c
+++ /dev/null
diff --cc arch/powerpc/kernel/legacy_serial.c
index f970ace,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..f970ace
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
diff --cc arch/powerpc/kernel/machine_kexec.c
index a81ca1b,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..a81ca1b
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
diff --cc arch/powerpc/kernel/machine_kexec_32.c
index 4436061,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..4436061
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/kernel/machine_kexec_32.c
+++ b/arch/powerpc/kernel/machine_kexec_32.c
diff --cc arch/powerpc/kernel/pci_32.c
index 704c846,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..704c846
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
diff --cc arch/powerpc/kernel/prom_parse.c
index a8099c8,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..a8099c8
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
diff --cc arch/powerpc/kernel/udbg_scc.c
index 0000000,820c535,820c535,820c535,820c535,820c535,820c535,820c535,820c535,820c535,820c535,820c535..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/powerpc/kernel/udbg_scc.c
+++ /dev/null
diff --cc arch/powerpc/kernel/vdso32/.gitignore
index e45fba9,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..e45fba9
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/kernel/vdso32/.gitignore
+++ b/arch/powerpc/kernel/vdso32/.gitignore
diff --cc arch/powerpc/kernel/vdso64/.gitignore
index 3fd18cf,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..3fd18cf
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/kernel/vdso64/.gitignore
+++ b/arch/powerpc/kernel/vdso64/.gitignore
diff --cc arch/powerpc/kernel/vio.c
index 13c655b,13c4149,71a6add,71a6add,71a6add,71a6add,71a6add,71a6add,13c4149,71a6add,13c4149,13c4149..13c655b
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@@@@@@@@@@@@ -290,9 -293,6 -293,6 -293,6 -293,6 -293,6 -293,6 -293,6 -293,6 -293,6 -293,6 -293,6 +290,9 @@@@@@@@@@@@@ static int vio_hotplug(struct device *d
struct bus_type vio_bus_type = {
.name = "vio",
------ - .hotplug = vio_hotplug,
++++++ + .uevent = vio_hotplug,
.match = vio_bus_match,
+++++++++++ .probe = vio_bus_probe,
+++++++++++ .remove = vio_bus_remove,
+++++++++++ .shutdown = vio_bus_shutdown,
};
diff --cc arch/powerpc/oprofile/op_model_7450.c
index 32abfdb,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..32abfdb
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/oprofile/op_model_7450.c
+++ b/arch/powerpc/oprofile/op_model_7450.c
diff --cc arch/powerpc/platforms/83xx/Kconfig
index 7675e67,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..7675e67
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/83xx/Kconfig
+++ b/arch/powerpc/platforms/83xx/Kconfig
diff --cc arch/powerpc/platforms/83xx/Makefile
index 9d8b28e,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..9d8b28e
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/83xx/Makefile
+++ b/arch/powerpc/platforms/83xx/Makefile
diff --cc arch/powerpc/platforms/83xx/mpc834x_sys.c
index 2098dd0,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..2098dd0
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/83xx/mpc834x_sys.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_sys.c
diff --cc arch/powerpc/platforms/83xx/mpc834x_sys.h
index e4ca39f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..e4ca39f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/83xx/mpc834x_sys.h
+++ b/arch/powerpc/platforms/83xx/mpc834x_sys.h
diff --cc arch/powerpc/platforms/83xx/mpc83xx.h
index ce9e66a,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..ce9e66a
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
diff --cc arch/powerpc/platforms/83xx/pci.c
index 469cdac,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..469cdac
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/83xx/pci.c
+++ b/arch/powerpc/platforms/83xx/pci.c
diff --cc arch/powerpc/platforms/cell/Kconfig
index 3157071,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..3157071
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
diff --cc arch/powerpc/platforms/cell/pervasive.c
index e0e051c,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..e0e051c
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/pervasive.c
+++ b/arch/powerpc/platforms/cell/pervasive.c
diff --cc arch/powerpc/platforms/cell/pervasive.h
index da1fb85,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..da1fb85
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/pervasive.h
+++ b/arch/powerpc/platforms/cell/pervasive.h
diff --cc arch/powerpc/platforms/cell/spu_base.c
index d75ae03,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..d75ae03
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
diff --cc arch/powerpc/platforms/cell/spu_priv1.c
index b265642,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..b265642
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spu_priv1.c
+++ b/arch/powerpc/platforms/cell/spu_priv1.c
diff --cc arch/powerpc/platforms/cell/spu_syscalls.c
index 261b507,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..261b507
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spu_syscalls.c
+++ b/arch/powerpc/platforms/cell/spu_syscalls.c
diff --cc arch/powerpc/platforms/cell/spufs/Makefile
index a7cddf4,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..a7cddf4
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/Makefile
+++ b/arch/powerpc/platforms/cell/spufs/Makefile
diff --cc arch/powerpc/platforms/cell/spufs/backing_ops.c
index a5c489a,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..a5c489a
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/backing_ops.c
+++ b/arch/powerpc/platforms/cell/spufs/backing_ops.c
diff --cc arch/powerpc/platforms/cell/spufs/context.c
index 336f238,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..336f238
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/context.c
+++ b/arch/powerpc/platforms/cell/spufs/context.c
diff --cc arch/powerpc/platforms/cell/spufs/file.c
index dfa649c,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..dfa649c
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
diff --cc arch/powerpc/platforms/cell/spufs/hw_ops.c
index 5445719,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..5445719
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/hw_ops.c
+++ b/arch/powerpc/platforms/cell/spufs/hw_ops.c
diff --cc arch/powerpc/platforms/cell/spufs/inode.c
index b3962c3,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..b3962c3
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
diff --cc arch/powerpc/platforms/cell/spufs/run.c
index 18ea886,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..18ea886
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
diff --cc arch/powerpc/platforms/cell/spufs/sched.c
index 963182f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..963182f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
diff --cc arch/powerpc/platforms/cell/spufs/spu_restore.c
index 0bf723d,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..0bf723d
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/spu_restore.c
+++ b/arch/powerpc/platforms/cell/spufs/spu_restore.c
diff --cc arch/powerpc/platforms/cell/spufs/spu_restore_crt0.S
index 2905949,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..2905949
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/spu_restore_crt0.S
+++ b/arch/powerpc/platforms/cell/spufs/spu_restore_crt0.S
diff --cc arch/powerpc/platforms/cell/spufs/spu_restore_dump.h_shipped
index 1b2355f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..1b2355f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/spu_restore_dump.h_shipped
+++ b/arch/powerpc/platforms/cell/spufs/spu_restore_dump.h_shipped
diff --cc arch/powerpc/platforms/cell/spufs/spu_save.c
index 196033b,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..196033b
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/spu_save.c
+++ b/arch/powerpc/platforms/cell/spufs/spu_save.c
diff --cc arch/powerpc/platforms/cell/spufs/spu_save_crt0.S
index 6659d6a,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..6659d6a
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/spu_save_crt0.S
+++ b/arch/powerpc/platforms/cell/spufs/spu_save_crt0.S
diff --cc arch/powerpc/platforms/cell/spufs/spu_save_dump.h_shipped
index 39e5400,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..39e5400
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/spu_save_dump.h_shipped
+++ b/arch/powerpc/platforms/cell/spufs/spu_save_dump.h_shipped
diff --cc arch/powerpc/platforms/cell/spufs/spu_utils.h
index 58359fe,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..58359fe
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/spu_utils.h
+++ b/arch/powerpc/platforms/cell/spufs/spu_utils.h
diff --cc arch/powerpc/platforms/cell/spufs/spufs.h
index db2601f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..db2601f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
diff --cc arch/powerpc/platforms/cell/spufs/switch.c
index 212db28,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..212db28
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
diff --cc arch/powerpc/platforms/cell/spufs/syscalls.c
index e6565a9,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..e6565a9
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/cell/spufs/syscalls.c
+++ b/arch/powerpc/platforms/cell/spufs/syscalls.c
diff --cc arch/powerpc/platforms/iseries/iommu.h
index cb5658f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..cb5658f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/iseries/iommu.h
+++ b/arch/powerpc/platforms/iseries/iommu.h
diff --cc arch/powerpc/platforms/powermac/bootx_init.c
index fa8b4d7,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..fa8b4d7
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/powermac/bootx_init.c
+++ b/arch/powerpc/platforms/powermac/bootx_init.c
diff --cc arch/powerpc/platforms/powermac/feature.c
index 558dd06,f6e22da,f6e22da,0d7fa00,f6e22da,0d7fa00,0d7fa00,0d7fa00,f6e22da,f6e22da,f6e22da,f6e22da..558dd06
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@@@@@@@@@@@@ -1666,6 -1635,124 -1635,124 -1635,113 -1635,124 -1635,113 -1635,113 -1635,113 -1635,124 -1635,124 -1635,124 -1635,124 +1666,6 @@@@@@@@@@@@@ static void intrepid_shutdown(struct ma
}
-----------void pmac_tweak_clock_spreading(int enable)
-----------{
----------- struct macio_chip *macio = &macio_chips[0];
-----------
----------- /* Hack for doing clock spreading on some machines PowerBooks and
----------- * iBooks. This implements the "platform-do-clockspreading" OF
----------- * property as decoded manually on various models. For safety, we also
----------- * check the product ID in the device-tree in cases we'll whack the i2c
----------- * chip to make reasonably sure we won't set wrong values in there
----------- *
----------- * Of course, ultimately, we have to implement a real parser for
----------- * the platform-do-* stuff...
----------- */
-----------
----------- if (macio->type == macio_intrepid) {
-- - ---- struct device_node *clock =
-- - ---- of_find_node_by_path("/uni-n@f8000000/hw-clock");
-- - ---- if (clock && get_property(clock, "platform-do-clockspreading",
-- - ---- NULL)) {
-- - ---- printk(KERN_INFO "%sabling clock spreading on Intrepid"
-- - ---- " ASIC\n", enable ? "En" : "Dis");
-- - ---- if (enable)
-- - ---- UN_OUT(UNI_N_CLOCK_SPREADING, 2);
-- - ---- else
-- - ---- UN_OUT(UNI_N_CLOCK_SPREADING, 0);
-- - ---- mdelay(40);
-- - ---- }
-- - ---- of_node_put(clock);
- --- if (enable)
- --- UN_OUT(UNI_N_CLOCK_SPREADING, 2);
- --- else
- --- UN_OUT(UNI_N_CLOCK_SPREADING, 0);
- --- mdelay(40);
----------- }
-----------
----------- while (machine_is_compatible("PowerBook5,2") ||
----------- machine_is_compatible("PowerBook5,3") ||
----------- machine_is_compatible("PowerBook6,2") ||
----------- machine_is_compatible("PowerBook6,3")) {
----------- struct device_node *ui2c = of_find_node_by_type(NULL, "i2c");
----------- struct device_node *dt = of_find_node_by_name(NULL, "device-tree");
----------- u8 buffer[9];
----------- u32 *productID;
----------- int i, rc, changed = 0;
-----------
----------- if (dt == NULL)
----------- break;
----------- productID = (u32 *)get_property(dt, "pid#", NULL);
----------- if (productID == NULL)
----------- break;
----------- while(ui2c) {
----------- struct device_node *p = of_get_parent(ui2c);
----------- if (p && !strcmp(p->name, "uni-n"))
----------- break;
----------- ui2c = of_find_node_by_type(ui2c, "i2c");
----------- }
----------- if (ui2c == NULL)
----------- break;
----------- DBG("Trying to bump clock speed for PID: %08x...\n", *productID);
----------- rc = pmac_low_i2c_open(ui2c, 1);
----------- if (rc != 0)
----------- break;
----------- pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_combined);
----------- rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_read, 0x80, buffer, 9);
----------- DBG("read result: %d,", rc);
----------- if (rc != 0) {
----------- pmac_low_i2c_close(ui2c);
----------- break;
----------- }
----------- for (i=0; i<9; i++)
----------- DBG(" %02x", buffer[i]);
----------- DBG("\n");
-----------
----------- switch(*productID) {
----------- case 0x1182: /* AlBook 12" rev 2 */
----------- case 0x1183: /* iBook G4 12" */
----------- buffer[0] = (buffer[0] & 0x8f) | 0x70;
----------- buffer[2] = (buffer[2] & 0x7f) | 0x00;
----------- buffer[5] = (buffer[5] & 0x80) | 0x31;
----------- buffer[6] = (buffer[6] & 0x40) | 0xb0;
----------- buffer[7] = (buffer[7] & 0x00) | (enable ? 0xc0 : 0xba);
----------- buffer[8] = (buffer[8] & 0x00) | 0x30;
----------- changed = 1;
----------- break;
----------- case 0x3142: /* AlBook 15" (ATI M10) */
----------- case 0x3143: /* AlBook 17" (ATI M10) */
----------- buffer[0] = (buffer[0] & 0xaf) | 0x50;
----------- buffer[2] = (buffer[2] & 0x7f) | 0x00;
----------- buffer[5] = (buffer[5] & 0x80) | 0x31;
----------- buffer[6] = (buffer[6] & 0x40) | 0xb0;
----------- buffer[7] = (buffer[7] & 0x00) | (enable ? 0xd0 : 0xc0);
----------- buffer[8] = (buffer[8] & 0x00) | 0x30;
----------- changed = 1;
----------- break;
----------- default:
----------- DBG("i2c-hwclock: Machine model not handled\n");
----------- break;
----------- }
----------- if (!changed) {
----------- pmac_low_i2c_close(ui2c);
----------- break;
----------- }
-- - ---- printk(KERN_INFO "%sabling clock spreading on i2c clock chip\n",
-- - ---- enable ? "En" : "Dis");
-- - ----
----------- pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_stdsub);
----------- rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_write, 0x80, buffer, 9);
----------- DBG("write result: %d,", rc);
----------- pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_combined);
----------- rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_read, 0x80, buffer, 9);
----------- DBG("read result: %d,", rc);
----------- if (rc != 0) {
----------- pmac_low_i2c_close(ui2c);
----------- break;
----------- }
----------- for (i=0; i<9; i++)
----------- DBG(" %02x", buffer[i]);
----------- pmac_low_i2c_close(ui2c);
----------- break;
----------- }
-----------}
-----------
-----------
static int
core99_sleep(void)
{
diff --cc arch/powerpc/platforms/powermac/pfunc_base.c
index 4ffd2a9,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..4ffd2a9
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/powermac/pfunc_base.c
+++ b/arch/powerpc/platforms/powermac/pfunc_base.c
diff --cc arch/powerpc/platforms/powermac/pfunc_core.c
index c32c623,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..c32c623
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/powermac/pfunc_core.c
+++ b/arch/powerpc/platforms/powermac/pfunc_core.c
diff --cc arch/powerpc/platforms/powermac/udbg_adb.c
index 06c8265,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..06c8265
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/powermac/udbg_adb.c
+++ b/arch/powerpc/platforms/powermac/udbg_adb.c
diff --cc arch/powerpc/platforms/powermac/udbg_scc.c
index c4352a8,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..c4352a8
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/powermac/udbg_scc.c
+++ b/arch/powerpc/platforms/powermac/udbg_scc.c
diff --cc arch/powerpc/platforms/pseries/eeh_cache.c
index d4a402c,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..d4a402c
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/pseries/eeh_cache.c
+++ b/arch/powerpc/platforms/pseries/eeh_cache.c
diff --cc arch/powerpc/platforms/pseries/eeh_driver.c
index 6373372,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..6373372
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/pseries/eeh_driver.c
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
diff --cc arch/powerpc/platforms/pseries/pci_dlpar.c
index 2193478,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..2193478
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
diff --cc arch/powerpc/platforms/pseries/ras.h
index 0e66b0d,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..0e66b0d
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/platforms/pseries/ras.h
+++ b/arch/powerpc/platforms/pseries/ras.h
diff --cc arch/powerpc/sysdev/dart_iommu.c
index 977de9d,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..977de9d
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/sysdev/dart_iommu.c
+++ b/arch/powerpc/sysdev/dart_iommu.c
diff --cc arch/powerpc/sysdev/fsl_soc.c
index 064c9de,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..064c9de
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
diff --cc arch/powerpc/sysdev/fsl_soc.h
index c433d3f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..c433d3f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/sysdev/fsl_soc.h
+++ b/arch/powerpc/sysdev/fsl_soc.h
diff --cc arch/powerpc/sysdev/ipic.c
index 8f01e0f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..8f01e0f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
diff --cc arch/powerpc/sysdev/ipic.h
index a7ce7da,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..a7ce7da
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/sysdev/ipic.h
+++ b/arch/powerpc/sysdev/ipic.h
diff --cc arch/powerpc/sysdev/u3_iommu.c
index 0000000,5c1a26a,5c1a26a,5c1a26a,5c1a26a,5c1a26a,5c1a26a,5c1a26a,5c1a26a,5c1a26a,5c1a26a,5c1a26a..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/powerpc/sysdev/u3_iommu.c
+++ /dev/null
diff --cc arch/powerpc/xmon/start.c
index 712552c,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..712552c
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/powerpc/xmon/start.c
+++ b/arch/powerpc/xmon/start.c
diff --cc arch/powerpc/xmon/start_32.c
index 0000000,c2464df,c2464df,c2464df,c2464df,c2464df,c2464df,c2464df,c2464df,c2464df,c2464df,c2464df..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/powerpc/xmon/start_32.c
+++ /dev/null
diff --cc arch/powerpc/xmon/start_64.c
index 0000000,712552c,712552c,712552c,712552c,712552c,712552c,712552c,712552c,712552c,712552c,712552c..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/powerpc/xmon/start_64.c
+++ /dev/null
diff --cc arch/powerpc/xmon/start_8xx.c
index 0000000,4c17b04,4c17b04,4c17b04,4c17b04,4c17b04,4c17b04,4c17b04,4c17b04,4c17b04,4c17b04,4c17b04..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/powerpc/xmon/start_8xx.c
+++ /dev/null
diff --cc arch/ppc/Kconfig
index 11899f0,cc3f64c,cc3f64c,8fa51b0,cc3f64c,8fa51b0,8fa51b0,8fa51b0,cc3f64c,cc3f64c,cc3f64c,cc3f64c..11899f0
--- a/arch/ppc/Kconfig
+++ b/arch/ppc/Kconfig
@@@@@@@@@@@@@ -494,15 -519,11 -519,11 -519,11 -519,11 -519,11 -519,11 -519,11 -519,11 -519,11 -519,11 -519,11 +494,15 @@@@@@@@@@@@@ choic
Platform) machines (including all of the recent IBM RS/6000 and
pSeries machines), and several embedded PowerPC systems containing
4xx, 6xx, 7xx, 8xx, 74xx, and 82xx processors. Currently, the
----------- default option is to build a kernel which works on the first three.
+++++++++++ default option is to build a kernel which works on PReP and CHRP.
++ + ++++
- --- Select CHRP/PowerMac/PReP if configuring for an IBM RS/6000 or
- --- pSeries machine, a Power Macintosh (including iMacs, iBooks and
- --- Powerbooks), or a PReP machine.
+++++++++++ Note that support for Apple machines is now only available with
+++++++++++ ARCH=powerpc, and has been removed from this menu. If you wish
+++++++++++ to build a kernel for an Apple machine, exit this configuration
+++++++++++ process and re-run it with ARCH=powerpc.
+ +++
-- - ---- Select CHRP/PowerMac/PReP if configuring for an IBM RS/6000 or
-- - ---- pSeries machine, a Power Macintosh (including iMacs, iBooks and
-- - ---- Powerbooks), or a PReP machine.
+++++++++++ Select CHRP/PReP if configuring for an IBM RS/6000 or
+++++++++++ pSeries machine, or a PReP machine.
Select Gemini if configuring for a Synergy Microsystems' Gemini
series Single Board Computer. More information is available at:
@@@@@@@@@@@@@ -750,14 -767,25 -767,25 -767,25 -767,25 -767,25 -767,25 -767,25 -767,25 -767,25 -767,25 -767,25 +750,14 @@@@@@@@@@@@@ config CPM
on it (826x, 827x, 8560).
config PPC_CHRP
-- - ---- bool
- --- bool " Common Hardware Reference Platform (CHRP) based machines"
+++++++++++ bool "Support for CHRP (Common Hardware Reference Platform) machines"
depends on PPC_MULTIPLATFORM
select PPC_I8259
select PPC_INDIRECT_PCI
default y
-----------config PPC_PMAC
-- - ---- bool
- --- bool " Apple PowerMac based machines"
----------- depends on PPC_MULTIPLATFORM
----------- select PPC_INDIRECT_PCI
----------- default y
-----------
-----------config PPC_PMAC64
----------- bool
----------- depends on PPC_PMAC && POWER4
----------- default y
-----------
config PPC_PREP
-- - ---- bool
- --- bool " PowerPC Reference Platform (PReP) based machines"
+++++++++++ bool "Support for PReP (PowerPC Reference Platform) machines"
depends on PPC_MULTIPLATFORM
select PPC_I8259
select PPC_INDIRECT_PCI
diff --cc arch/ppc/boot/openfirmware/coffmain.c
index 0000000,2da8855,2da8855,2da8855,2da8855,2da8855,2da8855,2da8855,2da8855,2da8855,2da8855,2da8855..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/boot/openfirmware/coffmain.c
+++ /dev/null
diff --cc arch/ppc/boot/openfirmware/newworldmain.c
index 0000000,fa8a8f9,fa8a8f9,fa8a8f9,fa8a8f9,fa8a8f9,fa8a8f9,fa8a8f9,fa8a8f9,fa8a8f9,fa8a8f9,fa8a8f9..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/boot/openfirmware/newworldmain.c
+++ /dev/null
diff --cc arch/ppc/configs/TQM8540_defconfig
index 99bf3b7,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..99bf3b7
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/ppc/configs/TQM8540_defconfig
+++ b/arch/ppc/configs/TQM8540_defconfig
diff --cc arch/ppc/configs/TQM8541_defconfig
index 0ff5669,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..0ff5669
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/ppc/configs/TQM8541_defconfig
+++ b/arch/ppc/configs/TQM8541_defconfig
diff --cc arch/ppc/configs/TQM8555_defconfig
index 730b3db,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..730b3db
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/ppc/configs/TQM8555_defconfig
+++ b/arch/ppc/configs/TQM8555_defconfig
diff --cc arch/ppc/configs/TQM8560_defconfig
index 1d90207,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..1d90207
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/ppc/configs/TQM8560_defconfig
+++ b/arch/ppc/configs/TQM8560_defconfig
diff --cc arch/ppc/kernel/process.c
index 0000000,25cbdc8,25cbdc8,25cbdc8,25cbdc8,25cbdc8,25cbdc8,25cbdc8,25cbdc8,25cbdc8,25cbdc8,25cbdc8..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/kernel/process.c
+++ /dev/null
diff --cc arch/ppc/platforms/85xx/tqm85xx.c
index b436f4d,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..b436f4d
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/ppc/platforms/85xx/tqm85xx.c
+++ b/arch/ppc/platforms/85xx/tqm85xx.c
diff --cc arch/ppc/platforms/85xx/tqm85xx.h
index 3775eb3,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..3775eb3
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/ppc/platforms/85xx/tqm85xx.h
+++ b/arch/ppc/platforms/85xx/tqm85xx.h
diff --cc arch/ppc/platforms/mpc5200.c
index 0000000,0000000,a58db43,a58db43,a58db43,a58db43,a58db43,a58db43,0000000,a58db43,0000000,0000000..0000000
deleted file mode 000000,000000,100644,100644,100644,100644,100644,100644,000000,100644,000000,000000
--- a/arch/ppc/platforms/mpc5200.c
+++ /dev/null
diff --cc arch/ppc/platforms/pmac_backlight.c
index 0000000,8be2f7d,8be2f7d,8be2f7d,8be2f7d,8be2f7d,8be2f7d,8be2f7d,8be2f7d,8be2f7d,8be2f7d,8be2f7d..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_backlight.c
+++ /dev/null
diff --cc arch/ppc/platforms/pmac_cache.S
index 0000000,fb977de,fb977de,fb977de,fb977de,fb977de,fb977de,fb977de,fb977de,fb977de,fb977de,fb977de..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_cache.S
+++ /dev/null
diff --cc arch/ppc/platforms/pmac_cpufreq.c
index 0000000,fba7e4d,fba7e4d,fba7e4d,fba7e4d,fba7e4d,fba7e4d,fba7e4d,fba7e4d,fba7e4d,fba7e4d,fba7e4d..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_cpufreq.c
+++ /dev/null
diff --cc arch/ppc/platforms/pmac_feature.c
index 0000000,6b7b3a1,6b7b3a1,1e69b05,6b7b3a1,1e69b05,1e69b05,1e69b05,6b7b3a1,6b7b3a1,6b7b3a1,6b7b3a1..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_feature.c
+++ /dev/null
@@@@@@@@@@@@@ -1,0 -1,3023 -1,3023 -1,3013 -1,3023 -1,3013 -1,3013 -1,3013 -1,3023 -1,3023 -1,3023 -1,3023 +1,0 @@@@@@@@@@@@@
-----------/*
----------- * arch/ppc/platforms/pmac_feature.c
----------- *
----------- * Copyright (C) 1996-2001 Paul Mackerras (paulus@cs.anu.edu.au)
----------- * Ben. Herrenschmidt (benh@kernel.crashing.org)
----------- *
----------- * This program is free software; you can redistribute it and/or
----------- * modify it under the terms of the GNU General Public License
----------- * as published by the Free Software Foundation; either version
----------- * 2 of the License, or (at your option) any later version.
----------- *
----------- * TODO:
----------- *
----------- * - Replace mdelay with some schedule loop if possible
----------- * - Shorten some obfuscated delays on some routines (like modem
----------- * power)
----------- * - Refcount some clocks (see darwin)
----------- * - Split split split...
----------- *
----------- */
-----------#include <linux/config.h>
-----------#include <linux/types.h>
-----------#include <linux/init.h>
-----------#include <linux/delay.h>
-----------#include <linux/kernel.h>
-----------#include <linux/sched.h>
-----------#include <linux/spinlock.h>
-----------#include <linux/adb.h>
-----------#include <linux/pmu.h>
-----------#include <linux/ioport.h>
-----------#include <linux/pci.h>
-----------#include <asm/sections.h>
-----------#include <asm/errno.h>
-----------#include <asm/ohare.h>
-----------#include <asm/heathrow.h>
-----------#include <asm/keylargo.h>
-----------#include <asm/uninorth.h>
-----------#include <asm/io.h>
-----------#include <asm/prom.h>
-----------#include <asm/machdep.h>
-----------#include <asm/pmac_feature.h>
-----------#include <asm/dbdma.h>
-----------#include <asm/pci-bridge.h>
-----------#include <asm/pmac_low_i2c.h>
-----------
-----------#undef DEBUG_FEATURE
-----------
-----------#ifdef DEBUG_FEATURE
-----------#define DBG(fmt,...) printk(KERN_DEBUG fmt)
-----------#else
-----------#define DBG(fmt,...)
-----------#endif
-----------
-----------#ifdef CONFIG_6xx
-----------extern int powersave_lowspeed;
-----------#endif
-----------
-----------extern int powersave_nap;
-----------extern struct device_node *k2_skiplist[2];
-----------
-----------
-----------/*
----------- * We use a single global lock to protect accesses. Each driver has
----------- * to take care of its own locking
----------- */
-----------static DEFINE_SPINLOCK(feature_lock);
-----------
-----------#define LOCK(flags) spin_lock_irqsave(&feature_lock, flags);
-----------#define UNLOCK(flags) spin_unlock_irqrestore(&feature_lock, flags);
-----------
-----------
-----------/*
----------- * Instance of some macio stuffs
----------- */
-----------struct macio_chip macio_chips[MAX_MACIO_CHIPS];
-----------
-----------struct macio_chip* macio_find(struct device_node* child, int type)
-----------{
----------- while(child) {
----------- int i;
-----------
----------- for (i=0; i < MAX_MACIO_CHIPS && macio_chips[i].of_node; i++)
----------- if (child == macio_chips[i].of_node &&
----------- (!type || macio_chips[i].type == type))
----------- return &macio_chips[i];
----------- child = child->parent;
----------- }
----------- return NULL;
-----------}
-----------EXPORT_SYMBOL_GPL(macio_find);
-----------
-----------static const char* macio_names[] =
-----------{
----------- "Unknown",
----------- "Grand Central",
----------- "OHare",
----------- "OHareII",
----------- "Heathrow",
----------- "Gatwick",
----------- "Paddington",
----------- "Keylargo",
----------- "Pangea",
----------- "Intrepid",
----------- "K2"
-----------};
-----------
-----------
-----------
-----------/*
----------- * Uninorth reg. access. Note that Uni-N regs are big endian
----------- */
-----------
-----------#define UN_REG(r) (uninorth_base + ((r) >> 2))
-----------#define UN_IN(r) (in_be32(UN_REG(r)))
-----------#define UN_OUT(r,v) (out_be32(UN_REG(r), (v)))
-----------#define UN_BIS(r,v) (UN_OUT((r), UN_IN(r) | (v)))
-----------#define UN_BIC(r,v) (UN_OUT((r), UN_IN(r) & ~(v)))
-----------
-----------static struct device_node* uninorth_node;
-----------static u32 __iomem * uninorth_base;
-----------static u32 uninorth_rev;
-----------static int uninorth_u3;
-----------static void __iomem *u3_ht;
-----------
-----------/*
----------- * For each motherboard family, we have a table of functions pointers
----------- * that handle the various features.
----------- */
-----------
-----------typedef long (*feature_call)(struct device_node* node, long param, long value);
-----------
-----------struct feature_table_entry {
----------- unsigned int selector;
----------- feature_call function;
-----------};
-----------
-----------struct pmac_mb_def
-----------{
----------- const char* model_string;
----------- const char* model_name;
----------- int model_id;
----------- struct feature_table_entry* features;
----------- unsigned long board_flags;
-----------};
-----------static struct pmac_mb_def pmac_mb;
-----------
-----------/*
----------- * Here are the chip specific feature functions
----------- */
-----------
-----------static inline int
-----------simple_feature_tweak(struct device_node* node, int type, int reg, u32 mask, int value)
-----------{
----------- struct macio_chip* macio;
----------- unsigned long flags;
-----------
----------- macio = macio_find(node, type);
----------- if (!macio)
----------- return -ENODEV;
----------- LOCK(flags);
----------- if (value)
----------- MACIO_BIS(reg, mask);
----------- else
----------- MACIO_BIC(reg, mask);
----------- (void)MACIO_IN32(reg);
----------- UNLOCK(flags);
-----------
----------- return 0;
-----------}
-----------
-----------#ifndef CONFIG_POWER4
-----------
-----------static long
-----------ohare_htw_scc_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio;
----------- unsigned long chan_mask;
----------- unsigned long fcr;
----------- unsigned long flags;
----------- int htw, trans;
----------- unsigned long rmask;
-----------
----------- macio = macio_find(node, 0);
----------- if (!macio)
----------- return -ENODEV;
----------- if (!strcmp(node->name, "ch-a"))
----------- chan_mask = MACIO_FLAG_SCCA_ON;
----------- else if (!strcmp(node->name, "ch-b"))
----------- chan_mask = MACIO_FLAG_SCCB_ON;
----------- else
----------- return -ENODEV;
-----------
----------- htw = (macio->type == macio_heathrow || macio->type == macio_paddington
----------- || macio->type == macio_gatwick);
----------- /* On these machines, the HRW_SCC_TRANS_EN_N bit mustn't be touched */
----------- trans = (pmac_mb.model_id != PMAC_TYPE_YOSEMITE &&
----------- pmac_mb.model_id != PMAC_TYPE_YIKES);
----------- if (value) {
-----------#ifdef CONFIG_ADB_PMU
----------- if ((param & 0xfff) == PMAC_SCC_IRDA)
----------- pmu_enable_irled(1);
-----------#endif /* CONFIG_ADB_PMU */
----------- LOCK(flags);
----------- fcr = MACIO_IN32(OHARE_FCR);
----------- /* Check if scc cell need enabling */
----------- if (!(fcr & OH_SCC_ENABLE)) {
----------- fcr |= OH_SCC_ENABLE;
----------- if (htw) {
----------- /* Side effect: this will also power up the
----------- * modem, but it's too messy to figure out on which
----------- * ports this controls the tranceiver and on which
----------- * it controls the modem
----------- */
----------- if (trans)
----------- fcr &= ~HRW_SCC_TRANS_EN_N;
----------- MACIO_OUT32(OHARE_FCR, fcr);
----------- fcr |= (rmask = HRW_RESET_SCC);
----------- MACIO_OUT32(OHARE_FCR, fcr);
----------- } else {
----------- fcr |= (rmask = OH_SCC_RESET);
----------- MACIO_OUT32(OHARE_FCR, fcr);
----------- }
----------- UNLOCK(flags);
----------- (void)MACIO_IN32(OHARE_FCR);
----------- mdelay(15);
----------- LOCK(flags);
----------- fcr &= ~rmask;
----------- MACIO_OUT32(OHARE_FCR, fcr);
----------- }
----------- if (chan_mask & MACIO_FLAG_SCCA_ON)
----------- fcr |= OH_SCCA_IO;
----------- if (chan_mask & MACIO_FLAG_SCCB_ON)
----------- fcr |= OH_SCCB_IO;
----------- MACIO_OUT32(OHARE_FCR, fcr);
----------- macio->flags |= chan_mask;
----------- UNLOCK(flags);
----------- if (param & PMAC_SCC_FLAG_XMON)
----------- macio->flags |= MACIO_FLAG_SCC_LOCKED;
----------- } else {
----------- if (macio->flags & MACIO_FLAG_SCC_LOCKED)
----------- return -EPERM;
----------- LOCK(flags);
----------- fcr = MACIO_IN32(OHARE_FCR);
----------- if (chan_mask & MACIO_FLAG_SCCA_ON)
----------- fcr &= ~OH_SCCA_IO;
----------- if (chan_mask & MACIO_FLAG_SCCB_ON)
----------- fcr &= ~OH_SCCB_IO;
----------- MACIO_OUT32(OHARE_FCR, fcr);
----------- if ((fcr & (OH_SCCA_IO | OH_SCCB_IO)) == 0) {
----------- fcr &= ~OH_SCC_ENABLE;
----------- if (htw && trans)
----------- fcr |= HRW_SCC_TRANS_EN_N;
----------- MACIO_OUT32(OHARE_FCR, fcr);
----------- }
----------- macio->flags &= ~(chan_mask);
----------- UNLOCK(flags);
----------- mdelay(10);
-----------#ifdef CONFIG_ADB_PMU
----------- if ((param & 0xfff) == PMAC_SCC_IRDA)
----------- pmu_enable_irled(0);
-----------#endif /* CONFIG_ADB_PMU */
----------- }
----------- return 0;
-----------}
-----------
-----------static long
-----------ohare_floppy_enable(struct device_node* node, long param, long value)
-----------{
----------- return simple_feature_tweak(node, macio_ohare,
----------- OHARE_FCR, OH_FLOPPY_ENABLE, value);
-----------}
-----------
-----------static long
-----------ohare_mesh_enable(struct device_node* node, long param, long value)
-----------{
----------- return simple_feature_tweak(node, macio_ohare,
----------- OHARE_FCR, OH_MESH_ENABLE, value);
-----------}
-----------
-----------static long
-----------ohare_ide_enable(struct device_node* node, long param, long value)
-----------{
----------- switch(param) {
----------- case 0:
----------- /* For some reason, setting the bit in set_initial_features()
----------- * doesn't stick. I'm still investigating... --BenH.
----------- */
----------- if (value)
----------- simple_feature_tweak(node, macio_ohare,
----------- OHARE_FCR, OH_IOBUS_ENABLE, 1);
----------- return simple_feature_tweak(node, macio_ohare,
----------- OHARE_FCR, OH_IDE0_ENABLE, value);
----------- case 1:
----------- return simple_feature_tweak(node, macio_ohare,
----------- OHARE_FCR, OH_BAY_IDE_ENABLE, value);
----------- default:
----------- return -ENODEV;
----------- }
-----------}
-----------
-----------static long
-----------ohare_ide_reset(struct device_node* node, long param, long value)
-----------{
----------- switch(param) {
----------- case 0:
----------- return simple_feature_tweak(node, macio_ohare,
----------- OHARE_FCR, OH_IDE0_RESET_N, !value);
----------- case 1:
----------- return simple_feature_tweak(node, macio_ohare,
----------- OHARE_FCR, OH_IDE1_RESET_N, !value);
----------- default:
----------- return -ENODEV;
----------- }
-----------}
-----------
-----------static long
-----------ohare_sleep_state(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio = &macio_chips[0];
-----------
----------- if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0)
----------- return -EPERM;
----------- if (value == 1) {
----------- MACIO_BIC(OHARE_FCR, OH_IOBUS_ENABLE);
----------- } else if (value == 0) {
----------- MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE);
----------- }
-----------
----------- return 0;
-----------}
-----------
-----------static long
-----------heathrow_modem_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio;
----------- u8 gpio;
----------- unsigned long flags;
-----------
----------- macio = macio_find(node, macio_unknown);
----------- if (!macio)
----------- return -ENODEV;
----------- gpio = MACIO_IN8(HRW_GPIO_MODEM_RESET) & ~1;
----------- if (!value) {
----------- LOCK(flags);
----------- MACIO_OUT8(HRW_GPIO_MODEM_RESET, gpio);
----------- UNLOCK(flags);
----------- (void)MACIO_IN8(HRW_GPIO_MODEM_RESET);
----------- mdelay(250);
----------- }
----------- if (pmac_mb.model_id != PMAC_TYPE_YOSEMITE &&
----------- pmac_mb.model_id != PMAC_TYPE_YIKES) {
----------- LOCK(flags);
----------- if (value)
----------- MACIO_BIC(HEATHROW_FCR, HRW_SCC_TRANS_EN_N);
----------- else
----------- MACIO_BIS(HEATHROW_FCR, HRW_SCC_TRANS_EN_N);
----------- UNLOCK(flags);
----------- (void)MACIO_IN32(HEATHROW_FCR);
----------- mdelay(250);
----------- }
----------- if (value) {
----------- LOCK(flags);
----------- MACIO_OUT8(HRW_GPIO_MODEM_RESET, gpio | 1);
----------- (void)MACIO_IN8(HRW_GPIO_MODEM_RESET);
----------- UNLOCK(flags); mdelay(250); LOCK(flags);
----------- MACIO_OUT8(HRW_GPIO_MODEM_RESET, gpio);
----------- (void)MACIO_IN8(HRW_GPIO_MODEM_RESET);
----------- UNLOCK(flags); mdelay(250); LOCK(flags);
----------- MACIO_OUT8(HRW_GPIO_MODEM_RESET, gpio | 1);
----------- (void)MACIO_IN8(HRW_GPIO_MODEM_RESET);
----------- UNLOCK(flags); mdelay(250);
----------- }
----------- return 0;
-----------}
-----------
-----------static long
-----------heathrow_floppy_enable(struct device_node* node, long param, long value)
-----------{
----------- return simple_feature_tweak(node, macio_unknown,
----------- HEATHROW_FCR,
----------- HRW_SWIM_ENABLE|HRW_BAY_FLOPPY_ENABLE,
----------- value);
-----------}
-----------
-----------static long
-----------heathrow_mesh_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio;
----------- unsigned long flags;
-----------
----------- macio = macio_find(node, macio_unknown);
----------- if (!macio)
----------- return -ENODEV;
----------- LOCK(flags);
----------- /* Set clear mesh cell enable */
----------- if (value)
----------- MACIO_BIS(HEATHROW_FCR, HRW_MESH_ENABLE);
----------- else
----------- MACIO_BIC(HEATHROW_FCR, HRW_MESH_ENABLE);
----------- (void)MACIO_IN32(HEATHROW_FCR);
----------- udelay(10);
----------- /* Set/Clear termination power */
----------- if (value)
----------- MACIO_BIC(HEATHROW_MBCR, 0x04000000);
----------- else
----------- MACIO_BIS(HEATHROW_MBCR, 0x04000000);
----------- (void)MACIO_IN32(HEATHROW_MBCR);
----------- udelay(10);
----------- UNLOCK(flags);
-----------
----------- return 0;
-----------}
-----------
-----------static long
-----------heathrow_ide_enable(struct device_node* node, long param, long value)
-----------{
----------- switch(param) {
----------- case 0:
----------- return simple_feature_tweak(node, macio_unknown,
----------- HEATHROW_FCR, HRW_IDE0_ENABLE, value);
----------- case 1:
----------- return simple_feature_tweak(node, macio_unknown,
----------- HEATHROW_FCR, HRW_BAY_IDE_ENABLE, value);
----------- default:
----------- return -ENODEV;
----------- }
-----------}
-----------
-----------static long
-----------heathrow_ide_reset(struct device_node* node, long param, long value)
-----------{
----------- switch(param) {
----------- case 0:
----------- return simple_feature_tweak(node, macio_unknown,
----------- HEATHROW_FCR, HRW_IDE0_RESET_N, !value);
----------- case 1:
----------- return simple_feature_tweak(node, macio_unknown,
----------- HEATHROW_FCR, HRW_IDE1_RESET_N, !value);
----------- default:
----------- return -ENODEV;
----------- }
-----------}
-----------
-----------static long
-----------heathrow_bmac_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio;
----------- unsigned long flags;
-----------
----------- macio = macio_find(node, 0);
----------- if (!macio)
----------- return -ENODEV;
----------- if (value) {
----------- LOCK(flags);
----------- MACIO_BIS(HEATHROW_FCR, HRW_BMAC_IO_ENABLE);
----------- MACIO_BIS(HEATHROW_FCR, HRW_BMAC_RESET);
----------- UNLOCK(flags);
----------- (void)MACIO_IN32(HEATHROW_FCR);
----------- mdelay(10);
----------- LOCK(flags);
----------- MACIO_BIC(HEATHROW_FCR, HRW_BMAC_RESET);
----------- UNLOCK(flags);
----------- (void)MACIO_IN32(HEATHROW_FCR);
----------- mdelay(10);
----------- } else {
----------- LOCK(flags);
----------- MACIO_BIC(HEATHROW_FCR, HRW_BMAC_IO_ENABLE);
----------- UNLOCK(flags);
----------- }
----------- return 0;
-----------}
-----------
-----------static long
-----------heathrow_sound_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio;
----------- unsigned long flags;
-----------
----------- /* B&W G3 and Yikes don't support that properly (the
----------- * sound appear to never come back after beeing shut down).
----------- */
----------- if (pmac_mb.model_id == PMAC_TYPE_YOSEMITE ||
----------- pmac_mb.model_id == PMAC_TYPE_YIKES)
----------- return 0;
-----------
----------- macio = macio_find(node, 0);
----------- if (!macio)
----------- return -ENODEV;
----------- if (value) {
----------- LOCK(flags);
----------- MACIO_BIS(HEATHROW_FCR, HRW_SOUND_CLK_ENABLE);
----------- MACIO_BIC(HEATHROW_FCR, HRW_SOUND_POWER_N);
----------- UNLOCK(flags);
----------- (void)MACIO_IN32(HEATHROW_FCR);
----------- } else {
----------- LOCK(flags);
----------- MACIO_BIS(HEATHROW_FCR, HRW_SOUND_POWER_N);
----------- MACIO_BIC(HEATHROW_FCR, HRW_SOUND_CLK_ENABLE);
----------- UNLOCK(flags);
----------- }
----------- return 0;
-----------}
-----------
-----------static u32 save_fcr[6];
-----------static u32 save_mbcr;
-----------static u32 save_gpio_levels[2];
-----------static u8 save_gpio_extint[KEYLARGO_GPIO_EXTINT_CNT];
-----------static u8 save_gpio_normal[KEYLARGO_GPIO_CNT];
-----------static u32 save_unin_clock_ctl;
-----------static struct dbdma_regs save_dbdma[13];
-----------static struct dbdma_regs save_alt_dbdma[13];
-----------
-----------static void
-----------dbdma_save(struct macio_chip* macio, struct dbdma_regs* save)
-----------{
----------- int i;
-----------
----------- /* Save state & config of DBDMA channels */
----------- for (i=0; i<13; i++) {
----------- volatile struct dbdma_regs __iomem * chan = (void __iomem *)
----------- (macio->base + ((0x8000+i*0x100)>>2));
----------- save[i].cmdptr_hi = in_le32(&chan->cmdptr_hi);
----------- save[i].cmdptr = in_le32(&chan->cmdptr);
----------- save[i].intr_sel = in_le32(&chan->intr_sel);
----------- save[i].br_sel = in_le32(&chan->br_sel);
----------- save[i].wait_sel = in_le32(&chan->wait_sel);
----------- }
-----------}
-----------
-----------static void
-----------dbdma_restore(struct macio_chip* macio, struct dbdma_regs* save)
-----------{
----------- int i;
-----------
----------- /* Save state & config of DBDMA channels */
----------- for (i=0; i<13; i++) {
----------- volatile struct dbdma_regs __iomem * chan = (void __iomem *)
----------- (macio->base + ((0x8000+i*0x100)>>2));
----------- out_le32(&chan->control, (ACTIVE|DEAD|WAKE|FLUSH|PAUSE|RUN)<<16);
----------- while (in_le32(&chan->status) & ACTIVE)
----------- mb();
----------- out_le32(&chan->cmdptr_hi, save[i].cmdptr_hi);
----------- out_le32(&chan->cmdptr, save[i].cmdptr);
----------- out_le32(&chan->intr_sel, save[i].intr_sel);
----------- out_le32(&chan->br_sel, save[i].br_sel);
----------- out_le32(&chan->wait_sel, save[i].wait_sel);
----------- }
-----------}
-----------
-----------static void
-----------heathrow_sleep(struct macio_chip* macio, int secondary)
-----------{
----------- if (secondary) {
----------- dbdma_save(macio, save_alt_dbdma);
----------- save_fcr[2] = MACIO_IN32(0x38);
----------- save_fcr[3] = MACIO_IN32(0x3c);
----------- } else {
----------- dbdma_save(macio, save_dbdma);
----------- save_fcr[0] = MACIO_IN32(0x38);
----------- save_fcr[1] = MACIO_IN32(0x3c);
----------- save_mbcr = MACIO_IN32(0x34);
----------- /* Make sure sound is shut down */
----------- MACIO_BIS(HEATHROW_FCR, HRW_SOUND_POWER_N);
----------- MACIO_BIC(HEATHROW_FCR, HRW_SOUND_CLK_ENABLE);
----------- /* This seems to be necessary as well or the fan
----------- * keeps coming up and battery drains fast */
----------- MACIO_BIC(HEATHROW_FCR, HRW_IOBUS_ENABLE);
----------- MACIO_BIC(HEATHROW_FCR, HRW_IDE0_RESET_N);
----------- /* Make sure eth is down even if module or sleep
----------- * won't work properly */
----------- MACIO_BIC(HEATHROW_FCR, HRW_BMAC_IO_ENABLE | HRW_BMAC_RESET);
----------- }
----------- /* Make sure modem is shut down */
----------- MACIO_OUT8(HRW_GPIO_MODEM_RESET,
----------- MACIO_IN8(HRW_GPIO_MODEM_RESET) & ~1);
----------- MACIO_BIS(HEATHROW_FCR, HRW_SCC_TRANS_EN_N);
----------- MACIO_BIC(HEATHROW_FCR, OH_SCCA_IO|OH_SCCB_IO|HRW_SCC_ENABLE);
-----------
----------- /* Let things settle */
----------- (void)MACIO_IN32(HEATHROW_FCR);
-----------}
-----------
-----------static void
-----------heathrow_wakeup(struct macio_chip* macio, int secondary)
-----------{
----------- if (secondary) {
----------- MACIO_OUT32(0x38, save_fcr[2]);
----------- (void)MACIO_IN32(0x38);
----------- mdelay(1);
----------- MACIO_OUT32(0x3c, save_fcr[3]);
----------- (void)MACIO_IN32(0x38);
----------- mdelay(10);
----------- dbdma_restore(macio, save_alt_dbdma);
----------- } else {
----------- MACIO_OUT32(0x38, save_fcr[0] | HRW_IOBUS_ENABLE);
----------- (void)MACIO_IN32(0x38);
----------- mdelay(1);
----------- MACIO_OUT32(0x3c, save_fcr[1]);
----------- (void)MACIO_IN32(0x38);
----------- mdelay(1);
----------- MACIO_OUT32(0x34, save_mbcr);
----------- (void)MACIO_IN32(0x38);
----------- mdelay(10);
----------- dbdma_restore(macio, save_dbdma);
----------- }
-----------}
-----------
-----------static long
-----------heathrow_sleep_state(struct device_node* node, long param, long value)
-----------{
----------- if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0)
----------- return -EPERM;
----------- if (value == 1) {
----------- if (macio_chips[1].type == macio_gatwick)
----------- heathrow_sleep(&macio_chips[0], 1);
----------- heathrow_sleep(&macio_chips[0], 0);
----------- } else if (value == 0) {
----------- heathrow_wakeup(&macio_chips[0], 0);
----------- if (macio_chips[1].type == macio_gatwick)
----------- heathrow_wakeup(&macio_chips[0], 1);
----------- }
----------- return 0;
-----------}
-----------
-----------static long
-----------core99_scc_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio;
----------- unsigned long flags;
----------- unsigned long chan_mask;
----------- u32 fcr;
-----------
----------- macio = macio_find(node, 0);
----------- if (!macio)
----------- return -ENODEV;
----------- if (!strcmp(node->name, "ch-a"))
----------- chan_mask = MACIO_FLAG_SCCA_ON;
----------- else if (!strcmp(node->name, "ch-b"))
----------- chan_mask = MACIO_FLAG_SCCB_ON;
----------- else
----------- return -ENODEV;
-----------
----------- if (value) {
----------- int need_reset_scc = 0;
----------- int need_reset_irda = 0;
-----------
----------- LOCK(flags);
----------- fcr = MACIO_IN32(KEYLARGO_FCR0);
----------- /* Check if scc cell need enabling */
----------- if (!(fcr & KL0_SCC_CELL_ENABLE)) {
----------- fcr |= KL0_SCC_CELL_ENABLE;
----------- need_reset_scc = 1;
----------- }
----------- if (chan_mask & MACIO_FLAG_SCCA_ON) {
----------- fcr |= KL0_SCCA_ENABLE;
----------- /* Don't enable line drivers for I2S modem */
----------- if ((param & 0xfff) == PMAC_SCC_I2S1)
----------- fcr &= ~KL0_SCC_A_INTF_ENABLE;
----------- else
----------- fcr |= KL0_SCC_A_INTF_ENABLE;
----------- }
----------- if (chan_mask & MACIO_FLAG_SCCB_ON) {
----------- fcr |= KL0_SCCB_ENABLE;
----------- /* Perform irda specific inits */
----------- if ((param & 0xfff) == PMAC_SCC_IRDA) {
----------- fcr &= ~KL0_SCC_B_INTF_ENABLE;
----------- fcr |= KL0_IRDA_ENABLE;
----------- fcr |= KL0_IRDA_CLK32_ENABLE | KL0_IRDA_CLK19_ENABLE;
----------- fcr |= KL0_IRDA_SOURCE1_SEL;
----------- fcr &= ~(KL0_IRDA_FAST_CONNECT|KL0_IRDA_DEFAULT1|KL0_IRDA_DEFAULT0);
----------- fcr &= ~(KL0_IRDA_SOURCE2_SEL|KL0_IRDA_HIGH_BAND);
----------- need_reset_irda = 1;
----------- } else
----------- fcr |= KL0_SCC_B_INTF_ENABLE;
----------- }
----------- MACIO_OUT32(KEYLARGO_FCR0, fcr);
----------- macio->flags |= chan_mask;
----------- if (need_reset_scc) {
----------- MACIO_BIS(KEYLARGO_FCR0, KL0_SCC_RESET);
----------- (void)MACIO_IN32(KEYLARGO_FCR0);
----------- UNLOCK(flags);
----------- mdelay(15);
----------- LOCK(flags);
----------- MACIO_BIC(KEYLARGO_FCR0, KL0_SCC_RESET);
----------- }
----------- if (need_reset_irda) {
----------- MACIO_BIS(KEYLARGO_FCR0, KL0_IRDA_RESET);
----------- (void)MACIO_IN32(KEYLARGO_FCR0);
----------- UNLOCK(flags);
----------- mdelay(15);
----------- LOCK(flags);
----------- MACIO_BIC(KEYLARGO_FCR0, KL0_IRDA_RESET);
----------- }
----------- UNLOCK(flags);
----------- if (param & PMAC_SCC_FLAG_XMON)
----------- macio->flags |= MACIO_FLAG_SCC_LOCKED;
----------- } else {
----------- if (macio->flags & MACIO_FLAG_SCC_LOCKED)
----------- return -EPERM;
----------- LOCK(flags);
----------- fcr = MACIO_IN32(KEYLARGO_FCR0);
----------- if (chan_mask & MACIO_FLAG_SCCA_ON)
----------- fcr &= ~KL0_SCCA_ENABLE;
----------- if (chan_mask & MACIO_FLAG_SCCB_ON) {
----------- fcr &= ~KL0_SCCB_ENABLE;
----------- /* Perform irda specific clears */
----------- if ((param & 0xfff) == PMAC_SCC_IRDA) {
----------- fcr &= ~KL0_IRDA_ENABLE;
----------- fcr &= ~(KL0_IRDA_CLK32_ENABLE | KL0_IRDA_CLK19_ENABLE);
----------- fcr &= ~(KL0_IRDA_FAST_CONNECT|KL0_IRDA_DEFAULT1|KL0_IRDA_DEFAULT0);
----------- fcr &= ~(KL0_IRDA_SOURCE1_SEL|KL0_IRDA_SOURCE2_SEL|KL0_IRDA_HIGH_BAND);
----------- }
----------- }
----------- MACIO_OUT32(KEYLARGO_FCR0, fcr);
----------- if ((fcr & (KL0_SCCA_ENABLE | KL0_SCCB_ENABLE)) == 0) {
----------- fcr &= ~KL0_SCC_CELL_ENABLE;
----------- MACIO_OUT32(KEYLARGO_FCR0, fcr);
----------- }
----------- macio->flags &= ~(chan_mask);
----------- UNLOCK(flags);
----------- mdelay(10);
----------- }
----------- return 0;
-----------}
-----------
-----------static long
-----------core99_modem_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio;
----------- u8 gpio;
----------- unsigned long flags;
-----------
----------- /* Hack for internal USB modem */
----------- if (node == NULL) {
----------- if (macio_chips[0].type != macio_keylargo)
----------- return -ENODEV;
----------- node = macio_chips[0].of_node;
----------- }
----------- macio = macio_find(node, 0);
----------- if (!macio)
----------- return -ENODEV;
----------- gpio = MACIO_IN8(KL_GPIO_MODEM_RESET);
----------- gpio |= KEYLARGO_GPIO_OUTPUT_ENABLE;
----------- gpio &= ~KEYLARGO_GPIO_OUTOUT_DATA;
-----------
----------- if (!value) {
----------- LOCK(flags);
----------- MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio);
----------- UNLOCK(flags);
----------- (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
----------- mdelay(250);
----------- }
----------- LOCK(flags);
----------- if (value) {
----------- MACIO_BIC(KEYLARGO_FCR2, KL2_ALT_DATA_OUT);
----------- UNLOCK(flags);
----------- (void)MACIO_IN32(KEYLARGO_FCR2);
----------- mdelay(250);
----------- } else {
----------- MACIO_BIS(KEYLARGO_FCR2, KL2_ALT_DATA_OUT);
----------- UNLOCK(flags);
----------- }
----------- if (value) {
----------- LOCK(flags);
----------- MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio | KEYLARGO_GPIO_OUTOUT_DATA);
----------- (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
----------- UNLOCK(flags); mdelay(250); LOCK(flags);
----------- MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio);
----------- (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
----------- UNLOCK(flags); mdelay(250); LOCK(flags);
----------- MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio | KEYLARGO_GPIO_OUTOUT_DATA);
----------- (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
----------- UNLOCK(flags); mdelay(250);
----------- }
----------- return 0;
-----------}
-----------
-----------static long
-----------pangea_modem_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio;
----------- u8 gpio;
----------- unsigned long flags;
-----------
----------- /* Hack for internal USB modem */
----------- if (node == NULL) {
----------- if (macio_chips[0].type != macio_pangea &&
----------- macio_chips[0].type != macio_intrepid)
----------- return -ENODEV;
----------- node = macio_chips[0].of_node;
----------- }
----------- macio = macio_find(node, 0);
----------- if (!macio)
----------- return -ENODEV;
----------- gpio = MACIO_IN8(KL_GPIO_MODEM_RESET);
----------- gpio |= KEYLARGO_GPIO_OUTPUT_ENABLE;
----------- gpio &= ~KEYLARGO_GPIO_OUTOUT_DATA;
-----------
----------- if (!value) {
----------- LOCK(flags);
----------- MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio);
----------- UNLOCK(flags);
----------- (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
----------- mdelay(250);
----------- }
----------- LOCK(flags);
----------- if (value) {
----------- MACIO_OUT8(KL_GPIO_MODEM_POWER,
----------- KEYLARGO_GPIO_OUTPUT_ENABLE);
----------- UNLOCK(flags);
----------- (void)MACIO_IN32(KEYLARGO_FCR2);
----------- mdelay(250);
----------- } else {
----------- MACIO_OUT8(KL_GPIO_MODEM_POWER,
----------- KEYLARGO_GPIO_OUTPUT_ENABLE | KEYLARGO_GPIO_OUTOUT_DATA);
----------- UNLOCK(flags);
----------- }
----------- if (value) {
----------- LOCK(flags);
----------- MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio | KEYLARGO_GPIO_OUTOUT_DATA);
----------- (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
----------- UNLOCK(flags); mdelay(250); LOCK(flags);
----------- MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio);
----------- (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
----------- UNLOCK(flags); mdelay(250); LOCK(flags);
----------- MACIO_OUT8(KL_GPIO_MODEM_RESET, gpio | KEYLARGO_GPIO_OUTOUT_DATA);
----------- (void)MACIO_IN8(KL_GPIO_MODEM_RESET);
----------- UNLOCK(flags); mdelay(250);
----------- }
----------- return 0;
-----------}
-----------
-----------static long
-----------core99_ata100_enable(struct device_node* node, long value)
-----------{
----------- unsigned long flags;
----------- struct pci_dev *pdev = NULL;
----------- u8 pbus, pid;
-----------
----------- if (uninorth_rev < 0x24)
----------- return -ENODEV;
-----------
----------- LOCK(flags);
----------- if (value)
----------- UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_ATA100);
----------- else
----------- UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_ATA100);
----------- (void)UN_IN(UNI_N_CLOCK_CNTL);
----------- UNLOCK(flags);
----------- udelay(20);
-----------
----------- if (value) {
----------- if (pci_device_from_OF_node(node, &pbus, &pid) == 0)
----------- pdev = pci_find_slot(pbus, pid);
----------- if (pdev == NULL)
----------- return 0;
----------- pci_enable_device(pdev);
----------- pci_set_master(pdev);
----------- }
----------- return 0;
-----------}
-----------
-----------static long
-----------core99_ide_enable(struct device_node* node, long param, long value)
-----------{
----------- /* Bus ID 0 to 2 are KeyLargo based IDE, busID 3 is U2
----------- * based ata-100
----------- */
----------- switch(param) {
----------- case 0:
----------- return simple_feature_tweak(node, macio_unknown,
----------- KEYLARGO_FCR1, KL1_EIDE0_ENABLE, value);
----------- case 1:
----------- return simple_feature_tweak(node, macio_unknown,
----------- KEYLARGO_FCR1, KL1_EIDE1_ENABLE, value);
----------- case 2:
----------- return simple_feature_tweak(node, macio_unknown,
----------- KEYLARGO_FCR1, KL1_UIDE_ENABLE, value);
----------- case 3:
----------- return core99_ata100_enable(node, value);
----------- default:
----------- return -ENODEV;
----------- }
-----------}
-----------
-----------static long
-----------core99_ide_reset(struct device_node* node, long param, long value)
-----------{
----------- switch(param) {
----------- case 0:
----------- return simple_feature_tweak(node, macio_unknown,
----------- KEYLARGO_FCR1, KL1_EIDE0_RESET_N, !value);
----------- case 1:
----------- return simple_feature_tweak(node, macio_unknown,
----------- KEYLARGO_FCR1, KL1_EIDE1_RESET_N, !value);
----------- case 2:
----------- return simple_feature_tweak(node, macio_unknown,
----------- KEYLARGO_FCR1, KL1_UIDE_RESET_N, !value);
----------- default:
----------- return -ENODEV;
----------- }
-----------}
-----------
-----------static long
-----------core99_gmac_enable(struct device_node* node, long param, long value)
-----------{
----------- unsigned long flags;
-----------
----------- LOCK(flags);
----------- if (value)
----------- UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_GMAC);
----------- else
----------- UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_GMAC);
----------- (void)UN_IN(UNI_N_CLOCK_CNTL);
----------- UNLOCK(flags);
----------- udelay(20);
-----------
----------- return 0;
-----------}
-----------
-----------static long
-----------core99_gmac_phy_reset(struct device_node* node, long param, long value)
-----------{
----------- unsigned long flags;
----------- struct macio_chip* macio;
-----------
----------- macio = &macio_chips[0];
----------- if (macio->type != macio_keylargo && macio->type != macio_pangea &&
----------- macio->type != macio_intrepid)
----------- return -ENODEV;
-----------
----------- LOCK(flags);
----------- MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, KEYLARGO_GPIO_OUTPUT_ENABLE);
----------- (void)MACIO_IN8(KL_GPIO_ETH_PHY_RESET);
----------- UNLOCK(flags);
----------- mdelay(10);
----------- LOCK(flags);
----------- MACIO_OUT8(KL_GPIO_ETH_PHY_RESET, /*KEYLARGO_GPIO_OUTPUT_ENABLE | */
----------- KEYLARGO_GPIO_OUTOUT_DATA);
----------- UNLOCK(flags);
----------- mdelay(10);
-----------
----------- return 0;
-----------}
-----------
-----------static long
-----------core99_sound_chip_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio;
----------- unsigned long flags;
-----------
----------- macio = macio_find(node, 0);
----------- if (!macio)
----------- return -ENODEV;
-----------
----------- /* Do a better probe code, screamer G4 desktops &
----------- * iMacs can do that too, add a recalibrate in
----------- * the driver as well
----------- */
----------- if (pmac_mb.model_id == PMAC_TYPE_PISMO ||
----------- pmac_mb.model_id == PMAC_TYPE_TITANIUM) {
----------- LOCK(flags);
----------- if (value)
----------- MACIO_OUT8(KL_GPIO_SOUND_POWER,
----------- KEYLARGO_GPIO_OUTPUT_ENABLE |
----------- KEYLARGO_GPIO_OUTOUT_DATA);
----------- else
----------- MACIO_OUT8(KL_GPIO_SOUND_POWER,
----------- KEYLARGO_GPIO_OUTPUT_ENABLE);
----------- (void)MACIO_IN8(KL_GPIO_SOUND_POWER);
----------- UNLOCK(flags);
----------- }
----------- return 0;
-----------}
-----------
-----------static long
-----------core99_airport_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio;
----------- unsigned long flags;
----------- int state;
-----------
----------- macio = macio_find(node, 0);
----------- if (!macio)
----------- return -ENODEV;
-----------
----------- /* Hint: we allow passing of macio itself for the sake of the
----------- * sleep code
----------- */
----------- if (node != macio->of_node &&
----------- (!node->parent || node->parent != macio->of_node))
----------- return -ENODEV;
----------- state = (macio->flags & MACIO_FLAG_AIRPORT_ON) != 0;
----------- if (value == state)
----------- return 0;
----------- if (value) {
----------- /* This code is a reproduction of OF enable-cardslot
----------- * and init-wireless methods, slightly hacked until
----------- * I got it working.
----------- */
----------- LOCK(flags);
----------- MACIO_OUT8(KEYLARGO_GPIO_0+0xf, 5);
----------- (void)MACIO_IN8(KEYLARGO_GPIO_0+0xf);
----------- UNLOCK(flags);
----------- mdelay(10);
----------- LOCK(flags);
----------- MACIO_OUT8(KEYLARGO_GPIO_0+0xf, 4);
----------- (void)MACIO_IN8(KEYLARGO_GPIO_0+0xf);
----------- UNLOCK(flags);
-----------
----------- mdelay(10);
-----------
----------- LOCK(flags);
----------- MACIO_BIC(KEYLARGO_FCR2, KL2_CARDSEL_16);
----------- (void)MACIO_IN32(KEYLARGO_FCR2);
----------- udelay(10);
----------- MACIO_OUT8(KEYLARGO_GPIO_EXTINT_0+0xb, 0);
----------- (void)MACIO_IN8(KEYLARGO_GPIO_EXTINT_0+0xb);
----------- udelay(10);
----------- MACIO_OUT8(KEYLARGO_GPIO_EXTINT_0+0xa, 0x28);
----------- (void)MACIO_IN8(KEYLARGO_GPIO_EXTINT_0+0xa);
----------- udelay(10);
----------- MACIO_OUT8(KEYLARGO_GPIO_EXTINT_0+0xd, 0x28);
----------- (void)MACIO_IN8(KEYLARGO_GPIO_EXTINT_0+0xd);
----------- udelay(10);
----------- MACIO_OUT8(KEYLARGO_GPIO_0+0xd, 0x28);
----------- (void)MACIO_IN8(KEYLARGO_GPIO_0+0xd);
----------- udelay(10);
----------- MACIO_OUT8(KEYLARGO_GPIO_0+0xe, 0x28);
----------- (void)MACIO_IN8(KEYLARGO_GPIO_0+0xe);
----------- UNLOCK(flags);
----------- udelay(10);
----------- MACIO_OUT32(0x1c000, 0);
----------- mdelay(1);
----------- MACIO_OUT8(0x1a3e0, 0x41);
----------- (void)MACIO_IN8(0x1a3e0);
----------- udelay(10);
----------- LOCK(flags);
----------- MACIO_BIS(KEYLARGO_FCR2, KL2_CARDSEL_16);
----------- (void)MACIO_IN32(KEYLARGO_FCR2);
----------- UNLOCK(flags);
----------- mdelay(100);
-----------
----------- macio->flags |= MACIO_FLAG_AIRPORT_ON;
----------- } else {
----------- LOCK(flags);
----------- MACIO_BIC(KEYLARGO_FCR2, KL2_CARDSEL_16);
----------- (void)MACIO_IN32(KEYLARGO_FCR2);
----------- MACIO_OUT8(KL_GPIO_AIRPORT_0, 0);
----------- MACIO_OUT8(KL_GPIO_AIRPORT_1, 0);
----------- MACIO_OUT8(KL_GPIO_AIRPORT_2, 0);
----------- MACIO_OUT8(KL_GPIO_AIRPORT_3, 0);
----------- MACIO_OUT8(KL_GPIO_AIRPORT_4, 0);
----------- (void)MACIO_IN8(KL_GPIO_AIRPORT_4);
----------- UNLOCK(flags);
-----------
----------- macio->flags &= ~MACIO_FLAG_AIRPORT_ON;
----------- }
----------- return 0;
-----------}
-----------
-----------#ifdef CONFIG_SMP
-----------static long
-----------core99_reset_cpu(struct device_node* node, long param, long value)
-----------{
----------- unsigned int reset_io = 0;
----------- unsigned long flags;
----------- struct macio_chip* macio;
----------- struct device_node* np;
----------- const int dflt_reset_lines[] = { KL_GPIO_RESET_CPU0,
----------- KL_GPIO_RESET_CPU1,
----------- KL_GPIO_RESET_CPU2,
----------- KL_GPIO_RESET_CPU3 };
-----------
----------- macio = &macio_chips[0];
----------- if (macio->type != macio_keylargo)
----------- return -ENODEV;
-----------
----------- np = find_path_device("/cpus");
----------- if (np == NULL)
----------- return -ENODEV;
----------- for (np = np->child; np != NULL; np = np->sibling) {
----------- u32* num = (u32 *)get_property(np, "reg", NULL);
----------- u32* rst = (u32 *)get_property(np, "soft-reset", NULL);
----------- if (num == NULL || rst == NULL)
----------- continue;
----------- if (param == *num) {
----------- reset_io = *rst;
----------- break;
----------- }
----------- }
----------- if (np == NULL || reset_io == 0)
----------- reset_io = dflt_reset_lines[param];
-----------
----------- LOCK(flags);
----------- MACIO_OUT8(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE);
----------- (void)MACIO_IN8(reset_io);
----------- udelay(1);
----------- MACIO_OUT8(reset_io, 0);
----------- (void)MACIO_IN8(reset_io);
----------- UNLOCK(flags);
-----------
----------- return 0;
-----------}
-----------#endif /* CONFIG_SMP */
-----------
-----------static long
-----------core99_usb_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio;
----------- unsigned long flags;
----------- char* prop;
----------- int number;
----------- u32 reg;
-----------
----------- macio = &macio_chips[0];
----------- if (macio->type != macio_keylargo && macio->type != macio_pangea &&
----------- macio->type != macio_intrepid)
----------- return -ENODEV;
-----------
----------- prop = (char *)get_property(node, "AAPL,clock-id", NULL);
----------- if (!prop)
----------- return -ENODEV;
----------- if (strncmp(prop, "usb0u048", 8) == 0)
----------- number = 0;
----------- else if (strncmp(prop, "usb1u148", 8) == 0)
----------- number = 2;
----------- else if (strncmp(prop, "usb2u248", 8) == 0)
----------- number = 4;
----------- else
----------- return -ENODEV;
-----------
----------- /* Sorry for the brute-force locking, but this is only used during
----------- * sleep and the timing seem to be critical
----------- */
----------- LOCK(flags);
----------- if (value) {
----------- /* Turn ON */
----------- if (number == 0) {
----------- MACIO_BIC(KEYLARGO_FCR0, (KL0_USB0_PAD_SUSPEND0 | KL0_USB0_PAD_SUSPEND1));
----------- (void)MACIO_IN32(KEYLARGO_FCR0);
----------- UNLOCK(flags);
----------- mdelay(1);
----------- LOCK(flags);
----------- MACIO_BIS(KEYLARGO_FCR0, KL0_USB0_CELL_ENABLE);
----------- } else if (number == 2) {
----------- MACIO_BIC(KEYLARGO_FCR0, (KL0_USB1_PAD_SUSPEND0 | KL0_USB1_PAD_SUSPEND1));
----------- UNLOCK(flags);
----------- (void)MACIO_IN32(KEYLARGO_FCR0);
----------- mdelay(1);
----------- LOCK(flags);
----------- MACIO_BIS(KEYLARGO_FCR0, KL0_USB1_CELL_ENABLE);
----------- } else if (number == 4) {
----------- MACIO_BIC(KEYLARGO_FCR1, (KL1_USB2_PAD_SUSPEND0 | KL1_USB2_PAD_SUSPEND1));
----------- UNLOCK(flags);
----------- (void)MACIO_IN32(KEYLARGO_FCR1);
----------- mdelay(1);
----------- LOCK(flags);
----------- MACIO_BIS(KEYLARGO_FCR1, KL1_USB2_CELL_ENABLE);
----------- }
----------- if (number < 4) {
----------- reg = MACIO_IN32(KEYLARGO_FCR4);
----------- reg &= ~(KL4_PORT_WAKEUP_ENABLE(number) | KL4_PORT_RESUME_WAKE_EN(number) |
----------- KL4_PORT_CONNECT_WAKE_EN(number) | KL4_PORT_DISCONNECT_WAKE_EN(number));
----------- reg &= ~(KL4_PORT_WAKEUP_ENABLE(number+1) | KL4_PORT_RESUME_WAKE_EN(number+1) |
----------- KL4_PORT_CONNECT_WAKE_EN(number+1) | KL4_PORT_DISCONNECT_WAKE_EN(number+1));
----------- MACIO_OUT32(KEYLARGO_FCR4, reg);
----------- (void)MACIO_IN32(KEYLARGO_FCR4);
----------- udelay(10);
----------- } else {
----------- reg = MACIO_IN32(KEYLARGO_FCR3);
----------- reg &= ~(KL3_IT_PORT_WAKEUP_ENABLE(0) | KL3_IT_PORT_RESUME_WAKE_EN(0) |
----------- KL3_IT_PORT_CONNECT_WAKE_EN(0) | KL3_IT_PORT_DISCONNECT_WAKE_EN(0));
----------- reg &= ~(KL3_IT_PORT_WAKEUP_ENABLE(1) | KL3_IT_PORT_RESUME_WAKE_EN(1) |
----------- KL3_IT_PORT_CONNECT_WAKE_EN(1) | KL3_IT_PORT_DISCONNECT_WAKE_EN(1));
----------- MACIO_OUT32(KEYLARGO_FCR3, reg);
----------- (void)MACIO_IN32(KEYLARGO_FCR3);
----------- udelay(10);
----------- }
----------- if (macio->type == macio_intrepid) {
----------- /* wait for clock stopped bits to clear */
----------- u32 test0 = 0, test1 = 0;
----------- u32 status0, status1;
----------- int timeout = 1000;
-----------
----------- UNLOCK(flags);
----------- switch (number) {
----------- case 0:
----------- test0 = UNI_N_CLOCK_STOPPED_USB0;
----------- test1 = UNI_N_CLOCK_STOPPED_USB0PCI;
----------- break;
----------- case 2:
----------- test0 = UNI_N_CLOCK_STOPPED_USB1;
----------- test1 = UNI_N_CLOCK_STOPPED_USB1PCI;
----------- break;
----------- case 4:
----------- test0 = UNI_N_CLOCK_STOPPED_USB2;
----------- test1 = UNI_N_CLOCK_STOPPED_USB2PCI;
----------- break;
----------- }
----------- do {
----------- if (--timeout <= 0) {
----------- printk(KERN_ERR "core99_usb_enable: "
----------- "Timeout waiting for clocks\n");
----------- break;
----------- }
----------- mdelay(1);
----------- status0 = UN_IN(UNI_N_CLOCK_STOP_STATUS0);
----------- status1 = UN_IN(UNI_N_CLOCK_STOP_STATUS1);
----------- } while ((status0 & test0) | (status1 & test1));
----------- LOCK(flags);
----------- }
----------- } else {
----------- /* Turn OFF */
----------- if (number < 4) {
----------- reg = MACIO_IN32(KEYLARGO_FCR4);
----------- reg |= KL4_PORT_WAKEUP_ENABLE(number) | KL4_PORT_RESUME_WAKE_EN(number) |
----------- KL4_PORT_CONNECT_WAKE_EN(number) | KL4_PORT_DISCONNECT_WAKE_EN(number);
----------- reg |= KL4_PORT_WAKEUP_ENABLE(number+1) | KL4_PORT_RESUME_WAKE_EN(number+1) |
----------- KL4_PORT_CONNECT_WAKE_EN(number+1) | KL4_PORT_DISCONNECT_WAKE_EN(number+1);
----------- MACIO_OUT32(KEYLARGO_FCR4, reg);
----------- (void)MACIO_IN32(KEYLARGO_FCR4);
----------- udelay(1);
----------- } else {
----------- reg = MACIO_IN32(KEYLARGO_FCR3);
----------- reg |= KL3_IT_PORT_WAKEUP_ENABLE(0) | KL3_IT_PORT_RESUME_WAKE_EN(0) |
----------- KL3_IT_PORT_CONNECT_WAKE_EN(0) | KL3_IT_PORT_DISCONNECT_WAKE_EN(0);
----------- reg |= KL3_IT_PORT_WAKEUP_ENABLE(1) | KL3_IT_PORT_RESUME_WAKE_EN(1) |
----------- KL3_IT_PORT_CONNECT_WAKE_EN(1) | KL3_IT_PORT_DISCONNECT_WAKE_EN(1);
----------- MACIO_OUT32(KEYLARGO_FCR3, reg);
----------- (void)MACIO_IN32(KEYLARGO_FCR3);
----------- udelay(1);
----------- }
----------- if (number == 0) {
----------- if (macio->type != macio_intrepid)
----------- MACIO_BIC(KEYLARGO_FCR0, KL0_USB0_CELL_ENABLE);
----------- (void)MACIO_IN32(KEYLARGO_FCR0);
----------- udelay(1);
----------- MACIO_BIS(KEYLARGO_FCR0, (KL0_USB0_PAD_SUSPEND0 | KL0_USB0_PAD_SUSPEND1));
----------- (void)MACIO_IN32(KEYLARGO_FCR0);
----------- } else if (number == 2) {
----------- if (macio->type != macio_intrepid)
----------- MACIO_BIC(KEYLARGO_FCR0, KL0_USB1_CELL_ENABLE);
----------- (void)MACIO_IN32(KEYLARGO_FCR0);
----------- udelay(1);
----------- MACIO_BIS(KEYLARGO_FCR0, (KL0_USB1_PAD_SUSPEND0 | KL0_USB1_PAD_SUSPEND1));
----------- (void)MACIO_IN32(KEYLARGO_FCR0);
----------- } else if (number == 4) {
----------- udelay(1);
----------- MACIO_BIS(KEYLARGO_FCR1, (KL1_USB2_PAD_SUSPEND0 | KL1_USB2_PAD_SUSPEND1));
----------- (void)MACIO_IN32(KEYLARGO_FCR1);
----------- }
----------- udelay(1);
----------- }
----------- UNLOCK(flags);
-----------
----------- return 0;
-----------}
-----------
-----------static long
-----------core99_firewire_enable(struct device_node* node, long param, long value)
-----------{
----------- unsigned long flags;
----------- struct macio_chip* macio;
-----------
----------- macio = &macio_chips[0];
----------- if (macio->type != macio_keylargo && macio->type != macio_pangea &&
----------- macio->type != macio_intrepid)
----------- return -ENODEV;
----------- if (!(macio->flags & MACIO_FLAG_FW_SUPPORTED))
----------- return -ENODEV;
-----------
----------- LOCK(flags);
----------- if (value) {
----------- UN_BIS(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_FW);
----------- (void)UN_IN(UNI_N_CLOCK_CNTL);
----------- } else {
----------- UN_BIC(UNI_N_CLOCK_CNTL, UNI_N_CLOCK_CNTL_FW);
----------- (void)UN_IN(UNI_N_CLOCK_CNTL);
----------- }
----------- UNLOCK(flags);
----------- mdelay(1);
-----------
----------- return 0;
-----------}
-----------
-----------static long
-----------core99_firewire_cable_power(struct device_node* node, long param, long value)
-----------{
----------- unsigned long flags;
----------- struct macio_chip* macio;
-----------
----------- /* Trick: we allow NULL node */
----------- if ((pmac_mb.board_flags & PMAC_MB_HAS_FW_POWER) == 0)
----------- return -ENODEV;
----------- macio = &macio_chips[0];
----------- if (macio->type != macio_keylargo && macio->type != macio_pangea &&
----------- macio->type != macio_intrepid)
----------- return -ENODEV;
----------- if (!(macio->flags & MACIO_FLAG_FW_SUPPORTED))
----------- return -ENODEV;
-----------
----------- LOCK(flags);
----------- if (value) {
----------- MACIO_OUT8(KL_GPIO_FW_CABLE_POWER , 0);
----------- MACIO_IN8(KL_GPIO_FW_CABLE_POWER);
----------- udelay(10);
----------- } else {
----------- MACIO_OUT8(KL_GPIO_FW_CABLE_POWER , 4);
----------- MACIO_IN8(KL_GPIO_FW_CABLE_POWER); udelay(10);
----------- }
----------- UNLOCK(flags);
----------- mdelay(1);
-----------
----------- return 0;
-----------}
-----------
-----------static long
-----------intrepid_aack_delay_enable(struct device_node* node, long param, long value)
-----------{
----------- unsigned long flags;
-----------
----------- if (uninorth_rev < 0xd2)
----------- return -ENODEV;
-----------
----------- LOCK(flags);
----------- if (param)
----------- UN_BIS(UNI_N_AACK_DELAY, UNI_N_AACK_DELAY_ENABLE);
----------- else
----------- UN_BIC(UNI_N_AACK_DELAY, UNI_N_AACK_DELAY_ENABLE);
----------- UNLOCK(flags);
-----------
----------- return 0;
-----------}
-----------
-----------
-----------#endif /* CONFIG_POWER4 */
-----------
-----------static long
-----------core99_read_gpio(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio = &macio_chips[0];
-----------
----------- return MACIO_IN8(param);
-----------}
-----------
-----------
-----------static long
-----------core99_write_gpio(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio = &macio_chips[0];
-----------
----------- MACIO_OUT8(param, (u8)(value & 0xff));
----------- return 0;
-----------}
-----------
-----------#ifdef CONFIG_POWER4
-----------
-----------static long
-----------g5_gmac_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio = &macio_chips[0];
----------- unsigned long flags;
----------- u8 pbus, pid;
-----------
----------- LOCK(flags);
----------- if (value) {
----------- MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE);
----------- mb();
----------- k2_skiplist[0] = NULL;
----------- } else {
----------- k2_skiplist[0] = node;
----------- mb();
----------- MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_GMAC_CLK_ENABLE);
----------- }
-----------
----------- UNLOCK(flags);
----------- mdelay(1);
-----------
----------- return 0;
-----------}
-----------
-----------static long
-----------g5_fw_enable(struct device_node* node, long param, long value)
-----------{
----------- struct macio_chip* macio = &macio_chips[0];
----------- unsigned long flags;
-----------
----------- LOCK(flags);
----------- if (value) {
----------- MACIO_BIS(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE);
----------- mb();
----------- k2_skiplist[1] = NULL;
----------- } else {
----------- k2_skiplist[1] = node;
----------- mb();
----------- MACIO_BIC(KEYLARGO_FCR1, K2_FCR1_FW_CLK_ENABLE);
----------- }
-----------
----------- UNLOCK(flags);
----------- mdelay(1);
-----------
----------- return 0;
-----------}
-----------
-----------static long
-----------g5_mpic_enable(struct device_node* node, long param, long value)
-----------{
----------- unsigned long flags;
-----------
----------- if (node->parent == NULL || strcmp(node->parent->name, "u3"))
----------- return 0;
-----------
----------- LOCK(flags);
----------- UN_BIS(U3_TOGGLE_REG, U3_MPIC_RESET | U3_MPIC_OUTPUT_ENABLE);
----------- UNLOCK(flags);
-----------
----------- return 0;
-----------}
-----------
-----------#ifdef CONFIG_SMP
-----------static long
-----------g5_reset_cpu(struct device_node* node, long param, long value)
-----------{
----------- unsigned int reset_io = 0;
----------- unsigned long flags;
----------- struct macio_chip* macio;
----------- struct device_node* np;
-----------
----------- macio = &macio_chips[0];
----------- if (macio->type != macio_keylargo2)
----------- return -ENODEV;
-----------
----------- np = find_path_device("/cpus");
----------- if (np == NULL)
----------- return -ENODEV;
----------- for (np = np->child; np != NULL; np = np->sibling) {
----------- u32* num = (u32 *)get_property(np, "reg", NULL);
----------- u32* rst = (u32 *)get_property(np, "soft-reset", NULL);
----------- if (num == NULL || rst == NULL)
----------- continue;
----------- if (param == *num) {
----------- reset_io = *rst;
----------- break;
----------- }
----------- }
----------- if (np == NULL || reset_io == 0)
----------- return -ENODEV;
-----------
----------- LOCK(flags);
----------- MACIO_OUT8(reset_io, KEYLARGO_GPIO_OUTPUT_ENABLE);
----------- (void)MACIO_IN8(reset_io);
----------- udelay(1);
----------- MACIO_OUT8(reset_io, 0);
----------- (void)MACIO_IN8(reset_io);
----------- UNLOCK(flags);
-----------
----------- return 0;
-----------}
-----------#endif /* CONFIG_SMP */
-----------
-----------/*
----------- * This can be called from pmac_smp so isn't static
----------- *
----------- * This takes the second CPU off the bus on dual CPU machines
----------- * running UP
----------- */
-----------void g5_phy_disable_cpu1(void)
-----------{
----------- UN_OUT(U3_API_PHY_CONFIG_1, 0);
-----------}
-----------
-----------#endif /* CONFIG_POWER4 */
-----------
-----------#ifndef CONFIG_POWER4
-----------
-----------static void
-----------keylargo_shutdown(struct macio_chip* macio, int sleep_mode)
-----------{
----------- u32 temp;
-----------
----------- if (sleep_mode) {
----------- mdelay(1);
----------- MACIO_BIS(KEYLARGO_FCR0, KL0_USB_REF_SUSPEND);
----------- (void)MACIO_IN32(KEYLARGO_FCR0);
----------- mdelay(1);
----------- }
-----------
----------- MACIO_BIC(KEYLARGO_FCR0,KL0_SCCA_ENABLE | KL0_SCCB_ENABLE |
----------- KL0_SCC_CELL_ENABLE |
----------- KL0_IRDA_ENABLE | KL0_IRDA_CLK32_ENABLE |
----------- KL0_IRDA_CLK19_ENABLE);
-----------
----------- MACIO_BIC(KEYLARGO_MBCR, KL_MBCR_MB0_DEV_MASK);
----------- MACIO_BIS(KEYLARGO_MBCR, KL_MBCR_MB0_IDE_ENABLE);
-----------
----------- MACIO_BIC(KEYLARGO_FCR1,
----------- KL1_AUDIO_SEL_22MCLK | KL1_AUDIO_CLK_ENABLE_BIT |
----------- KL1_AUDIO_CLK_OUT_ENABLE | KL1_AUDIO_CELL_ENABLE |
----------- KL1_I2S0_CELL_ENABLE | KL1_I2S0_CLK_ENABLE_BIT |
----------- KL1_I2S0_ENABLE | KL1_I2S1_CELL_ENABLE |
----------- KL1_I2S1_CLK_ENABLE_BIT | KL1_I2S1_ENABLE |
----------- KL1_EIDE0_ENABLE | KL1_EIDE0_RESET_N |
----------- KL1_EIDE1_ENABLE | KL1_EIDE1_RESET_N |
----------- KL1_UIDE_ENABLE);
-----------
----------- MACIO_BIS(KEYLARGO_FCR2, KL2_ALT_DATA_OUT);
----------- MACIO_BIC(KEYLARGO_FCR2, KL2_IOBUS_ENABLE);
-----------
----------- temp = MACIO_IN32(KEYLARGO_FCR3);
----------- if (macio->rev >= 2) {
----------- temp |= KL3_SHUTDOWN_PLL2X;
----------- if (sleep_mode)
----------- temp |= KL3_SHUTDOWN_PLL_TOTAL;
----------- }
-----------
----------- temp |= KL3_SHUTDOWN_PLLKW6 | KL3_SHUTDOWN_PLLKW4 |
----------- KL3_SHUTDOWN_PLLKW35;
----------- if (sleep_mode)
----------- temp |= KL3_SHUTDOWN_PLLKW12;
----------- temp &= ~(KL3_CLK66_ENABLE | KL3_CLK49_ENABLE | KL3_CLK45_ENABLE
----------- | KL3_CLK31_ENABLE | KL3_I2S1_CLK18_ENABLE | KL3_I2S0_CLK18_ENABLE);
----------- if (sleep_mode)
----------- temp &= ~(KL3_TIMER_CLK18_ENABLE | KL3_VIA_CLK16_ENABLE);
----------- MACIO_OUT32(KEYLARGO_FCR3, temp);
-----------
----------- /* Flush posted writes & wait a bit */
----------- (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
-----------}
-----------
-----------static void
-----------pangea_shutdown(struct macio_chip* macio, int sleep_mode)
-----------{
----------- u32 temp;
-----------
----------- MACIO_BIC(KEYLARGO_FCR0,KL0_SCCA_ENABLE | KL0_SCCB_ENABLE |
----------- KL0_SCC_CELL_ENABLE |
----------- KL0_USB0_CELL_ENABLE | KL0_USB1_CELL_ENABLE);
-----------
----------- MACIO_BIC(KEYLARGO_FCR1,
----------- KL1_AUDIO_SEL_22MCLK | KL1_AUDIO_CLK_ENABLE_BIT |
----------- KL1_AUDIO_CLK_OUT_ENABLE | KL1_AUDIO_CELL_ENABLE |
----------- KL1_I2S0_CELL_ENABLE | KL1_I2S0_CLK_ENABLE_BIT |
----------- KL1_I2S0_ENABLE | KL1_I2S1_CELL_ENABLE |
----------- KL1_I2S1_CLK_ENABLE_BIT | KL1_I2S1_ENABLE |
----------- KL1_UIDE_ENABLE);
----------- if (pmac_mb.board_flags & PMAC_MB_MOBILE)
----------- MACIO_BIC(KEYLARGO_FCR1, KL1_UIDE_RESET_N);
-----------
----------- MACIO_BIS(KEYLARGO_FCR2, KL2_ALT_DATA_OUT);
-----------
----------- temp = MACIO_IN32(KEYLARGO_FCR3);
----------- temp |= KL3_SHUTDOWN_PLLKW6 | KL3_SHUTDOWN_PLLKW4 |
----------- KL3_SHUTDOWN_PLLKW35;
----------- temp &= ~(KL3_CLK49_ENABLE | KL3_CLK45_ENABLE | KL3_CLK31_ENABLE
----------- | KL3_I2S0_CLK18_ENABLE | KL3_I2S1_CLK18_ENABLE);
----------- if (sleep_mode)
----------- temp &= ~(KL3_VIA_CLK16_ENABLE | KL3_TIMER_CLK18_ENABLE);
----------- MACIO_OUT32(KEYLARGO_FCR3, temp);
-----------
----------- /* Flush posted writes & wait a bit */
----------- (void)MACIO_IN32(KEYLARGO_FCR0); mdelay(1);
-----------}
-----------
-----------static void
-----------intrepid_shutdown(struct macio_chip* macio, int sleep_mode)
-----------{
----------- u32 temp;
-----------
----------- MACIO_BIC(KEYLARGO_FCR0,KL0_SCCA_ENABLE | KL0_SCCB_ENABLE |
----------- KL0_SCC_CELL_ENABLE);
-----------
----------- MACIO_BIC(KEYLARGO_FCR1,
----------- /*KL1_USB2_CELL_ENABLE |*/
----------- KL1_I2S0_CELL_ENABLE | KL1_I2S0_CLK_ENABLE_BIT |
----------- KL1_I2S0_ENABLE | KL1_I2S1_CELL_ENABLE |
----------- KL1_I2S1_CLK_ENABLE_BIT | KL1_I2S1_ENABLE);
----------- if (pmac_mb.board_flags & PMAC_MB_MOBILE)
----------- MACIO_BIC(KEYLARGO_FCR1, KL1_UIDE_RESET_N);
-----------
----------- temp = MACIO_IN32(KEYLARGO_FCR3);
----------- temp &= ~(KL3_CLK49_ENABLE | KL3_CLK45_ENABLE |
----------- KL3_I2S1_CLK18_ENABLE | KL3_I2S0_CLK18_ENABLE);
----------- if (sleep_mode)
----------- temp &= ~(KL3_TIMER_CLK18_ENABLE | KL3_IT_VIA_CLK32_ENABLE);
----------- MACIO_OUT32(KEYLARGO_FCR3, temp);
-----------
----------- /* Flush posted writes & wait a bit */
----------- (void)MACIO_IN32(KEYLARGO_FCR0);
----------- mdelay(10);
-----------}
-----------
-----------
-----------void pmac_tweak_clock_spreading(int enable)
-----------{
----------- struct macio_chip* macio = &macio_chips[0];
-----------
----------- /* Hack for doing clock spreading on some machines PowerBooks and
----------- * iBooks. This implements the "platform-do-clockspreading" OF
----------- * property as decoded manually on various models. For safety, we also
----------- * check the product ID in the device-tree in cases we'll whack the i2c
----------- * chip to make reasonably sure we won't set wrong values in there
----------- *
----------- * Of course, ultimately, we have to implement a real parser for
----------- * the platform-do-* stuff...
----------- */
-----------
----------- if (macio->type == macio_intrepid) {
-- - ---- struct device_node *clock =
-- - ---- of_find_node_by_path("/uni-n@f8000000/hw-clock");
-- - ---- if (clock && get_property(clock, "platform-do-clockspreading",
-- - ---- NULL)) {
-- - ---- printk(KERN_INFO "%sabling clock spreading on Intrepid"
-- - ---- " ASIC\n", enable ? "En" : "Dis");
-- - ---- if (enable)
-- - ---- UN_OUT(UNI_N_CLOCK_SPREADING, 2);
-- - ---- else
-- - ---- UN_OUT(UNI_N_CLOCK_SPREADING, 0);
-- - ---- mdelay(40);
-- - ---- }
-- - ---- of_node_put(clock);
- --- if (enable)
- --- UN_OUT(UNI_N_CLOCK_SPREADING, 2);
- --- else
- --- UN_OUT(UNI_N_CLOCK_SPREADING, 0);
- --- mdelay(40);
----------- }
-----------
----------- while (machine_is_compatible("PowerBook5,2") ||
----------- machine_is_compatible("PowerBook5,3") ||
----------- machine_is_compatible("PowerBook6,2") ||
----------- machine_is_compatible("PowerBook6,3")) {
----------- struct device_node *ui2c = of_find_node_by_type(NULL, "i2c");
----------- struct device_node *dt = of_find_node_by_name(NULL, "device-tree");
----------- u8 buffer[9];
----------- u32 *productID;
----------- int i, rc, changed = 0;
-----------
----------- if (dt == NULL)
----------- break;
----------- productID = (u32 *)get_property(dt, "pid#", NULL);
----------- if (productID == NULL)
----------- break;
----------- while(ui2c) {
----------- struct device_node *p = of_get_parent(ui2c);
----------- if (p && !strcmp(p->name, "uni-n"))
----------- break;
----------- ui2c = of_find_node_by_type(ui2c, "i2c");
----------- }
----------- if (ui2c == NULL)
----------- break;
----------- DBG("Trying to bump clock speed for PID: %08x...\n", *productID);
----------- rc = pmac_low_i2c_open(ui2c, 1);
----------- if (rc != 0)
----------- break;
----------- pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_combined);
----------- rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_read, 0x80, buffer, 9);
----------- DBG("read result: %d,", rc);
----------- if (rc != 0) {
----------- pmac_low_i2c_close(ui2c);
----------- break;
----------- }
----------- for (i=0; i<9; i++)
----------- DBG(" %02x", buffer[i]);
----------- DBG("\n");
-----------
----------- switch(*productID) {
----------- case 0x1182: /* AlBook 12" rev 2 */
----------- case 0x1183: /* iBook G4 12" */
----------- buffer[0] = (buffer[0] & 0x8f) | 0x70;
----------- buffer[2] = (buffer[2] & 0x7f) | 0x00;
----------- buffer[5] = (buffer[5] & 0x80) | 0x31;
----------- buffer[6] = (buffer[6] & 0x40) | 0xb0;
----------- buffer[7] = (buffer[7] & 0x00) | (enable ? 0xc0 : 0xba);
----------- buffer[8] = (buffer[8] & 0x00) | 0x30;
----------- changed = 1;
----------- break;
----------- case 0x3142: /* AlBook 15" (ATI M10) */
----------- case 0x3143: /* AlBook 17" (ATI M10) */
----------- buffer[0] = (buffer[0] & 0xaf) | 0x50;
----------- buffer[2] = (buffer[2] & 0x7f) | 0x00;
----------- buffer[5] = (buffer[5] & 0x80) | 0x31;
----------- buffer[6] = (buffer[6] & 0x40) | 0xb0;
----------- buffer[7] = (buffer[7] & 0x00) | (enable ? 0xd0 : 0xc0);
----------- buffer[8] = (buffer[8] & 0x00) | 0x30;
----------- changed = 1;
----------- break;
----------- default:
----------- DBG("i2c-hwclock: Machine model not handled\n");
----------- break;
----------- }
----------- if (!changed) {
----------- pmac_low_i2c_close(ui2c);
----------- break;
----------- }
-- - ---- printk(KERN_INFO "%sabling clock spreading on i2c clock chip\n",
-- - ---- enable ? "En" : "Dis");
----------- pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_stdsub);
----------- rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_write, 0x80, buffer, 9);
----------- DBG("write result: %d,", rc);
----------- pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_combined);
----------- rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_read, 0x80, buffer, 9);
----------- DBG("read result: %d,", rc);
----------- if (rc != 0) {
----------- pmac_low_i2c_close(ui2c);
----------- break;
----------- }
----------- for (i=0; i<9; i++)
----------- DBG(" %02x", buffer[i]);
----------- pmac_low_i2c_close(ui2c);
----------- break;
----------- }
-----------}
-----------
-----------
-----------static int
-----------core99_sleep(void)
-----------{
----------- struct macio_chip* macio;
----------- int i;
-----------
----------- macio = &macio_chips[0];
----------- if (macio->type != macio_keylargo && macio->type != macio_pangea &&
----------- macio->type != macio_intrepid)
----------- return -ENODEV;
-----------
----------- /* We power off the wireless slot in case it was not done
----------- * by the driver. We don't power it on automatically however
----------- */
----------- if (macio->flags & MACIO_FLAG_AIRPORT_ON)
----------- core99_airport_enable(macio->of_node, 0, 0);
-----------
----------- /* We power off the FW cable. Should be done by the driver... */
----------- if (macio->flags & MACIO_FLAG_FW_SUPPORTED) {
----------- core99_firewire_enable(NULL, 0, 0);
----------- core99_firewire_cable_power(NULL, 0, 0);
----------- }
-----------
----------- /* We make sure int. modem is off (in case driver lost it) */
----------- if (macio->type == macio_keylargo)
----------- core99_modem_enable(macio->of_node, 0, 0);
----------- else
----------- pangea_modem_enable(macio->of_node, 0, 0);
-----------
----------- /* We make sure the sound is off as well */
----------- core99_sound_chip_enable(macio->of_node, 0, 0);
-----------
----------- /*
----------- * Save various bits of KeyLargo
----------- */
-----------
----------- /* Save the state of the various GPIOs */
----------- save_gpio_levels[0] = MACIO_IN32(KEYLARGO_GPIO_LEVELS0);
----------- save_gpio_levels[1] = MACIO_IN32(KEYLARGO_GPIO_LEVELS1);
----------- for (i=0; i<KEYLARGO_GPIO_EXTINT_CNT; i++)
----------- save_gpio_extint[i] = MACIO_IN8(KEYLARGO_GPIO_EXTINT_0+i);
----------- for (i=0; i<KEYLARGO_GPIO_CNT; i++)
----------- save_gpio_normal[i] = MACIO_IN8(KEYLARGO_GPIO_0+i);
-----------
----------- /* Save the FCRs */
----------- if (macio->type == macio_keylargo)
----------- save_mbcr = MACIO_IN32(KEYLARGO_MBCR);
----------- save_fcr[0] = MACIO_IN32(KEYLARGO_FCR0);
----------- save_fcr[1] = MACIO_IN32(KEYLARGO_FCR1);
----------- save_fcr[2] = MACIO_IN32(KEYLARGO_FCR2);
----------- save_fcr[3] = MACIO_IN32(KEYLARGO_FCR3);
----------- save_fcr[4] = MACIO_IN32(KEYLARGO_FCR4);
----------- if (macio->type == macio_pangea || macio->type == macio_intrepid)
----------- save_fcr[5] = MACIO_IN32(KEYLARGO_FCR5);
-----------
----------- /* Save state & config of DBDMA channels */
----------- dbdma_save(macio, save_dbdma);
-----------
----------- /*
----------- * Turn off as much as we can
----------- */
----------- if (macio->type == macio_pangea)
----------- pangea_shutdown(macio, 1);
----------- else if (macio->type == macio_intrepid)
----------- intrepid_shutdown(macio, 1);
----------- else if (macio->type == macio_keylargo)
----------- keylargo_shutdown(macio, 1);
-----------
----------- /*
----------- * Put the host bridge to sleep
----------- */
-----------
----------- save_unin_clock_ctl = UN_IN(UNI_N_CLOCK_CNTL);
----------- /* Note: do not switch GMAC off, driver does it when necessary, WOL must keep it
----------- * enabled !
----------- */
----------- UN_OUT(UNI_N_CLOCK_CNTL, save_unin_clock_ctl &
----------- ~(/*UNI_N_CLOCK_CNTL_GMAC|*/UNI_N_CLOCK_CNTL_FW/*|UNI_N_CLOCK_CNTL_PCI*/));
----------- udelay(100);
----------- UN_OUT(UNI_N_HWINIT_STATE, UNI_N_HWINIT_STATE_SLEEPING);
----------- UN_OUT(UNI_N_POWER_MGT, UNI_N_POWER_MGT_SLEEP);
----------- mdelay(10);
-----------
----------- /*
----------- * FIXME: A bit of black magic with OpenPIC (don't ask me why)
----------- */
----------- if (pmac_mb.model_id == PMAC_TYPE_SAWTOOTH) {
----------- MACIO_BIS(0x506e0, 0x00400000);
----------- MACIO_BIS(0x506e0, 0x80000000);
----------- }
----------- return 0;
-----------}
-----------
-----------static int
-----------core99_wake_up(void)
-----------{
----------- struct macio_chip* macio;
----------- int i;
-----------
----------- macio = &macio_chips[0];
----------- if (macio->type != macio_keylargo && macio->type != macio_pangea &&
----------- macio->type != macio_intrepid)
----------- return -ENODEV;
-----------
----------- /*
----------- * Wakeup the host bridge
----------- */
----------- UN_OUT(UNI_N_POWER_MGT, UNI_N_POWER_MGT_NORMAL);
----------- udelay(10);
----------- UN_OUT(UNI_N_HWINIT_STATE, UNI_N_HWINIT_STATE_RUNNING);
----------- udelay(10);
-----------
----------- /*
----------- * Restore KeyLargo
----------- */
-----------
----------- if (macio->type == macio_keylargo) {
----------- MACIO_OUT32(KEYLARGO_MBCR, save_mbcr);
----------- (void)MACIO_IN32(KEYLARGO_MBCR); udelay(10);
----------- }
----------- MACIO_OUT32(KEYLARGO_FCR0, save_fcr[0]);
----------- (void)MACIO_IN32(KEYLARGO_FCR0); udelay(10);
----------- MACIO_OUT32(KEYLARGO_FCR1, save_fcr[1]);
----------- (void)MACIO_IN32(KEYLARGO_FCR1); udelay(10);
----------- MACIO_OUT32(KEYLARGO_FCR2, save_fcr[2]);
----------- (void)MACIO_IN32(KEYLARGO_FCR2); udelay(10);
----------- MACIO_OUT32(KEYLARGO_FCR3, save_fcr[3]);
----------- (void)MACIO_IN32(KEYLARGO_FCR3); udelay(10);
----------- MACIO_OUT32(KEYLARGO_FCR4, save_fcr[4]);
----------- (void)MACIO_IN32(KEYLARGO_FCR4); udelay(10);
----------- if (macio->type == macio_pangea || macio->type == macio_intrepid) {
----------- MACIO_OUT32(KEYLARGO_FCR5, save_fcr[5]);
----------- (void)MACIO_IN32(KEYLARGO_FCR5); udelay(10);
----------- }
-----------
----------- dbdma_restore(macio, save_dbdma);
-----------
----------- MACIO_OUT32(KEYLARGO_GPIO_LEVELS0, save_gpio_levels[0]);
----------- MACIO_OUT32(KEYLARGO_GPIO_LEVELS1, save_gpio_levels[1]);
----------- for (i=0; i<KEYLARGO_GPIO_EXTINT_CNT; i++)
----------- MACIO_OUT8(KEYLARGO_GPIO_EXTINT_0+i, save_gpio_extint[i]);
----------- for (i=0; i<KEYLARGO_GPIO_CNT; i++)
----------- MACIO_OUT8(KEYLARGO_GPIO_0+i, save_gpio_normal[i]);
-----------
----------- /* FIXME more black magic with OpenPIC ... */
----------- if (pmac_mb.model_id == PMAC_TYPE_SAWTOOTH) {
----------- MACIO_BIC(0x506e0, 0x00400000);
----------- MACIO_BIC(0x506e0, 0x80000000);
----------- }
-----------
----------- UN_OUT(UNI_N_CLOCK_CNTL, save_unin_clock_ctl);
----------- udelay(100);
-----------
----------- return 0;
-----------}
-----------
-----------static long
-----------core99_sleep_state(struct device_node* node, long param, long value)
-----------{
----------- /* Param == 1 means to enter the "fake sleep" mode that is
----------- * used for CPU speed switch
----------- */
----------- if (param == 1) {
----------- if (value == 1) {
----------- UN_OUT(UNI_N_HWINIT_STATE, UNI_N_HWINIT_STATE_SLEEPING);
----------- UN_OUT(UNI_N_POWER_MGT, UNI_N_POWER_MGT_IDLE2);
----------- } else {
----------- UN_OUT(UNI_N_POWER_MGT, UNI_N_POWER_MGT_NORMAL);
----------- udelay(10);
----------- UN_OUT(UNI_N_HWINIT_STATE, UNI_N_HWINIT_STATE_RUNNING);
----------- udelay(10);
----------- }
----------- return 0;
----------- }
----------- if ((pmac_mb.board_flags & PMAC_MB_CAN_SLEEP) == 0)
----------- return -EPERM;
-----------
----------- if (value == 1)
----------- return core99_sleep();
----------- else if (value == 0)
----------- return core99_wake_up();
----------- return 0;
-----------}
-----------
-----------#endif /* CONFIG_POWER4 */
-----------
-----------static long
-----------generic_dev_can_wake(struct device_node* node, long param, long value)
-----------{
----------- /* Todo: eventually check we are really dealing with on-board
----------- * video device ...
----------- */
-----------
----------- if (pmac_mb.board_flags & PMAC_MB_MAY_SLEEP)
----------- pmac_mb.board_flags |= PMAC_MB_CAN_SLEEP;
----------- return 0;
-----------}
-----------
-----------static long
-----------generic_get_mb_info(struct device_node* node, long param, long value)
-----------{
----------- switch(param) {
----------- case PMAC_MB_INFO_MODEL:
----------- return pmac_mb.model_id;
----------- case PMAC_MB_INFO_FLAGS:
----------- return pmac_mb.board_flags;
----------- case PMAC_MB_INFO_NAME:
----------- /* hack hack hack... but should work */
----------- *((const char **)value) = pmac_mb.model_name;
----------- return 0;
----------- }
----------- return -EINVAL;
-----------}
-----------
-----------
-----------/*
----------- * Table definitions
----------- */
-----------
-----------/* Used on any machine
----------- */
-----------static struct feature_table_entry any_features[] = {
----------- { PMAC_FTR_GET_MB_INFO, generic_get_mb_info },
----------- { PMAC_FTR_DEVICE_CAN_WAKE, generic_dev_can_wake },
----------- { 0, NULL }
-----------};
-----------
-----------#ifndef CONFIG_POWER4
-----------
-----------/* OHare based motherboards. Currently, we only use these on the
----------- * 2400,3400 and 3500 series powerbooks. Some older desktops seem
----------- * to have issues with turning on/off those asic cells
----------- */
-----------static struct feature_table_entry ohare_features[] = {
----------- { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable },
----------- { PMAC_FTR_SWIM3_ENABLE, ohare_floppy_enable },
----------- { PMAC_FTR_MESH_ENABLE, ohare_mesh_enable },
----------- { PMAC_FTR_IDE_ENABLE, ohare_ide_enable},
----------- { PMAC_FTR_IDE_RESET, ohare_ide_reset},
----------- { PMAC_FTR_SLEEP_STATE, ohare_sleep_state },
----------- { 0, NULL }
-----------};
-----------
-----------/* Heathrow desktop machines (Beige G3).
----------- * Separated as some features couldn't be properly tested
----------- * and the serial port control bits appear to confuse it.
----------- */
-----------static struct feature_table_entry heathrow_desktop_features[] = {
----------- { PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable },
----------- { PMAC_FTR_MESH_ENABLE, heathrow_mesh_enable },
----------- { PMAC_FTR_IDE_ENABLE, heathrow_ide_enable },
----------- { PMAC_FTR_IDE_RESET, heathrow_ide_reset },
----------- { PMAC_FTR_BMAC_ENABLE, heathrow_bmac_enable },
----------- { 0, NULL }
-----------};
-----------
-----------/* Heathrow based laptop, that is the Wallstreet and mainstreet
----------- * powerbooks.
----------- */
-----------static struct feature_table_entry heathrow_laptop_features[] = {
----------- { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable },
----------- { PMAC_FTR_MODEM_ENABLE, heathrow_modem_enable },
----------- { PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable },
----------- { PMAC_FTR_MESH_ENABLE, heathrow_mesh_enable },
----------- { PMAC_FTR_IDE_ENABLE, heathrow_ide_enable },
----------- { PMAC_FTR_IDE_RESET, heathrow_ide_reset },
----------- { PMAC_FTR_BMAC_ENABLE, heathrow_bmac_enable },
----------- { PMAC_FTR_SOUND_CHIP_ENABLE, heathrow_sound_enable },
----------- { PMAC_FTR_SLEEP_STATE, heathrow_sleep_state },
----------- { 0, NULL }
-----------};
-----------
-----------/* Paddington based machines
----------- * The lombard (101) powerbook, first iMac models, B&W G3 and Yikes G4.
----------- */
-----------static struct feature_table_entry paddington_features[] = {
----------- { PMAC_FTR_SCC_ENABLE, ohare_htw_scc_enable },
----------- { PMAC_FTR_MODEM_ENABLE, heathrow_modem_enable },
----------- { PMAC_FTR_SWIM3_ENABLE, heathrow_floppy_enable },
----------- { PMAC_FTR_MESH_ENABLE, heathrow_mesh_enable },
----------- { PMAC_FTR_IDE_ENABLE, heathrow_ide_enable },
----------- { PMAC_FTR_IDE_RESET, heathrow_ide_reset },
----------- { PMAC_FTR_BMAC_ENABLE, heathrow_bmac_enable },
----------- { PMAC_FTR_SOUND_CHIP_ENABLE, heathrow_sound_enable },
----------- { PMAC_FTR_SLEEP_STATE, heathrow_sleep_state },
----------- { 0, NULL }
-----------};
-----------
-----------/* Core99 & MacRISC 2 machines (all machines released since the
----------- * iBook (included), that is all AGP machines, except pangea
----------- * chipset. The pangea chipset is the "combo" UniNorth/KeyLargo
----------- * used on iBook2 & iMac "flow power".
----------- */
-----------static struct feature_table_entry core99_features[] = {
----------- { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
----------- { PMAC_FTR_MODEM_ENABLE, core99_modem_enable },
----------- { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
----------- { PMAC_FTR_IDE_RESET, core99_ide_reset },
----------- { PMAC_FTR_GMAC_ENABLE, core99_gmac_enable },
----------- { PMAC_FTR_GMAC_PHY_RESET, core99_gmac_phy_reset },
----------- { PMAC_FTR_SOUND_CHIP_ENABLE, core99_sound_chip_enable },
----------- { PMAC_FTR_AIRPORT_ENABLE, core99_airport_enable },
----------- { PMAC_FTR_USB_ENABLE, core99_usb_enable },
----------- { PMAC_FTR_1394_ENABLE, core99_firewire_enable },
----------- { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power },
----------- { PMAC_FTR_SLEEP_STATE, core99_sleep_state },
-----------#ifdef CONFIG_SMP
----------- { PMAC_FTR_RESET_CPU, core99_reset_cpu },
-----------#endif /* CONFIG_SMP */
----------- { PMAC_FTR_READ_GPIO, core99_read_gpio },
----------- { PMAC_FTR_WRITE_GPIO, core99_write_gpio },
----------- { 0, NULL }
-----------};
-----------
-----------/* RackMac
----------- */
-----------static struct feature_table_entry rackmac_features[] = {
----------- { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
----------- { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
----------- { PMAC_FTR_IDE_RESET, core99_ide_reset },
----------- { PMAC_FTR_GMAC_ENABLE, core99_gmac_enable },
----------- { PMAC_FTR_GMAC_PHY_RESET, core99_gmac_phy_reset },
----------- { PMAC_FTR_USB_ENABLE, core99_usb_enable },
----------- { PMAC_FTR_1394_ENABLE, core99_firewire_enable },
----------- { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power },
----------- { PMAC_FTR_SLEEP_STATE, core99_sleep_state },
-----------#ifdef CONFIG_SMP
----------- { PMAC_FTR_RESET_CPU, core99_reset_cpu },
-----------#endif /* CONFIG_SMP */
----------- { PMAC_FTR_READ_GPIO, core99_read_gpio },
----------- { PMAC_FTR_WRITE_GPIO, core99_write_gpio },
----------- { 0, NULL }
-----------};
-----------
-----------/* Pangea features
----------- */
-----------static struct feature_table_entry pangea_features[] = {
----------- { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
----------- { PMAC_FTR_MODEM_ENABLE, pangea_modem_enable },
----------- { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
----------- { PMAC_FTR_IDE_RESET, core99_ide_reset },
----------- { PMAC_FTR_GMAC_ENABLE, core99_gmac_enable },
----------- { PMAC_FTR_GMAC_PHY_RESET, core99_gmac_phy_reset },
----------- { PMAC_FTR_SOUND_CHIP_ENABLE, core99_sound_chip_enable },
----------- { PMAC_FTR_AIRPORT_ENABLE, core99_airport_enable },
----------- { PMAC_FTR_USB_ENABLE, core99_usb_enable },
----------- { PMAC_FTR_1394_ENABLE, core99_firewire_enable },
----------- { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power },
----------- { PMAC_FTR_SLEEP_STATE, core99_sleep_state },
----------- { PMAC_FTR_READ_GPIO, core99_read_gpio },
----------- { PMAC_FTR_WRITE_GPIO, core99_write_gpio },
----------- { 0, NULL }
-----------};
-----------
-----------/* Intrepid features
----------- */
-----------static struct feature_table_entry intrepid_features[] = {
----------- { PMAC_FTR_SCC_ENABLE, core99_scc_enable },
----------- { PMAC_FTR_MODEM_ENABLE, pangea_modem_enable },
----------- { PMAC_FTR_IDE_ENABLE, core99_ide_enable },
----------- { PMAC_FTR_IDE_RESET, core99_ide_reset },
----------- { PMAC_FTR_GMAC_ENABLE, core99_gmac_enable },
----------- { PMAC_FTR_GMAC_PHY_RESET, core99_gmac_phy_reset },
----------- { PMAC_FTR_SOUND_CHIP_ENABLE, core99_sound_chip_enable },
----------- { PMAC_FTR_AIRPORT_ENABLE, core99_airport_enable },
----------- { PMAC_FTR_USB_ENABLE, core99_usb_enable },
----------- { PMAC_FTR_1394_ENABLE, core99_firewire_enable },
----------- { PMAC_FTR_1394_CABLE_POWER, core99_firewire_cable_power },
----------- { PMAC_FTR_SLEEP_STATE, core99_sleep_state },
----------- { PMAC_FTR_READ_GPIO, core99_read_gpio },
----------- { PMAC_FTR_WRITE_GPIO, core99_write_gpio },
----------- { PMAC_FTR_AACK_DELAY_ENABLE, intrepid_aack_delay_enable },
----------- { 0, NULL }
-----------};
-----------
-----------#else /* CONFIG_POWER4 */
-----------
-----------/* G5 features
----------- */
-----------static struct feature_table_entry g5_features[] = {
----------- { PMAC_FTR_GMAC_ENABLE, g5_gmac_enable },
----------- { PMAC_FTR_1394_ENABLE, g5_fw_enable },
----------- { PMAC_FTR_ENABLE_MPIC, g5_mpic_enable },
-----------#ifdef CONFIG_SMP
----------- { PMAC_FTR_RESET_CPU, g5_reset_cpu },
-----------#endif /* CONFIG_SMP */
----------- { PMAC_FTR_READ_GPIO, core99_read_gpio },
----------- { PMAC_FTR_WRITE_GPIO, core99_write_gpio },
----------- { 0, NULL }
-----------};
-----------
-----------#endif /* CONFIG_POWER4 */
-----------
-----------static struct pmac_mb_def pmac_mb_defs[] = {
-----------#ifndef CONFIG_POWER4
----------- /*
----------- * Desktops
----------- */
-----------
----------- { "AAPL,8500", "PowerMac 8500/8600",
----------- PMAC_TYPE_PSURGE, NULL,
----------- 0
----------- },
----------- { "AAPL,9500", "PowerMac 9500/9600",
----------- PMAC_TYPE_PSURGE, NULL,
----------- 0
----------- },
----------- { "AAPL,7200", "PowerMac 7200",
----------- PMAC_TYPE_PSURGE, NULL,
----------- 0
----------- },
----------- { "AAPL,7300", "PowerMac 7200/7300",
----------- PMAC_TYPE_PSURGE, NULL,
----------- 0
----------- },
----------- { "AAPL,7500", "PowerMac 7500",
----------- PMAC_TYPE_PSURGE, NULL,
----------- 0
----------- },
----------- { "AAPL,ShinerESB", "Apple Network Server",
----------- PMAC_TYPE_ANS, NULL,
----------- 0
----------- },
----------- { "AAPL,e407", "Alchemy",
----------- PMAC_TYPE_ALCHEMY, NULL,
----------- 0
----------- },
----------- { "AAPL,e411", "Gazelle",
----------- PMAC_TYPE_GAZELLE, NULL,
----------- 0
----------- },
----------- { "AAPL,Gossamer", "PowerMac G3 (Gossamer)",
----------- PMAC_TYPE_GOSSAMER, heathrow_desktop_features,
----------- 0
----------- },
----------- { "AAPL,PowerMac G3", "PowerMac G3 (Silk)",
----------- PMAC_TYPE_SILK, heathrow_desktop_features,
----------- 0
----------- },
----------- { "PowerMac1,1", "Blue&White G3",
----------- PMAC_TYPE_YOSEMITE, paddington_features,
----------- 0
----------- },
----------- { "PowerMac1,2", "PowerMac G4 PCI Graphics",
----------- PMAC_TYPE_YIKES, paddington_features,
----------- 0
----------- },
----------- { "PowerMac2,1", "iMac FireWire",
----------- PMAC_TYPE_FW_IMAC, core99_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99
----------- },
----------- { "PowerMac2,2", "iMac FireWire",
----------- PMAC_TYPE_FW_IMAC, core99_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99
----------- },
----------- { "PowerMac3,1", "PowerMac G4 AGP Graphics",
----------- PMAC_TYPE_SAWTOOTH, core99_features,
----------- PMAC_MB_OLD_CORE99
----------- },
----------- { "PowerMac3,2", "PowerMac G4 AGP Graphics",
----------- PMAC_TYPE_SAWTOOTH, core99_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99
----------- },
----------- { "PowerMac3,3", "PowerMac G4 AGP Graphics",
----------- PMAC_TYPE_SAWTOOTH, core99_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99
----------- },
----------- { "PowerMac3,4", "PowerMac G4 Silver",
----------- PMAC_TYPE_QUICKSILVER, core99_features,
----------- PMAC_MB_MAY_SLEEP
----------- },
----------- { "PowerMac3,5", "PowerMac G4 Silver",
----------- PMAC_TYPE_QUICKSILVER, core99_features,
----------- PMAC_MB_MAY_SLEEP
----------- },
----------- { "PowerMac3,6", "PowerMac G4 Windtunnel",
----------- PMAC_TYPE_WINDTUNNEL, core99_features,
----------- PMAC_MB_MAY_SLEEP,
----------- },
----------- { "PowerMac4,1", "iMac \"Flower Power\"",
----------- PMAC_TYPE_PANGEA_IMAC, pangea_features,
----------- PMAC_MB_MAY_SLEEP
----------- },
----------- { "PowerMac4,2", "Flat panel iMac",
----------- PMAC_TYPE_FLAT_PANEL_IMAC, pangea_features,
----------- PMAC_MB_CAN_SLEEP
----------- },
----------- { "PowerMac4,4", "eMac",
----------- PMAC_TYPE_EMAC, core99_features,
----------- PMAC_MB_MAY_SLEEP
----------- },
----------- { "PowerMac5,1", "PowerMac G4 Cube",
----------- PMAC_TYPE_CUBE, core99_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_OLD_CORE99
----------- },
----------- { "PowerMac6,1", "Flat panel iMac",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP,
----------- },
----------- { "PowerMac6,3", "Flat panel iMac",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP,
----------- },
----------- { "PowerMac6,4", "eMac",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP,
----------- },
----------- { "PowerMac10,1", "Mac mini",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER,
----------- },
----------- { "iMac,1", "iMac (first generation)",
----------- PMAC_TYPE_ORIG_IMAC, paddington_features,
----------- 0
----------- },
-----------
----------- /*
----------- * Xserve's
----------- */
-----------
----------- { "RackMac1,1", "XServe",
----------- PMAC_TYPE_RACKMAC, rackmac_features,
----------- 0,
----------- },
----------- { "RackMac1,2", "XServe rev. 2",
----------- PMAC_TYPE_RACKMAC, rackmac_features,
----------- 0,
----------- },
-----------
----------- /*
----------- * Laptops
----------- */
-----------
----------- { "AAPL,3400/2400", "PowerBook 3400",
----------- PMAC_TYPE_HOOPER, ohare_features,
----------- PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE
----------- },
----------- { "AAPL,3500", "PowerBook 3500",
----------- PMAC_TYPE_KANGA, ohare_features,
----------- PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE
----------- },
----------- { "AAPL,PowerBook1998", "PowerBook Wallstreet",
----------- PMAC_TYPE_WALLSTREET, heathrow_laptop_features,
----------- PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE
----------- },
----------- { "PowerBook1,1", "PowerBook 101 (Lombard)",
----------- PMAC_TYPE_101_PBOOK, paddington_features,
----------- PMAC_MB_CAN_SLEEP | PMAC_MB_MOBILE
----------- },
----------- { "PowerBook2,1", "iBook (first generation)",
----------- PMAC_TYPE_ORIG_IBOOK, core99_features,
----------- PMAC_MB_CAN_SLEEP | PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE
----------- },
----------- { "PowerBook2,2", "iBook FireWire",
----------- PMAC_TYPE_FW_IBOOK, core99_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER |
----------- PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE
----------- },
----------- { "PowerBook3,1", "PowerBook Pismo",
----------- PMAC_TYPE_PISMO, core99_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER |
----------- PMAC_MB_OLD_CORE99 | PMAC_MB_MOBILE
----------- },
----------- { "PowerBook3,2", "PowerBook Titanium",
----------- PMAC_TYPE_TITANIUM, core99_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
----------- },
----------- { "PowerBook3,3", "PowerBook Titanium II",
----------- PMAC_TYPE_TITANIUM2, core99_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
----------- },
----------- { "PowerBook3,4", "PowerBook Titanium III",
----------- PMAC_TYPE_TITANIUM3, core99_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
----------- },
----------- { "PowerBook3,5", "PowerBook Titanium IV",
----------- PMAC_TYPE_TITANIUM4, core99_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
----------- },
----------- { "PowerBook4,1", "iBook 2",
----------- PMAC_TYPE_IBOOK2, pangea_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
----------- },
----------- { "PowerBook4,2", "iBook 2",
----------- PMAC_TYPE_IBOOK2, pangea_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
----------- },
----------- { "PowerBook4,3", "iBook 2 rev. 2",
----------- PMAC_TYPE_IBOOK2, pangea_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE
----------- },
----------- { "PowerBook5,1", "PowerBook G4 17\"",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook5,2", "PowerBook G4 15\"",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook5,3", "PowerBook G4 17\"",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook5,4", "PowerBook G4 15\"",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook5,5", "PowerBook G4 17\"",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook5,6", "PowerBook G4 15\"",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook5,7", "PowerBook G4 17\"",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook5,8", "PowerBook G4 15\"",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook5,9", "PowerBook G4 17\"",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook6,1", "PowerBook G4 12\"",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook6,2", "PowerBook G4",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook6,3", "iBook G4",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook6,4", "PowerBook G4 12\"",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook6,5", "iBook G4",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook6,7", "iBook G4",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
----------- { "PowerBook6,8", "PowerBook G4 12\"",
----------- PMAC_TYPE_UNKNOWN_INTREPID, intrepid_features,
----------- PMAC_MB_MAY_SLEEP | PMAC_MB_HAS_FW_POWER | PMAC_MB_MOBILE,
----------- },
-----------#else /* CONFIG_POWER4 */
----------- { "PowerMac7,2", "PowerMac G5",
----------- PMAC_TYPE_POWERMAC_G5, g5_features,
----------- 0,
----------- },
-----------#endif /* CONFIG_POWER4 */
-----------};
-----------
-----------/*
----------- * The toplevel feature_call callback
----------- */
-----------long
-----------pmac_do_feature_call(unsigned int selector, ...)
-----------{
----------- struct device_node* node;
----------- long param, value;
----------- int i;
----------- feature_call func = NULL;
----------- va_list args;
-----------
----------- if (pmac_mb.features)
----------- for (i=0; pmac_mb.features[i].function; i++)
----------- if (pmac_mb.features[i].selector == selector) {
----------- func = pmac_mb.features[i].function;
----------- break;
----------- }
----------- if (!func)
----------- for (i=0; any_features[i].function; i++)
----------- if (any_features[i].selector == selector) {
----------- func = any_features[i].function;
----------- break;
----------- }
----------- if (!func)
----------- return -ENODEV;
-----------
----------- va_start(args, selector);
----------- node = (struct device_node*)va_arg(args, void*);
----------- param = va_arg(args, long);
----------- value = va_arg(args, long);
----------- va_end(args);
-----------
----------- return func(node, param, value);
-----------}
-----------
-----------static int __init
-----------probe_motherboard(void)
-----------{
----------- int i;
----------- struct macio_chip* macio = &macio_chips[0];
----------- const char* model = NULL;
----------- struct device_node *dt;
-----------
----------- /* Lookup known motherboard type in device-tree. First try an
----------- * exact match on the "model" property, then try a "compatible"
----------- * match is none is found.
----------- */
----------- dt = find_devices("device-tree");
----------- if (dt != NULL)
----------- model = (const char *) get_property(dt, "model", NULL);
----------- for(i=0; model && i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) {
----------- if (strcmp(model, pmac_mb_defs[i].model_string) == 0) {
----------- pmac_mb = pmac_mb_defs[i];
----------- goto found;
----------- }
----------- }
----------- for(i=0; i<(sizeof(pmac_mb_defs)/sizeof(struct pmac_mb_def)); i++) {
----------- if (machine_is_compatible(pmac_mb_defs[i].model_string)) {
----------- pmac_mb = pmac_mb_defs[i];
----------- goto found;
----------- }
----------- }
-----------
----------- /* Fallback to selection depending on mac-io chip type */
----------- switch(macio->type) {
-----------#ifndef CONFIG_POWER4
----------- case macio_grand_central:
----------- pmac_mb.model_id = PMAC_TYPE_PSURGE;
----------- pmac_mb.model_name = "Unknown PowerSurge";
----------- break;
----------- case macio_ohare:
----------- pmac_mb.model_id = PMAC_TYPE_UNKNOWN_OHARE;
----------- pmac_mb.model_name = "Unknown OHare-based";
----------- break;
----------- case macio_heathrow:
----------- pmac_mb.model_id = PMAC_TYPE_UNKNOWN_HEATHROW;
----------- pmac_mb.model_name = "Unknown Heathrow-based";
----------- pmac_mb.features = heathrow_desktop_features;
----------- break;
----------- case macio_paddington:
----------- pmac_mb.model_id = PMAC_TYPE_UNKNOWN_PADDINGTON;
----------- pmac_mb.model_name = "Unknown Paddington-based";
----------- pmac_mb.features = paddington_features;
----------- break;
----------- case macio_keylargo:
----------- pmac_mb.model_id = PMAC_TYPE_UNKNOWN_CORE99;
----------- pmac_mb.model_name = "Unknown Keylargo-based";
----------- pmac_mb.features = core99_features;
----------- break;
----------- case macio_pangea:
----------- pmac_mb.model_id = PMAC_TYPE_UNKNOWN_PANGEA;
----------- pmac_mb.model_name = "Unknown Pangea-based";
----------- pmac_mb.features = pangea_features;
----------- break;
----------- case macio_intrepid:
----------- pmac_mb.model_id = PMAC_TYPE_UNKNOWN_INTREPID;
----------- pmac_mb.model_name = "Unknown Intrepid-based";
----------- pmac_mb.features = intrepid_features;
----------- break;
-----------#else /* CONFIG_POWER4 */
----------- case macio_keylargo2:
----------- pmac_mb.model_id = PMAC_TYPE_UNKNOWN_K2;
----------- pmac_mb.model_name = "Unknown G5";
----------- pmac_mb.features = g5_features;
----------- break;
-----------#endif /* CONFIG_POWER4 */
----------- default:
----------- return -ENODEV;
----------- }
-----------found:
-----------#ifndef CONFIG_POWER4
----------- /* Fixup Hooper vs. Comet */
----------- if (pmac_mb.model_id == PMAC_TYPE_HOOPER) {
----------- u32 __iomem * mach_id_ptr = ioremap(0xf3000034, 4);
----------- if (!mach_id_ptr)
----------- return -ENODEV;
----------- /* Here, I used to disable the media-bay on comet. It
----------- * appears this is wrong, the floppy connector is actually
----------- * a kind of media-bay and works with the current driver.
----------- */
----------- if (__raw_readl(mach_id_ptr) & 0x20000000UL)
----------- pmac_mb.model_id = PMAC_TYPE_COMET;
----------- iounmap(mach_id_ptr);
----------- }
-----------#endif /* CONFIG_POWER4 */
-----------
-----------#ifdef CONFIG_6xx
----------- /* Set default value of powersave_nap on machines that support it.
----------- * It appears that uninorth rev 3 has a problem with it, we don't
----------- * enable it on those. In theory, the flush-on-lock property is
----------- * supposed to be set when not supported, but I'm not very confident
----------- * that all Apple OF revs did it properly, I do it the paranoid way.
----------- */
----------- while (uninorth_base && uninorth_rev > 3) {
----------- struct device_node* np = find_path_device("/cpus");
----------- if (!np || !np->child) {
----------- printk(KERN_WARNING "Can't find CPU(s) in device tree !\n");
----------- break;
----------- }
----------- np = np->child;
----------- /* Nap mode not supported on SMP */
----------- if (np->sibling)
----------- break;
----------- /* Nap mode not supported if flush-on-lock property is present */
----------- if (get_property(np, "flush-on-lock", NULL))
----------- break;
----------- powersave_nap = 1;
----------- printk(KERN_INFO "Processor NAP mode on idle enabled.\n");
----------- break;
----------- }
-----------
----------- /* On CPUs that support it (750FX), lowspeed by default during
----------- * NAP mode
----------- */
----------- powersave_lowspeed = 1;
-----------#endif /* CONFIG_6xx */
-----------#ifdef CONFIG_POWER4
----------- powersave_nap = 1;
-----------#endif
----------- /* Check for "mobile" machine */
----------- if (model && (strncmp(model, "PowerBook", 9) == 0
----------- || strncmp(model, "iBook", 5) == 0))
----------- pmac_mb.board_flags |= PMAC_MB_MOBILE;
-----------
-----------
----------- printk(KERN_INFO "PowerMac motherboard: %s\n", pmac_mb.model_name);
----------- return 0;
-----------}
-----------
-----------/* Initialize the Core99 UniNorth host bridge and memory controller
----------- */
-----------static void __init
-----------probe_uninorth(void)
-----------{
----------- unsigned long actrl;
-----------
----------- /* Locate core99 Uni-N */
----------- uninorth_node = of_find_node_by_name(NULL, "uni-n");
----------- /* Locate G5 u3 */
----------- if (uninorth_node == NULL) {
----------- uninorth_node = of_find_node_by_name(NULL, "u3");
----------- uninorth_u3 = 1;
----------- }
----------- if (uninorth_node && uninorth_node->n_addrs > 0) {
----------- unsigned long address = uninorth_node->addrs[0].address;
----------- uninorth_base = ioremap(address, 0x40000);
----------- uninorth_rev = in_be32(UN_REG(UNI_N_VERSION));
----------- if (uninorth_u3)
----------- u3_ht = ioremap(address + U3_HT_CONFIG_BASE, 0x1000);
----------- } else
----------- uninorth_node = NULL;
-----------
----------- if (!uninorth_node)
----------- return;
-----------
----------- printk(KERN_INFO "Found %s memory controller & host bridge, revision: %d\n",
----------- uninorth_u3 ? "U3" : "UniNorth", uninorth_rev);
----------- printk(KERN_INFO "Mapped at 0x%08lx\n", (unsigned long)uninorth_base);
-----------
----------- /* Set the arbitrer QAck delay according to what Apple does
----------- */
----------- if (uninorth_rev < 0x11) {
----------- actrl = UN_IN(UNI_N_ARB_CTRL) & ~UNI_N_ARB_CTRL_QACK_DELAY_MASK;
----------- actrl |= ((uninorth_rev < 3) ? UNI_N_ARB_CTRL_QACK_DELAY105 :
----------- UNI_N_ARB_CTRL_QACK_DELAY) << UNI_N_ARB_CTRL_QACK_DELAY_SHIFT;
----------- UN_OUT(UNI_N_ARB_CTRL, actrl);
----------- }
-----------
----------- /* Some more magic as done by them in recent MacOS X on UniNorth
----------- * revs 1.5 to 2.O and Pangea. Seem to toggle the UniN Maxbus/PCI
----------- * memory timeout
----------- */
----------- if ((uninorth_rev >= 0x11 && uninorth_rev <= 0x24) || uninorth_rev == 0xc0)
----------- UN_OUT(0x2160, UN_IN(0x2160) & 0x00ffffff);
-----------}
-----------
-----------static void __init
-----------probe_one_macio(const char* name, const char* compat, int type)
-----------{
----------- struct device_node* node;
----------- int i;
----------- volatile u32 __iomem * base;
----------- u32* revp;
-----------
----------- node = find_devices(name);
----------- if (!node || !node->n_addrs)
----------- return;
----------- if (compat)
----------- do {
----------- if (device_is_compatible(node, compat))
----------- break;
----------- node = node->next;
----------- } while (node);
----------- if (!node)
----------- return;
----------- for(i=0; i<MAX_MACIO_CHIPS; i++) {
----------- if (!macio_chips[i].of_node)
----------- break;
----------- if (macio_chips[i].of_node == node)
----------- return;
----------- }
----------- if (i >= MAX_MACIO_CHIPS) {
----------- printk(KERN_ERR "pmac_feature: Please increase MAX_MACIO_CHIPS !\n");
----------- printk(KERN_ERR "pmac_feature: %s skipped\n", node->full_name);
----------- return;
----------- }
----------- base = ioremap(node->addrs[0].address, node->addrs[0].size);
----------- if (!base) {
----------- printk(KERN_ERR "pmac_feature: Can't map mac-io chip !\n");
----------- return;
----------- }
----------- if (type == macio_keylargo) {
----------- u32* did = (u32 *)get_property(node, "device-id", NULL);
----------- if (*did == 0x00000025)
----------- type = macio_pangea;
----------- if (*did == 0x0000003e)
----------- type = macio_intrepid;
----------- }
----------- macio_chips[i].of_node = node;
----------- macio_chips[i].type = type;
----------- macio_chips[i].base = base;
----------- macio_chips[i].flags = MACIO_FLAG_SCCB_ON | MACIO_FLAG_SCCB_ON;
----------- macio_chips[i].name = macio_names[type];
----------- revp = (u32 *)get_property(node, "revision-id", NULL);
----------- if (revp)
----------- macio_chips[i].rev = *revp;
----------- printk(KERN_INFO "Found a %s mac-io controller, rev: %d, mapped at 0x%p\n",
----------- macio_names[type], macio_chips[i].rev, macio_chips[i].base);
-----------}
-----------
-----------static int __init
-----------probe_macios(void)
-----------{
----------- /* Warning, ordering is important */
----------- probe_one_macio("gc", NULL, macio_grand_central);
----------- probe_one_macio("ohare", NULL, macio_ohare);
----------- probe_one_macio("pci106b,7", NULL, macio_ohareII);
----------- probe_one_macio("mac-io", "keylargo", macio_keylargo);
----------- probe_one_macio("mac-io", "paddington", macio_paddington);
----------- probe_one_macio("mac-io", "gatwick", macio_gatwick);
----------- probe_one_macio("mac-io", "heathrow", macio_heathrow);
----------- probe_one_macio("mac-io", "K2-Keylargo", macio_keylargo2);
-----------
----------- /* Make sure the "main" macio chip appear first */
----------- if (macio_chips[0].type == macio_gatwick
----------- && macio_chips[1].type == macio_heathrow) {
----------- struct macio_chip temp = macio_chips[0];
----------- macio_chips[0] = macio_chips[1];
----------- macio_chips[1] = temp;
----------- }
----------- if (macio_chips[0].type == macio_ohareII
----------- && macio_chips[1].type == macio_ohare) {
----------- struct macio_chip temp = macio_chips[0];
----------- macio_chips[0] = macio_chips[1];
----------- macio_chips[1] = temp;
----------- }
----------- macio_chips[0].lbus.index = 0;
----------- macio_chips[1].lbus.index = 1;
-----------
----------- return (macio_chips[0].of_node == NULL) ? -ENODEV : 0;
-----------}
-----------
-----------static void __init
-----------initial_serial_shutdown(struct device_node* np)
-----------{
----------- int len;
----------- struct slot_names_prop {
----------- int count;
----------- char name[1];
----------- } *slots;
----------- char *conn;
----------- int port_type = PMAC_SCC_ASYNC;
----------- int modem = 0;
-----------
----------- slots = (struct slot_names_prop *)get_property(np, "slot-names", &len);
----------- conn = get_property(np, "AAPL,connector", &len);
----------- if (conn && (strcmp(conn, "infrared") == 0))
----------- port_type = PMAC_SCC_IRDA;
----------- else if (device_is_compatible(np, "cobalt"))
----------- modem = 1;
----------- else if (slots && slots->count > 0) {
----------- if (strcmp(slots->name, "IrDA") == 0)
----------- port_type = PMAC_SCC_IRDA;
----------- else if (strcmp(slots->name, "Modem") == 0)
----------- modem = 1;
----------- }
----------- if (modem)
----------- pmac_call_feature(PMAC_FTR_MODEM_ENABLE, np, 0, 0);
----------- pmac_call_feature(PMAC_FTR_SCC_ENABLE, np, port_type, 0);
-----------}
-----------
-----------static void __init
-----------set_initial_features(void)
-----------{
----------- struct device_node* np;
-----------
----------- /* That hack appears to be necessary for some StarMax motherboards
----------- * but I'm not too sure it was audited for side-effects on other
----------- * ohare based machines...
----------- * Since I still have difficulties figuring the right way to
----------- * differenciate them all and since that hack was there for a long
----------- * time, I'll keep it around
----------- */
----------- if (macio_chips[0].type == macio_ohare && !find_devices("via-pmu")) {
----------- struct macio_chip* macio = &macio_chips[0];
----------- MACIO_OUT32(OHARE_FCR, STARMAX_FEATURES);
----------- } else if (macio_chips[0].type == macio_ohare) {
----------- struct macio_chip* macio = &macio_chips[0];
----------- MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE);
----------- } else if (macio_chips[1].type == macio_ohare) {
----------- struct macio_chip* macio = &macio_chips[1];
----------- MACIO_BIS(OHARE_FCR, OH_IOBUS_ENABLE);
----------- }
-----------
-----------#ifdef CONFIG_POWER4
----------- if (macio_chips[0].type == macio_keylargo2) {
-----------#ifndef CONFIG_SMP
----------- /* On SMP machines running UP, we have the second CPU eating
----------- * bus cycles. We need to take it off the bus. This is done
----------- * from pmac_smp for SMP kernels running on one CPU
----------- */
----------- np = of_find_node_by_type(NULL, "cpu");
----------- if (np != NULL)
----------- np = of_find_node_by_type(np, "cpu");
----------- if (np != NULL) {
----------- g5_phy_disable_cpu1();
----------- of_node_put(np);
----------- }
-----------#endif /* CONFIG_SMP */
----------- /* Enable GMAC for now for PCI probing. It will be disabled
----------- * later on after PCI probe
----------- */
----------- np = of_find_node_by_name(NULL, "ethernet");
----------- while(np) {
----------- if (device_is_compatible(np, "K2-GMAC"))
----------- g5_gmac_enable(np, 0, 1);
----------- np = of_find_node_by_name(np, "ethernet");
----------- }
-----------
----------- /* Enable FW before PCI probe. Will be disabled later on
----------- * Note: We should have a batter way to check that we are
----------- * dealing with uninorth internal cell and not a PCI cell
----------- * on the external PCI. The code below works though.
----------- */
----------- np = of_find_node_by_name(NULL, "firewire");
----------- while(np) {
----------- if (device_is_compatible(np, "pci106b,5811")) {
----------- macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED;
----------- g5_fw_enable(np, 0, 1);
----------- }
----------- np = of_find_node_by_name(np, "firewire");
----------- }
----------- }
-----------#else /* CONFIG_POWER4 */
-----------
----------- if (macio_chips[0].type == macio_keylargo ||
----------- macio_chips[0].type == macio_pangea ||
----------- macio_chips[0].type == macio_intrepid) {
----------- /* Enable GMAC for now for PCI probing. It will be disabled
----------- * later on after PCI probe
----------- */
----------- np = of_find_node_by_name(NULL, "ethernet");
----------- while(np) {
----------- if (np->parent
----------- && device_is_compatible(np->parent, "uni-north")
----------- && device_is_compatible(np, "gmac"))
----------- core99_gmac_enable(np, 0, 1);
----------- np = of_find_node_by_name(np, "ethernet");
----------- }
-----------
----------- /* Enable FW before PCI probe. Will be disabled later on
----------- * Note: We should have a batter way to check that we are
----------- * dealing with uninorth internal cell and not a PCI cell
----------- * on the external PCI. The code below works though.
----------- */
----------- np = of_find_node_by_name(NULL, "firewire");
----------- while(np) {
----------- if (np->parent
----------- && device_is_compatible(np->parent, "uni-north")
----------- && (device_is_compatible(np, "pci106b,18") ||
----------- device_is_compatible(np, "pci106b,30") ||
----------- device_is_compatible(np, "pci11c1,5811"))) {
----------- macio_chips[0].flags |= MACIO_FLAG_FW_SUPPORTED;
----------- core99_firewire_enable(np, 0, 1);
----------- }
----------- np = of_find_node_by_name(np, "firewire");
----------- }
-----------
----------- /* Enable ATA-100 before PCI probe. */
----------- np = of_find_node_by_name(NULL, "ata-6");
----------- while(np) {
----------- if (np->parent
----------- && device_is_compatible(np->parent, "uni-north")
----------- && device_is_compatible(np, "kauai-ata")) {
----------- core99_ata100_enable(np, 1);
----------- }
----------- np = of_find_node_by_name(np, "ata-6");
----------- }
-----------
----------- /* Switch airport off */
----------- np = find_devices("radio");
----------- while(np) {
----------- if (np && np->parent == macio_chips[0].of_node) {
----------- macio_chips[0].flags |= MACIO_FLAG_AIRPORT_ON;
----------- core99_airport_enable(np, 0, 0);
----------- }
----------- np = np->next;
----------- }
----------- }
-----------
----------- /* On all machines that support sound PM, switch sound off */
----------- if (macio_chips[0].of_node)
----------- pmac_do_feature_call(PMAC_FTR_SOUND_CHIP_ENABLE,
----------- macio_chips[0].of_node, 0, 0);
-----------
----------- /* While on some desktop G3s, we turn it back on */
----------- if (macio_chips[0].of_node && macio_chips[0].type == macio_heathrow
----------- && (pmac_mb.model_id == PMAC_TYPE_GOSSAMER ||
----------- pmac_mb.model_id == PMAC_TYPE_SILK)) {
----------- struct macio_chip* macio = &macio_chips[0];
----------- MACIO_BIS(HEATHROW_FCR, HRW_SOUND_CLK_ENABLE);
----------- MACIO_BIC(HEATHROW_FCR, HRW_SOUND_POWER_N);
----------- }
-----------
----------- /* Some machine models need the clock chip to be properly setup for
----------- * clock spreading now. This should be a platform function but we
----------- * don't do these at the moment
----------- */
----------- pmac_tweak_clock_spreading(1);
-----------
-----------#endif /* CONFIG_POWER4 */
-----------
----------- /* On all machines, switch modem & serial ports off */
----------- np = find_devices("ch-a");
----------- while(np) {
----------- initial_serial_shutdown(np);
----------- np = np->next;
----------- }
----------- np = find_devices("ch-b");
----------- while(np) {
----------- initial_serial_shutdown(np);
----------- np = np->next;
----------- }
-----------}
-----------
-----------void __init
-----------pmac_feature_init(void)
-----------{
----------- /* Detect the UniNorth memory controller */
----------- probe_uninorth();
-----------
----------- /* Probe mac-io controllers */
----------- if (probe_macios()) {
----------- printk(KERN_WARNING "No mac-io chip found\n");
----------- return;
----------- }
-----------
----------- /* Setup low-level i2c stuffs */
----------- pmac_init_low_i2c();
-----------
----------- /* Probe machine type */
----------- if (probe_motherboard())
----------- printk(KERN_WARNING "Unknown PowerMac !\n");
-----------
----------- /* Set some initial features (turn off some chips that will
----------- * be later turned on)
----------- */
----------- set_initial_features();
-----------}
-----------
-----------int __init
-----------pmac_feature_late_init(void)
-----------{
----------- struct device_node* np;
-----------
----------- /* Request some resources late */
----------- if (uninorth_node)
----------- request_OF_resource(uninorth_node, 0, NULL);
----------- np = find_devices("hammerhead");
----------- if (np)
----------- request_OF_resource(np, 0, NULL);
----------- np = find_devices("interrupt-controller");
----------- if (np)
----------- request_OF_resource(np, 0, NULL);
----------- return 0;
-----------}
-----------
-----------device_initcall(pmac_feature_late_init);
-----------
-----------#ifdef CONFIG_POWER4
-----------
-----------static void dump_HT_speeds(char *name, u32 cfg, u32 frq)
-----------{
----------- int freqs[16] = { 200,300,400,500,600,800,1000,0,0,0,0,0,0,0,0,0 };
----------- int bits[8] = { 8,16,0,32,2,4,0,0 };
----------- int freq = (frq >> 8) & 0xf;
-----------
----------- if (freqs[freq] == 0)
----------- printk("%s: Unknown HT link frequency %x\n", name, freq);
----------- else
----------- printk("%s: %d MHz on main link, (%d in / %d out) bits width\n",
----------- name, freqs[freq],
----------- bits[(cfg >> 28) & 0x7], bits[(cfg >> 24) & 0x7]);
-----------}
-----------
-----------void __init pmac_check_ht_link(void)
-----------{
----------- u32 ufreq, freq, ucfg, cfg;
----------- struct device_node *pcix_node;
----------- u8 px_bus, px_devfn;
----------- struct pci_controller *px_hose;
-----------
----------- (void)in_be32(u3_ht + U3_HT_LINK_COMMAND);
----------- ucfg = cfg = in_be32(u3_ht + U3_HT_LINK_CONFIG);
----------- ufreq = freq = in_be32(u3_ht + U3_HT_LINK_FREQ);
----------- dump_HT_speeds("U3 HyperTransport", cfg, freq);
-----------
----------- pcix_node = of_find_compatible_node(NULL, "pci", "pci-x");
----------- if (pcix_node == NULL) {
----------- printk("No PCI-X bridge found\n");
----------- return;
----------- }
----------- if (pci_device_from_OF_node(pcix_node, &px_bus, &px_devfn) != 0) {
----------- printk("PCI-X bridge found but not matched to pci\n");
----------- return;
----------- }
----------- px_hose = pci_find_hose_for_OF_device(pcix_node);
----------- if (px_hose == NULL) {
----------- printk("PCI-X bridge found but not matched to host\n");
----------- return;
----------- }
----------- early_read_config_dword(px_hose, px_bus, px_devfn, 0xc4, &cfg);
----------- early_read_config_dword(px_hose, px_bus, px_devfn, 0xcc, &freq);
----------- dump_HT_speeds("PCI-X HT Uplink", cfg, freq);
----------- early_read_config_dword(px_hose, px_bus, px_devfn, 0xc8, &cfg);
----------- early_read_config_dword(px_hose, px_bus, px_devfn, 0xd0, &freq);
----------- dump_HT_speeds("PCI-X HT Downlink", cfg, freq);
-----------}
-----------
-----------#endif /* CONFIG_POWER4 */
-----------
-----------/*
----------- * Early video resume hook
----------- */
-----------
-----------static void (*pmac_early_vresume_proc)(void *data);
-----------static void *pmac_early_vresume_data;
-----------
-----------void pmac_set_early_video_resume(void (*proc)(void *data), void *data)
-----------{
----------- if (_machine != _MACH_Pmac)
----------- return;
----------- preempt_disable();
----------- pmac_early_vresume_proc = proc;
----------- pmac_early_vresume_data = data;
----------- preempt_enable();
-----------}
-----------EXPORT_SYMBOL(pmac_set_early_video_resume);
-----------
-----------void pmac_call_early_video_resume(void)
-----------{
----------- if (pmac_early_vresume_proc)
----------- pmac_early_vresume_proc(pmac_early_vresume_data);
-----------}
-----------
-----------/*
----------- * AGP related suspend/resume code
----------- */
-----------
-----------static struct pci_dev *pmac_agp_bridge;
-----------static int (*pmac_agp_suspend)(struct pci_dev *bridge);
-----------static int (*pmac_agp_resume)(struct pci_dev *bridge);
-----------
-----------void pmac_register_agp_pm(struct pci_dev *bridge,
----------- int (*suspend)(struct pci_dev *bridge),
----------- int (*resume)(struct pci_dev *bridge))
-----------{
----------- if (suspend || resume) {
----------- pmac_agp_bridge = bridge;
----------- pmac_agp_suspend = suspend;
----------- pmac_agp_resume = resume;
----------- return;
----------- }
----------- if (bridge != pmac_agp_bridge)
----------- return;
----------- pmac_agp_suspend = pmac_agp_resume = NULL;
----------- return;
-----------}
-----------EXPORT_SYMBOL(pmac_register_agp_pm);
-----------
-----------void pmac_suspend_agp_for_card(struct pci_dev *dev)
-----------{
----------- if (pmac_agp_bridge == NULL || pmac_agp_suspend == NULL)
----------- return;
----------- if (pmac_agp_bridge->bus != dev->bus)
----------- return;
----------- pmac_agp_suspend(pmac_agp_bridge);
-----------}
-----------EXPORT_SYMBOL(pmac_suspend_agp_for_card);
-----------
-----------void pmac_resume_agp_for_card(struct pci_dev *dev)
-----------{
----------- if (pmac_agp_bridge == NULL || pmac_agp_resume == NULL)
----------- return;
----------- if (pmac_agp_bridge->bus != dev->bus)
----------- return;
----------- pmac_agp_resume(pmac_agp_bridge);
-----------}
-----------EXPORT_SYMBOL(pmac_resume_agp_for_card);
diff --cc arch/ppc/platforms/pmac_low_i2c.c
index 0000000,08583fc,08583fc,08583fc,08583fc,08583fc,08583fc,08583fc,08583fc,08583fc,08583fc,08583fc..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_low_i2c.c
+++ /dev/null
diff --cc arch/ppc/platforms/pmac_nvram.c
index 0000000,8c9b008,8c9b008,8c9b008,8c9b008,8c9b008,8c9b008,8c9b008,8c9b008,8c9b008,8c9b008,8c9b008..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_nvram.c
+++ /dev/null
diff --cc arch/ppc/platforms/pmac_pci.c
index 0000000,786295b,786295b,786295b,786295b,786295b,786295b,786295b,786295b,786295b,786295b,786295b..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_pci.c
+++ /dev/null
diff --cc arch/ppc/platforms/pmac_pic.c
index 0000000,4742bf6,4742bf6,4742bf6,4742bf6,4742bf6,4742bf6,4742bf6,4742bf6,4742bf6,4742bf6,4742bf6..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_pic.c
+++ /dev/null
diff --cc arch/ppc/platforms/pmac_pic.h
index 0000000,664103d,664103d,664103d,664103d,664103d,664103d,664103d,664103d,664103d,664103d,664103d..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_pic.h
+++ /dev/null
diff --cc arch/ppc/platforms/pmac_setup.c
index 0000000,55d2bef,55d2bef,55d2bef,55d2bef,55d2bef,55d2bef,55d2bef,55d2bef,55d2bef,55d2bef,55d2bef..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_setup.c
+++ /dev/null
diff --cc arch/ppc/platforms/pmac_sleep.S
index 0000000,22b113d,22b113d,22b113d,22b113d,22b113d,22b113d,22b113d,22b113d,22b113d,22b113d,22b113d..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_sleep.S
+++ /dev/null
diff --cc arch/ppc/platforms/pmac_smp.c
index 0000000,26ff262,26ff262,26ff262,26ff262,26ff262,26ff262,26ff262,26ff262,26ff262,26ff262,26ff262..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_smp.c
+++ /dev/null
diff --cc arch/ppc/platforms/pmac_time.c
index 0000000,edb9fcc,edb9fcc,edb9fcc,edb9fcc,edb9fcc,edb9fcc,edb9fcc,edb9fcc,edb9fcc,edb9fcc,edb9fcc..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/platforms/pmac_time.c
+++ /dev/null
diff --cc arch/ppc/syslib/ipic.c
index 0000000,8f01e0f,8f01e0f,8f01e0f,8f01e0f,8f01e0f,8f01e0f,8f01e0f,8f01e0f,8f01e0f,8f01e0f,8f01e0f..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/syslib/ipic.c
+++ /dev/null
diff --cc arch/ppc/syslib/ipic.h
index 0000000,a7ce7da,a7ce7da,a7ce7da,a7ce7da,a7ce7da,a7ce7da,a7ce7da,a7ce7da,a7ce7da,a7ce7da,a7ce7da..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/ppc/syslib/ipic.h
+++ /dev/null
diff --cc arch/s390/Kconfig
index b66602a,6fe532d,477ac27,477ac27,477ac27,477ac27,477ac27,477ac27,6fe532d,477ac27,6fe532d,6fe532d..b66602a
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@@@@@@@@@@@@ -27,6 -27,11 -27,11 -27,11 -27,11 -27,11 -27,11 -27,11 -27,11 -27,11 -27,11 -27,11 +27,6 @@@@@@@@@@@@@ config S39
bool
default y
-----------config UID16
----------- bool
----------- default y
- - -- depends on !64BIT
------ - depends on ARCH_S390X = 'n'
-----------
source "init/Kconfig"
menu "Base setup"
diff --cc arch/s390/crypto/aes_s390.c
index c5ca2dc,7a1033d,0000000,0000000,0000000,0000000,0000000,0000000,7a1033d,0000000,7a1033d,7a1033d..c5ca2dc
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/s390/crypto/aes_s390.c
+++ b/arch/s390/crypto/aes_s390.c
@@@@@@@@@@@@@ -1,276 -1,248 -1,0 -1,0 -1,0 -1,0 -1,0 -1,0 -1,248 -1,0 -1,248 -1,248 +1,276 @@@@@@@@@@@@@
++++++ + /*
++++++ + * Cryptographic API.
++++++ + *
++++++ + * s390 implementation of the AES Cipher Algorithm.
++++++ + *
++++++ + * s390 Version:
++++++ + * Copyright (C) 2005 IBM Deutschland GmbH, IBM Corporation
++++++ + * Author(s): Jan Glauber (jang@de.ibm.com)
++++++ + *
++++++ + * Derived from "crypto/aes.c"
++++++ + *
++++++ + * This program is free software; you can redistribute it and/or modify it
++++++ + * under the terms of the GNU General Public License as published by the Free
++++++ + * Software Foundation; either version 2 of the License, or (at your option)
++++++ + * any later version.
++++++ + *
++++++ + */
++++++ +
++++++ + #include <linux/module.h>
++++++ + #include <linux/init.h>
++++++ + #include <linux/crypto.h>
++++++ + #include "crypt_s390.h"
++++++ +
++++++ + #define AES_MIN_KEY_SIZE 16
++++++ + #define AES_MAX_KEY_SIZE 32
++++++ +
++++++ + /* data block size for all key lengths */
++++++ + #define AES_BLOCK_SIZE 16
++++++ +
++++++ + int has_aes_128 = 0;
++++++ + int has_aes_192 = 0;
++++++ + int has_aes_256 = 0;
++++++ +
++++++ + struct s390_aes_ctx {
++++++ + u8 iv[AES_BLOCK_SIZE];
++++++ + u8 key[AES_MAX_KEY_SIZE];
++++++ + int key_len;
++++++ + };
++++++ +
++++++ + static int aes_set_key(void *ctx, const u8 *in_key, unsigned int key_len,
++++++ + u32 *flags)
++++++ + {
++++++ + struct s390_aes_ctx *sctx = ctx;
++++++ +
++++++ + switch (key_len) {
++++++ + case 16:
++++++ + if (!has_aes_128)
++++++ + goto fail;
++++++ + break;
++++++ + case 24:
++++++ + if (!has_aes_192)
++++++ + goto fail;
++++++ +
++++++ + break;
++++++ + case 32:
++++++ + if (!has_aes_256)
++++++ + goto fail;
++++++ + break;
++++++ + default:
++++++ + /* invalid key length */
++++++ + goto fail;
++++++ + break;
++++++ + }
++++++ +
++++++ + sctx->key_len = key_len;
++++++ + memcpy(sctx->key, in_key, key_len);
++++++ + return 0;
++++++ + fail:
++++++ + *flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
++++++ + return -EINVAL;
++++++ + }
++++++ +
++++++ + static void aes_encrypt(void *ctx, u8 *out, const u8 *in)
++++++ + {
++++++ + const struct s390_aes_ctx *sctx = ctx;
++++++ +
++++++ + switch (sctx->key_len) {
++++++ + case 16:
++++++ + crypt_s390_km(KM_AES_128_ENCRYPT, &sctx->key, out, in,
++++++ + AES_BLOCK_SIZE);
++++++ + break;
++++++ + case 24:
++++++ + crypt_s390_km(KM_AES_192_ENCRYPT, &sctx->key, out, in,
++++++ + AES_BLOCK_SIZE);
++++++ + break;
++++++ + case 32:
++++++ + crypt_s390_km(KM_AES_256_ENCRYPT, &sctx->key, out, in,
++++++ + AES_BLOCK_SIZE);
++++++ + break;
++++++ + }
++++++ + }
++++++ +
++++++ + static void aes_decrypt(void *ctx, u8 *out, const u8 *in)
++++++ + {
++++++ + const struct s390_aes_ctx *sctx = ctx;
++++++ +
++++++ + switch (sctx->key_len) {
++++++ + case 16:
++++++ + crypt_s390_km(KM_AES_128_DECRYPT, &sctx->key, out, in,
++++++ + AES_BLOCK_SIZE);
++++++ + break;
++++++ + case 24:
++++++ + crypt_s390_km(KM_AES_192_DECRYPT, &sctx->key, out, in,
++++++ + AES_BLOCK_SIZE);
++++++ + break;
++++++ + case 32:
++++++ + crypt_s390_km(KM_AES_256_DECRYPT, &sctx->key, out, in,
++++++ + AES_BLOCK_SIZE);
++++++ + break;
++++++ + }
++++++ + }
++++++ +
++++++ + static unsigned int aes_encrypt_ecb(const struct cipher_desc *desc, u8 *out,
++++++ + const u8 *in, unsigned int nbytes)
++++++ + {
++++++ + struct s390_aes_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(AES_BLOCK_SIZE - 1);
++++++ +
++++++ + switch (sctx->key_len) {
++++++ + case 16:
- - -- crypt_s390_km(KM_AES_128_ENCRYPT, &sctx->key, out, in, nbytes);
+++++++++++ ret = crypt_s390_km(KM_AES_128_ENCRYPT, &sctx->key, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ + break;
++++++ + case 24:
- - -- crypt_s390_km(KM_AES_192_ENCRYPT, &sctx->key, out, in, nbytes);
+++++++++++ ret = crypt_s390_km(KM_AES_192_ENCRYPT, &sctx->key, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ + break;
++++++ + case 32:
- - -- crypt_s390_km(KM_AES_256_ENCRYPT, &sctx->key, out, in, nbytes);
+++++++++++ ret = crypt_s390_km(KM_AES_256_ENCRYPT, &sctx->key, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ + break;
++++++ + }
- - -- return nbytes & ~(AES_BLOCK_SIZE - 1);
+++++++++++ return nbytes;
++++++ + }
++++++ +
++++++ + static unsigned int aes_decrypt_ecb(const struct cipher_desc *desc, u8 *out,
++++++ + const u8 *in, unsigned int nbytes)
++++++ + {
++++++ + struct s390_aes_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(AES_BLOCK_SIZE - 1);
++++++ +
++++++ + switch (sctx->key_len) {
++++++ + case 16:
- - -- crypt_s390_km(KM_AES_128_DECRYPT, &sctx->key, out, in, nbytes);
+++++++++++ ret = crypt_s390_km(KM_AES_128_DECRYPT, &sctx->key, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ + break;
++++++ + case 24:
- - -- crypt_s390_km(KM_AES_192_DECRYPT, &sctx->key, out, in, nbytes);
+++++++++++ ret = crypt_s390_km(KM_AES_192_DECRYPT, &sctx->key, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ + break;
++++++ + case 32:
- - -- crypt_s390_km(KM_AES_256_DECRYPT, &sctx->key, out, in, nbytes);
+++++++++++ ret = crypt_s390_km(KM_AES_256_DECRYPT, &sctx->key, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ + break;
++++++ + }
- - -- return nbytes & ~(AES_BLOCK_SIZE - 1);
+++++++++++ return nbytes;
++++++ + }
++++++ +
++++++ + static unsigned int aes_encrypt_cbc(const struct cipher_desc *desc, u8 *out,
++++++ + const u8 *in, unsigned int nbytes)
++++++ + {
++++++ + struct s390_aes_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(AES_BLOCK_SIZE - 1);
++++++ +
++++++ + memcpy(&sctx->iv, desc->info, AES_BLOCK_SIZE);
++++++ + switch (sctx->key_len) {
++++++ + case 16:
- - -- crypt_s390_kmc(KMC_AES_128_ENCRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ ret = crypt_s390_kmc(KMC_AES_128_ENCRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ + break;
++++++ + case 24:
- - -- crypt_s390_kmc(KMC_AES_192_ENCRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ ret = crypt_s390_kmc(KMC_AES_192_ENCRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ + break;
++++++ + case 32:
- - -- crypt_s390_kmc(KMC_AES_256_ENCRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ ret = crypt_s390_kmc(KMC_AES_256_ENCRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ + break;
++++++ + }
++++++ + memcpy(desc->info, &sctx->iv, AES_BLOCK_SIZE);
++++++ +
- - -- return nbytes & ~(AES_BLOCK_SIZE - 1);
+++++++++++ return nbytes;
++++++ + }
++++++ +
++++++ + static unsigned int aes_decrypt_cbc(const struct cipher_desc *desc, u8 *out,
++++++ + const u8 *in, unsigned int nbytes)
++++++ + {
++++++ + struct s390_aes_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(AES_BLOCK_SIZE - 1);
++++++ +
++++++ + memcpy(&sctx->iv, desc->info, AES_BLOCK_SIZE);
++++++ + switch (sctx->key_len) {
++++++ + case 16:
- - -- crypt_s390_kmc(KMC_AES_128_DECRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ ret = crypt_s390_kmc(KMC_AES_128_DECRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ + break;
++++++ + case 24:
- - -- crypt_s390_kmc(KMC_AES_192_DECRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ ret = crypt_s390_kmc(KMC_AES_192_DECRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ + break;
++++++ + case 32:
- - -- crypt_s390_kmc(KMC_AES_256_DECRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ ret = crypt_s390_kmc(KMC_AES_256_DECRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ + break;
++++++ + }
- - -- return nbytes & ~(AES_BLOCK_SIZE - 1);
+++++++++++ return nbytes;
++++++ + }
++++++ +
++++++ +
++++++ + static struct crypto_alg aes_alg = {
++++++ + .cra_name = "aes",
++++++ + .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
++++++ + .cra_blocksize = AES_BLOCK_SIZE,
++++++ + .cra_ctxsize = sizeof(struct s390_aes_ctx),
++++++ + .cra_module = THIS_MODULE,
++++++ + .cra_list = LIST_HEAD_INIT(aes_alg.cra_list),
++++++ + .cra_u = {
++++++ + .cipher = {
++++++ + .cia_min_keysize = AES_MIN_KEY_SIZE,
++++++ + .cia_max_keysize = AES_MAX_KEY_SIZE,
++++++ + .cia_setkey = aes_set_key,
++++++ + .cia_encrypt = aes_encrypt,
++++++ + .cia_decrypt = aes_decrypt,
++++++ + .cia_encrypt_ecb = aes_encrypt_ecb,
++++++ + .cia_decrypt_ecb = aes_decrypt_ecb,
++++++ + .cia_encrypt_cbc = aes_encrypt_cbc,
++++++ + .cia_decrypt_cbc = aes_decrypt_cbc,
++++++ + }
++++++ + }
++++++ + };
++++++ +
++++++ + static int __init aes_init(void)
++++++ + {
++++++ + int ret;
++++++ +
++++++ + if (crypt_s390_func_available(KM_AES_128_ENCRYPT))
++++++ + has_aes_128 = 1;
++++++ + if (crypt_s390_func_available(KM_AES_192_ENCRYPT))
++++++ + has_aes_192 = 1;
++++++ + if (crypt_s390_func_available(KM_AES_256_ENCRYPT))
++++++ + has_aes_256 = 1;
++++++ +
++++++ + if (!has_aes_128 && !has_aes_192 && !has_aes_256)
++++++ + return -ENOSYS;
++++++ +
++++++ + ret = crypto_register_alg(&aes_alg);
++++++ + if (ret != 0)
++++++ + printk(KERN_INFO "crypt_s390: aes_s390 couldn't be loaded.\n");
++++++ + return ret;
++++++ + }
++++++ +
++++++ + static void __exit aes_fini(void)
++++++ + {
++++++ + crypto_unregister_alg(&aes_alg);
++++++ + }
++++++ +
++++++ + module_init(aes_init);
++++++ + module_exit(aes_fini);
++++++ +
++++++ + MODULE_ALIAS("aes");
++++++ +
++++++ + MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm");
++++++ + MODULE_LICENSE("GPL");
++++++ +
diff --cc arch/s390/crypto/crypt_s390.h
index d1c259a,d1c259a,0000000,0000000,0000000,0000000,0000000,0000000,d1c259a,0000000,d1c259a,d1c259a..d1c259a
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/s390/crypto/crypt_s390.h
+++ b/arch/s390/crypto/crypt_s390.h
diff --cc arch/s390/crypto/crypt_s390_query.c
index def02bd,def02bd,0000000,0000000,0000000,0000000,0000000,0000000,def02bd,0000000,def02bd,def02bd..def02bd
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/s390/crypto/crypt_s390_query.c
+++ b/arch/s390/crypto/crypt_s390_query.c
diff --cc arch/s390/crypto/crypt_z990.h
index 0000000,0000000,4df660b,4df660b,4df660b,4df660b,4df660b,4df660b,0000000,4df660b,0000000,0000000..0000000
deleted file mode 000000,000000,100644,100644,100644,100644,100644,100644,000000,100644,000000,000000
--- a/arch/s390/crypto/crypt_z990.h
+++ /dev/null
diff --cc arch/s390/crypto/crypt_z990_query.c
index 0000000,0000000,7133983,7133983,7133983,7133983,7133983,7133983,0000000,7133983,0000000,0000000..0000000
deleted file mode 000000,000000,100644,100644,100644,100644,100644,100644,000000,100644,000000,000000
--- a/arch/s390/crypto/crypt_z990_query.c
+++ /dev/null
diff --cc arch/s390/crypto/des_s390.c
index e3c37aa,a38bb2a,0000000,0000000,0000000,0000000,0000000,0000000,a38bb2a,0000000,a38bb2a,a38bb2a..e3c37aa
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/s390/crypto/des_s390.c
+++ b/arch/s390/crypto/des_s390.c
@@@@@@@@@@@@@ -1,466 -1,284 -1,0 -1,0 -1,0 -1,0 -1,0 -1,0 -1,284 -1,0 -1,284 -1,284 +1,466 @@@@@@@@@@@@@
++++++ + /*
++++++ + * Cryptographic API.
++++++ + *
++++++ + * s390 implementation of the DES Cipher Algorithm.
++++++ + *
++++++ + * Copyright (c) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
++++++ + * Author(s): Thomas Spatzier (tspat@de.ibm.com)
++++++ + *
++++++ + *
++++++ + * This program is free software; you can redistribute it and/or modify
++++++ + * it under the terms of the GNU General Public License as published by
++++++ + * the Free Software Foundation; either version 2 of the License, or
++++++ + * (at your option) any later version.
++++++ + *
++++++ + */
++++++ + #include <linux/init.h>
++++++ + #include <linux/module.h>
- - --#include <linux/mm.h>
- - --#include <linux/errno.h>
- - --#include <asm/scatterlist.h>
++++++ + #include <linux/crypto.h>
+++++++++++
++++++ + #include "crypt_s390.h"
++++++ + #include "crypto_des.h"
++++++ +
++++++ + #define DES_BLOCK_SIZE 8
++++++ + #define DES_KEY_SIZE 8
++++++ +
++++++ + #define DES3_128_KEY_SIZE (2 * DES_KEY_SIZE)
++++++ + #define DES3_128_BLOCK_SIZE DES_BLOCK_SIZE
++++++ +
++++++ + #define DES3_192_KEY_SIZE (3 * DES_KEY_SIZE)
++++++ + #define DES3_192_BLOCK_SIZE DES_BLOCK_SIZE
++++++ +
++++++ + struct crypt_s390_des_ctx {
++++++ + u8 iv[DES_BLOCK_SIZE];
++++++ + u8 key[DES_KEY_SIZE];
++++++ + };
++++++ +
++++++ + struct crypt_s390_des3_128_ctx {
++++++ + u8 iv[DES_BLOCK_SIZE];
++++++ + u8 key[DES3_128_KEY_SIZE];
++++++ + };
++++++ +
++++++ + struct crypt_s390_des3_192_ctx {
++++++ + u8 iv[DES_BLOCK_SIZE];
++++++ + u8 key[DES3_192_KEY_SIZE];
++++++ + };
++++++ +
- - --static int
- - --des_setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags)
+++++++++++static int des_setkey(void *ctx, const u8 *key, unsigned int keylen,
+++++++++++ u32 *flags)
++++++ + {
- - -- struct crypt_s390_des_ctx *dctx;
+++++++++++ struct crypt_s390_des_ctx *dctx = ctx;
++++++ + int ret;
++++++ +
- - -- dctx = ctx;
- - -- //test if key is valid (not a weak key)
+++++++++++ /* test if key is valid (not a weak key) */
++++++ + ret = crypto_des_check_key(key, keylen, flags);
- - -- if (ret == 0){
+++++++++++ if (ret == 0)
++++++ + memcpy(dctx->key, key, keylen);
- - -- }
++++++ + return ret;
++++++ + }
++++++ +
+++++++++++static void des_encrypt(void *ctx, u8 *out, const u8 *in)
+++++++++++{
+++++++++++ struct crypt_s390_des_ctx *dctx = ctx;
+++++++++++
+++++++++++ crypt_s390_km(KM_DEA_ENCRYPT, dctx->key, out, in, DES_BLOCK_SIZE);
+++++++++++}
+++++++++++
+++++++++++static void des_decrypt(void *ctx, u8 *out, const u8 *in)
+++++++++++{
+++++++++++ struct crypt_s390_des_ctx *dctx = ctx;
+++++++++++
+++++++++++ crypt_s390_km(KM_DEA_DECRYPT, dctx->key, out, in, DES_BLOCK_SIZE);
+++++++++++}
+++++++++++
+++++++++++static unsigned int des_encrypt_ecb(const struct cipher_desc *desc, u8 *out,
+++++++++++ const u8 *in, unsigned int nbytes)
+++++++++++{
+++++++++++ struct crypt_s390_des_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(DES_BLOCK_SIZE - 1);
+++++++++++ ret = crypt_s390_km(KM_DEA_ENCRYPT, sctx->key, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
+++++++++++
+++++++++++ return nbytes;
+++++++++++}
++++++ +
- - --static void
- - --des_encrypt(void *ctx, u8 *dst, const u8 *src)
+++++++++++static unsigned int des_decrypt_ecb(const struct cipher_desc *desc, u8 *out,
+++++++++++ const u8 *in, unsigned int nbytes)
++++++ + {
- - -- struct crypt_s390_des_ctx *dctx;
+++++++++++ struct crypt_s390_des_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(DES_BLOCK_SIZE - 1);
+++++++++++ ret = crypt_s390_km(KM_DEA_DECRYPT, sctx->key, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
++++++ +
- - -- dctx = ctx;
- - -- crypt_s390_km(KM_DEA_ENCRYPT, dctx->key, dst, src, DES_BLOCK_SIZE);
+++++++++++ return nbytes;
++++++ + }
++++++ +
- - --static void
- - --des_decrypt(void *ctx, u8 *dst, const u8 *src)
+++++++++++static unsigned int des_encrypt_cbc(const struct cipher_desc *desc, u8 *out,
+++++++++++ const u8 *in, unsigned int nbytes)
++++++ + {
- - -- struct crypt_s390_des_ctx *dctx;
+++++++++++ struct crypt_s390_des_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
++++++ +
- - -- dctx = ctx;
- - -- crypt_s390_km(KM_DEA_DECRYPT, dctx->key, dst, src, DES_BLOCK_SIZE);
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(DES_BLOCK_SIZE - 1);
+++++++++++
+++++++++++ memcpy(sctx->iv, desc->info, DES_BLOCK_SIZE);
+++++++++++ ret = crypt_s390_kmc(KMC_DEA_ENCRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
+++++++++++
+++++++++++ memcpy(desc->info, sctx->iv, DES_BLOCK_SIZE);
+++++++++++ return nbytes;
+++++++++++}
+++++++++++
+++++++++++static unsigned int des_decrypt_cbc(const struct cipher_desc *desc, u8 *out,
+++++++++++ const u8 *in, unsigned int nbytes)
+++++++++++{
+++++++++++ struct crypt_s390_des_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(DES_BLOCK_SIZE - 1);
+++++++++++
+++++++++++ memcpy(&sctx->iv, desc->info, DES_BLOCK_SIZE);
+++++++++++ ret = crypt_s390_kmc(KMC_DEA_DECRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
+++++++++++
+++++++++++ return nbytes;
++++++ + }
++++++ +
++++++ + static struct crypto_alg des_alg = {
++++++ + .cra_name = "des",
++++++ + .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
++++++ + .cra_blocksize = DES_BLOCK_SIZE,
++++++ + .cra_ctxsize = sizeof(struct crypt_s390_des_ctx),
++++++ + .cra_module = THIS_MODULE,
++++++ + .cra_list = LIST_HEAD_INIT(des_alg.cra_list),
- - -- .cra_u = { .cipher = {
- - -- .cia_min_keysize = DES_KEY_SIZE,
- - -- .cia_max_keysize = DES_KEY_SIZE,
- - -- .cia_setkey = des_setkey,
- - -- .cia_encrypt = des_encrypt,
- - -- .cia_decrypt = des_decrypt } }
+++++++++++ .cra_u = {
+++++++++++ .cipher = {
+++++++++++ .cia_min_keysize = DES_KEY_SIZE,
+++++++++++ .cia_max_keysize = DES_KEY_SIZE,
+++++++++++ .cia_setkey = des_setkey,
+++++++++++ .cia_encrypt = des_encrypt,
+++++++++++ .cia_decrypt = des_decrypt,
+++++++++++ .cia_encrypt_ecb = des_encrypt_ecb,
+++++++++++ .cia_decrypt_ecb = des_decrypt_ecb,
+++++++++++ .cia_encrypt_cbc = des_encrypt_cbc,
+++++++++++ .cia_decrypt_cbc = des_decrypt_cbc,
+++++++++++ }
+++++++++++ }
++++++ + };
++++++ +
++++++ + /*
++++++ + * RFC2451:
++++++ + *
++++++ + * For DES-EDE3, there is no known need to reject weak or
++++++ + * complementation keys. Any weakness is obviated by the use of
++++++ + * multiple keys.
++++++ + *
++++++ + * However, if the two independent 64-bit keys are equal,
++++++ + * then the DES3 operation is simply the same as DES.
++++++ + * Implementers MUST reject keys that exhibit this property.
++++++ + *
++++++ + */
- - --static int
- - --des3_128_setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags)
+++++++++++static int des3_128_setkey(void *ctx, const u8 *key, unsigned int keylen,
+++++++++++ u32 *flags)
++++++ + {
++++++ + int i, ret;
- - -- struct crypt_s390_des3_128_ctx *dctx;
+++++++++++ struct crypt_s390_des3_128_ctx *dctx = ctx;
++++++ + const u8* temp_key = key;
++++++ +
- - -- dctx = ctx;
++++++ + if (!(memcmp(key, &key[DES_KEY_SIZE], DES_KEY_SIZE))) {
- - --
++++++ + *flags |= CRYPTO_TFM_RES_BAD_KEY_SCHED;
++++++ + return -EINVAL;
++++++ + }
- - -- for (i = 0; i < 2; i++, temp_key += DES_KEY_SIZE) {
+++++++++++ for (i = 0; i < 2; i++, temp_key += DES_KEY_SIZE) {
++++++ + ret = crypto_des_check_key(temp_key, DES_KEY_SIZE, flags);
++++++ + if (ret < 0)
++++++ + return ret;
++++++ + }
++++++ + memcpy(dctx->key, key, keylen);
++++++ + return 0;
++++++ + }
++++++ +
- - --static void
- - --des3_128_encrypt(void *ctx, u8 *dst, const u8 *src)
+++++++++++static void des3_128_encrypt(void *ctx, u8 *dst, const u8 *src)
++++++ + {
- - -- struct crypt_s390_des3_128_ctx *dctx;
+++++++++++ struct crypt_s390_des3_128_ctx *dctx = ctx;
++++++ +
- - -- dctx = ctx;
++++++ + crypt_s390_km(KM_TDEA_128_ENCRYPT, dctx->key, dst, (void*)src,
- - -- DES3_128_BLOCK_SIZE);
+++++++++++ DES3_128_BLOCK_SIZE);
++++++ + }
++++++ +
- - --static void
- - --des3_128_decrypt(void *ctx, u8 *dst, const u8 *src)
+++++++++++static void des3_128_decrypt(void *ctx, u8 *dst, const u8 *src)
++++++ + {
- - -- struct crypt_s390_des3_128_ctx *dctx;
+++++++++++ struct crypt_s390_des3_128_ctx *dctx = ctx;
++++++ +
- - -- dctx = ctx;
++++++ + crypt_s390_km(KM_TDEA_128_DECRYPT, dctx->key, dst, (void*)src,
- - -- DES3_128_BLOCK_SIZE);
+++++++++++ DES3_128_BLOCK_SIZE);
+++++++++++}
+++++++++++
+++++++++++static unsigned int des3_128_encrypt_ecb(const struct cipher_desc *desc,
+++++++++++ u8 *out, const u8 *in,
+++++++++++ unsigned int nbytes)
+++++++++++{
+++++++++++ struct crypt_s390_des3_128_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(DES3_128_BLOCK_SIZE - 1);
+++++++++++ ret = crypt_s390_km(KM_TDEA_128_ENCRYPT, sctx->key, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
+++++++++++
+++++++++++ return nbytes;
+++++++++++}
+++++++++++
+++++++++++static unsigned int des3_128_decrypt_ecb(const struct cipher_desc *desc,
+++++++++++ u8 *out, const u8 *in,
+++++++++++ unsigned int nbytes)
+++++++++++{
+++++++++++ struct crypt_s390_des3_128_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(DES3_128_BLOCK_SIZE - 1);
+++++++++++ ret = crypt_s390_km(KM_TDEA_128_DECRYPT, sctx->key, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
+++++++++++
+++++++++++ return nbytes;
+++++++++++}
+++++++++++
+++++++++++static unsigned int des3_128_encrypt_cbc(const struct cipher_desc *desc,
+++++++++++ u8 *out, const u8 *in,
+++++++++++ unsigned int nbytes)
+++++++++++{
+++++++++++ struct crypt_s390_des3_128_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(DES3_128_BLOCK_SIZE - 1);
+++++++++++
+++++++++++ memcpy(sctx->iv, desc->info, DES3_128_BLOCK_SIZE);
+++++++++++ ret = crypt_s390_kmc(KMC_TDEA_128_ENCRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
+++++++++++
+++++++++++ memcpy(desc->info, sctx->iv, DES3_128_BLOCK_SIZE);
+++++++++++ return nbytes;
+++++++++++}
+++++++++++
+++++++++++static unsigned int des3_128_decrypt_cbc(const struct cipher_desc *desc,
+++++++++++ u8 *out, const u8 *in,
+++++++++++ unsigned int nbytes)
+++++++++++{
+++++++++++ struct crypt_s390_des3_128_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(DES3_128_BLOCK_SIZE - 1);
+++++++++++
+++++++++++ memcpy(&sctx->iv, desc->info, DES3_128_BLOCK_SIZE);
+++++++++++ ret = crypt_s390_kmc(KMC_TDEA_128_DECRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
+++++++++++
+++++++++++ return nbytes;
++++++ + }
++++++ +
++++++ + static struct crypto_alg des3_128_alg = {
++++++ + .cra_name = "des3_ede128",
++++++ + .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
++++++ + .cra_blocksize = DES3_128_BLOCK_SIZE,
++++++ + .cra_ctxsize = sizeof(struct crypt_s390_des3_128_ctx),
++++++ + .cra_module = THIS_MODULE,
++++++ + .cra_list = LIST_HEAD_INIT(des3_128_alg.cra_list),
- - -- .cra_u = { .cipher = {
- - -- .cia_min_keysize = DES3_128_KEY_SIZE,
- - -- .cia_max_keysize = DES3_128_KEY_SIZE,
- - -- .cia_setkey = des3_128_setkey,
- - -- .cia_encrypt = des3_128_encrypt,
- - -- .cia_decrypt = des3_128_decrypt } }
+++++++++++ .cra_u = {
+++++++++++ .cipher = {
+++++++++++ .cia_min_keysize = DES3_128_KEY_SIZE,
+++++++++++ .cia_max_keysize = DES3_128_KEY_SIZE,
+++++++++++ .cia_setkey = des3_128_setkey,
+++++++++++ .cia_encrypt = des3_128_encrypt,
+++++++++++ .cia_decrypt = des3_128_decrypt,
+++++++++++ .cia_encrypt_ecb = des3_128_encrypt_ecb,
+++++++++++ .cia_decrypt_ecb = des3_128_decrypt_ecb,
+++++++++++ .cia_encrypt_cbc = des3_128_encrypt_cbc,
+++++++++++ .cia_decrypt_cbc = des3_128_decrypt_cbc,
+++++++++++ }
+++++++++++ }
++++++ + };
++++++ +
++++++ + /*
++++++ + * RFC2451:
++++++ + *
++++++ + * For DES-EDE3, there is no known need to reject weak or
++++++ + * complementation keys. Any weakness is obviated by the use of
++++++ + * multiple keys.
++++++ + *
++++++ + * However, if the first two or last two independent 64-bit keys are
++++++ + * equal (k1 == k2 or k2 == k3), then the DES3 operation is simply the
++++++ + * same as DES. Implementers MUST reject keys that exhibit this
++++++ + * property.
++++++ + *
++++++ + */
- - --static int
- - --des3_192_setkey(void *ctx, const u8 *key, unsigned int keylen, u32 *flags)
+++++++++++static int des3_192_setkey(void *ctx, const u8 *key, unsigned int keylen,
+++++++++++ u32 *flags)
++++++ + {
++++++ + int i, ret;
- - -- struct crypt_s390_des3_192_ctx *dctx;
- - -- const u8* temp_key;
+++++++++++ struct crypt_s390_des3_192_ctx *dctx = ctx;
+++++++++++ const u8* temp_key = key;
++++++ +
- - -- dctx = ctx;
- - -- temp_key = key;
++++++ + if (!(memcmp(key, &key[DES_KEY_SIZE], DES_KEY_SIZE) &&
++++++ + memcmp(&key[DES_KEY_SIZE], &key[DES_KEY_SIZE * 2],
- - -- DES_KEY_SIZE))) {
+++++++++++ DES_KEY_SIZE))) {
++++++ +
++++++ + *flags |= CRYPTO_TFM_RES_BAD_KEY_SCHED;
++++++ + return -EINVAL;
++++++ + }
++++++ + for (i = 0; i < 3; i++, temp_key += DES_KEY_SIZE) {
++++++ + ret = crypto_des_check_key(temp_key, DES_KEY_SIZE, flags);
- - -- if (ret < 0){
+++++++++++ if (ret < 0)
++++++ + return ret;
- - -- }
++++++ + }
++++++ + memcpy(dctx->key, key, keylen);
++++++ + return 0;
++++++ + }
++++++ +
- - --static void
- - --des3_192_encrypt(void *ctx, u8 *dst, const u8 *src)
+++++++++++static void des3_192_encrypt(void *ctx, u8 *dst, const u8 *src)
++++++ + {
- - -- struct crypt_s390_des3_192_ctx *dctx;
+++++++++++ struct crypt_s390_des3_192_ctx *dctx = ctx;
++++++ +
- - -- dctx = ctx;
++++++ + crypt_s390_km(KM_TDEA_192_ENCRYPT, dctx->key, dst, (void*)src,
- - -- DES3_192_BLOCK_SIZE);
+++++++++++ DES3_192_BLOCK_SIZE);
++++++ + }
++++++ +
- - --static void
- - --des3_192_decrypt(void *ctx, u8 *dst, const u8 *src)
+++++++++++static void des3_192_decrypt(void *ctx, u8 *dst, const u8 *src)
++++++ + {
- - -- struct crypt_s390_des3_192_ctx *dctx;
+++++++++++ struct crypt_s390_des3_192_ctx *dctx = ctx;
++++++ +
- - -- dctx = ctx;
++++++ + crypt_s390_km(KM_TDEA_192_DECRYPT, dctx->key, dst, (void*)src,
- - -- DES3_192_BLOCK_SIZE);
+++++++++++ DES3_192_BLOCK_SIZE);
+++++++++++}
+++++++++++
+++++++++++static unsigned int des3_192_encrypt_ecb(const struct cipher_desc *desc,
+++++++++++ u8 *out, const u8 *in,
+++++++++++ unsigned int nbytes)
+++++++++++{
+++++++++++ struct crypt_s390_des3_192_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(DES3_192_BLOCK_SIZE - 1);
+++++++++++ ret = crypt_s390_km(KM_TDEA_192_ENCRYPT, sctx->key, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
+++++++++++
+++++++++++ return nbytes;
+++++++++++}
+++++++++++
+++++++++++static unsigned int des3_192_decrypt_ecb(const struct cipher_desc *desc,
+++++++++++ u8 *out, const u8 *in,
+++++++++++ unsigned int nbytes)
+++++++++++{
+++++++++++ struct crypt_s390_des3_192_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(DES3_192_BLOCK_SIZE - 1);
+++++++++++ ret = crypt_s390_km(KM_TDEA_192_DECRYPT, sctx->key, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
+++++++++++
+++++++++++ return nbytes;
+++++++++++}
+++++++++++
+++++++++++static unsigned int des3_192_encrypt_cbc(const struct cipher_desc *desc,
+++++++++++ u8 *out, const u8 *in,
+++++++++++ unsigned int nbytes)
+++++++++++{
+++++++++++ struct crypt_s390_des3_192_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(DES3_192_BLOCK_SIZE - 1);
+++++++++++
+++++++++++ memcpy(sctx->iv, desc->info, DES3_192_BLOCK_SIZE);
+++++++++++ ret = crypt_s390_kmc(KMC_TDEA_192_ENCRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
+++++++++++
+++++++++++ memcpy(desc->info, sctx->iv, DES3_192_BLOCK_SIZE);
+++++++++++ return nbytes;
+++++++++++}
+++++++++++
+++++++++++static unsigned int des3_192_decrypt_cbc(const struct cipher_desc *desc,
+++++++++++ u8 *out, const u8 *in,
+++++++++++ unsigned int nbytes)
+++++++++++{
+++++++++++ struct crypt_s390_des3_192_ctx *sctx = crypto_tfm_ctx(desc->tfm);
+++++++++++ int ret;
+++++++++++
+++++++++++ /* only use complete blocks */
+++++++++++ nbytes &= ~(DES3_192_BLOCK_SIZE - 1);
+++++++++++
+++++++++++ memcpy(&sctx->iv, desc->info, DES3_192_BLOCK_SIZE);
+++++++++++ ret = crypt_s390_kmc(KMC_TDEA_192_DECRYPT, &sctx->iv, out, in, nbytes);
+++++++++++ BUG_ON((ret < 0) || (ret != nbytes));
+++++++++++
+++++++++++ return nbytes;
++++++ + }
++++++ +
++++++ + static struct crypto_alg des3_192_alg = {
++++++ + .cra_name = "des3_ede",
++++++ + .cra_flags = CRYPTO_ALG_TYPE_CIPHER,
++++++ + .cra_blocksize = DES3_192_BLOCK_SIZE,
++++++ + .cra_ctxsize = sizeof(struct crypt_s390_des3_192_ctx),
++++++ + .cra_module = THIS_MODULE,
++++++ + .cra_list = LIST_HEAD_INIT(des3_192_alg.cra_list),
- - -- .cra_u = { .cipher = {
- - -- .cia_min_keysize = DES3_192_KEY_SIZE,
- - -- .cia_max_keysize = DES3_192_KEY_SIZE,
- - -- .cia_setkey = des3_192_setkey,
- - -- .cia_encrypt = des3_192_encrypt,
- - -- .cia_decrypt = des3_192_decrypt } }
+++++++++++ .cra_u = {
+++++++++++ .cipher = {
+++++++++++ .cia_min_keysize = DES3_192_KEY_SIZE,
+++++++++++ .cia_max_keysize = DES3_192_KEY_SIZE,
+++++++++++ .cia_setkey = des3_192_setkey,
+++++++++++ .cia_encrypt = des3_192_encrypt,
+++++++++++ .cia_decrypt = des3_192_decrypt,
+++++++++++ .cia_encrypt_ecb = des3_192_encrypt_ecb,
+++++++++++ .cia_decrypt_ecb = des3_192_decrypt_ecb,
+++++++++++ .cia_encrypt_cbc = des3_192_encrypt_cbc,
+++++++++++ .cia_decrypt_cbc = des3_192_decrypt_cbc,
+++++++++++ }
+++++++++++ }
++++++ + };
++++++ +
- - --
- - --
- - --static int
- - --init(void)
+++++++++++static int init(void)
++++++ + {
- - -- int ret;
+++++++++++ int ret = 0;
++++++ +
++++++ + if (!crypt_s390_func_available(KM_DEA_ENCRYPT) ||
++++++ + !crypt_s390_func_available(KM_TDEA_128_ENCRYPT) ||
- - -- !crypt_s390_func_available(KM_TDEA_192_ENCRYPT)){
+++++++++++ !crypt_s390_func_available(KM_TDEA_192_ENCRYPT))
++++++ + return -ENOSYS;
- - -- }
++++++ +
- - -- ret = 0;
- - -- ret |= (crypto_register_alg(&des_alg) == 0)? 0:1;
- - -- ret |= (crypto_register_alg(&des3_128_alg) == 0)? 0:2;
- - -- ret |= (crypto_register_alg(&des3_192_alg) == 0)? 0:4;
- - -- if (ret){
+++++++++++ ret |= (crypto_register_alg(&des_alg) == 0) ? 0:1;
+++++++++++ ret |= (crypto_register_alg(&des3_128_alg) == 0) ? 0:2;
+++++++++++ ret |= (crypto_register_alg(&des3_192_alg) == 0) ? 0:4;
+++++++++++ if (ret) {
++++++ + crypto_unregister_alg(&des3_192_alg);
++++++ + crypto_unregister_alg(&des3_128_alg);
++++++ + crypto_unregister_alg(&des_alg);
++++++ + return -EEXIST;
++++++ + }
- - --
- - -- printk(KERN_INFO "crypt_s390: des_s390 loaded.\n");
++++++ + return 0;
++++++ + }
++++++ +
- - --static void __exit
- - --fini(void)
+++++++++++static void __exit fini(void)
++++++ + {
++++++ + crypto_unregister_alg(&des3_192_alg);
++++++ + crypto_unregister_alg(&des3_128_alg);
++++++ + crypto_unregister_alg(&des_alg);
++++++ + }
++++++ +
++++++ + module_init(init);
++++++ + module_exit(fini);
++++++ +
++++++ + MODULE_ALIAS("des");
++++++ + MODULE_ALIAS("des3_ede");
++++++ +
++++++ + MODULE_LICENSE("GPL");
++++++ + MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms");
diff --cc arch/s390/crypto/des_z990.c
index 0000000,0000000,813cf37,813cf37,813cf37,813cf37,813cf37,813cf37,0000000,813cf37,0000000,0000000..0000000
deleted file mode 000000,000000,100644,100644,100644,100644,100644,100644,000000,100644,000000,000000
--- a/arch/s390/crypto/des_z990.c
+++ /dev/null
diff --cc arch/s390/crypto/sha1_s390.c
index 98c896b,98c896b,0000000,0000000,0000000,0000000,0000000,0000000,98c896b,0000000,98c896b,98c896b..98c896b
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/s390/crypto/sha1_s390.c
+++ b/arch/s390/crypto/sha1_s390.c
diff --cc arch/s390/crypto/sha1_z990.c
index 0000000,0000000,298174d,298174d,298174d,298174d,298174d,298174d,0000000,298174d,0000000,0000000..0000000
deleted file mode 000000,000000,100644,100644,100644,100644,100644,100644,000000,100644,000000,000000
--- a/arch/s390/crypto/sha1_z990.c
+++ /dev/null
diff --cc arch/s390/crypto/sha256_s390.c
index 1ec5e92,b75bdbd,0000000,0000000,0000000,0000000,0000000,0000000,b75bdbd,0000000,b75bdbd,b75bdbd..1ec5e92
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/s390/crypto/sha256_s390.c
+++ b/arch/s390/crypto/sha256_s390.c
@@@@@@@@@@@@@ -1,166 -1,151 -1,0 -1,0 -1,0 -1,0 -1,0 -1,0 -1,151 -1,0 -1,151 -1,151 +1,166 @@@@@@@@@@@@@
++++++ + /*
++++++ + * Cryptographic API.
++++++ + *
++++++ + * s390 implementation of the SHA256 Secure Hash Algorithm.
++++++ + *
++++++ + * s390 Version:
++++++ + * Copyright (C) 2005 IBM Deutschland GmbH, IBM Corporation
++++++ + * Author(s): Jan Glauber (jang@de.ibm.com)
++++++ + *
++++++ + * Derived from "crypto/sha256.c"
++++++ + * and "arch/s390/crypto/sha1_s390.c"
++++++ + *
++++++ + * This program is free software; you can redistribute it and/or modify it
++++++ + * under the terms of the GNU General Public License as published by the Free
++++++ + * Software Foundation; either version 2 of the License, or (at your option)
++++++ + * any later version.
++++++ + *
++++++ + */
++++++ + #include <linux/init.h>
++++++ + #include <linux/module.h>
++++++ + #include <linux/crypto.h>
++++++ +
++++++ + #include "crypt_s390.h"
++++++ +
++++++ + #define SHA256_DIGEST_SIZE 32
++++++ + #define SHA256_BLOCK_SIZE 64
++++++ +
++++++ + struct s390_sha256_ctx {
++++++ + u64 count;
++++++ + u32 state[8];
++++++ + u8 buf[2 * SHA256_BLOCK_SIZE];
++++++ + };
++++++ +
++++++ + static void sha256_init(void *ctx)
++++++ + {
++++++ + struct s390_sha256_ctx *sctx = ctx;
++++++ +
++++++ + sctx->state[0] = 0x6a09e667;
++++++ + sctx->state[1] = 0xbb67ae85;
++++++ + sctx->state[2] = 0x3c6ef372;
++++++ + sctx->state[3] = 0xa54ff53a;
++++++ + sctx->state[4] = 0x510e527f;
++++++ + sctx->state[5] = 0x9b05688c;
++++++ + sctx->state[6] = 0x1f83d9ab;
++++++ + sctx->state[7] = 0x5be0cd19;
++++++ + sctx->count = 0;
++++++ + memset(sctx->buf, 0, sizeof(sctx->buf));
++++++ + }
++++++ +
++++++ + static void sha256_update(void *ctx, const u8 *data, unsigned int len)
++++++ + {
++++++ + struct s390_sha256_ctx *sctx = ctx;
++++++ + unsigned int index;
+++++++++++ int ret;
++++++ +
++++++ + /* how much is already in the buffer? */
++++++ + index = sctx->count / 8 & 0x3f;
++++++ +
++++++ + /* update message bit length */
++++++ + sctx->count += len * 8;
++++++ +
- - -- /* process one block */
- - -- if ((index + len) >= SHA256_BLOCK_SIZE) {
+++++++++++ if ((index + len) < SHA256_BLOCK_SIZE)
+++++++++++ goto store;
+++++++++++
+++++++++++ /* process one stored block */
+++++++++++ if (index) {
++++++ + memcpy(sctx->buf + index, data, SHA256_BLOCK_SIZE - index);
- - -- crypt_s390_kimd(KIMD_SHA_256, sctx->state, sctx->buf,
- - -- SHA256_BLOCK_SIZE);
+++++++++++ ret = crypt_s390_kimd(KIMD_SHA_256, sctx->state, sctx->buf,
+++++++++++ SHA256_BLOCK_SIZE);
+++++++++++ BUG_ON(ret != SHA256_BLOCK_SIZE);
++++++ + data += SHA256_BLOCK_SIZE - index;
++++++ + len -= SHA256_BLOCK_SIZE - index;
++++++ + }
++++++ +
+++++++++++ /* process as many blocks as possible */
+++++++++++ if (len >= SHA256_BLOCK_SIZE) {
+++++++++++ ret = crypt_s390_kimd(KIMD_SHA_256, sctx->state, data,
+++++++++++ len & ~(SHA256_BLOCK_SIZE - 1));
+++++++++++ BUG_ON(ret != (len & ~(SHA256_BLOCK_SIZE - 1)));
+++++++++++ data += ret;
+++++++++++ len -= ret;
+++++++++++ }
+++++++++++
+++++++++++store:
++++++ + /* anything left? */
++++++ + if (len)
++++++ + memcpy(sctx->buf + index , data, len);
++++++ + }
++++++ +
++++++ + static void pad_message(struct s390_sha256_ctx* sctx)
++++++ + {
++++++ + int index, end;
++++++ +
++++++ + index = sctx->count / 8 & 0x3f;
++++++ + end = index < 56 ? SHA256_BLOCK_SIZE : 2 * SHA256_BLOCK_SIZE;
++++++ +
++++++ + /* start pad with 1 */
++++++ + sctx->buf[index] = 0x80;
++++++ +
++++++ + /* pad with zeros */
++++++ + index++;
++++++ + memset(sctx->buf + index, 0x00, end - index - 8);
++++++ +
++++++ + /* append message length */
++++++ + memcpy(sctx->buf + end - 8, &sctx->count, sizeof sctx->count);
++++++ +
++++++ + sctx->count = end * 8;
++++++ + }
++++++ +
++++++ + /* Add padding and return the message digest */
++++++ + static void sha256_final(void* ctx, u8 *out)
++++++ + {
++++++ + struct s390_sha256_ctx *sctx = ctx;
++++++ +
++++++ + /* must perform manual padding */
++++++ + pad_message(sctx);
++++++ +
++++++ + crypt_s390_kimd(KIMD_SHA_256, sctx->state, sctx->buf,
++++++ + sctx->count / 8);
++++++ +
++++++ + /* copy digest to out */
++++++ + memcpy(out, sctx->state, SHA256_DIGEST_SIZE);
++++++ +
++++++ + /* wipe context */
++++++ + memset(sctx, 0, sizeof *sctx);
++++++ + }
++++++ +
++++++ + static struct crypto_alg alg = {
++++++ + .cra_name = "sha256",
++++++ + .cra_flags = CRYPTO_ALG_TYPE_DIGEST,
++++++ + .cra_blocksize = SHA256_BLOCK_SIZE,
++++++ + .cra_ctxsize = sizeof(struct s390_sha256_ctx),
++++++ + .cra_module = THIS_MODULE,
++++++ + .cra_list = LIST_HEAD_INIT(alg.cra_list),
++++++ + .cra_u = { .digest = {
++++++ + .dia_digestsize = SHA256_DIGEST_SIZE,
- - -- .dia_init = sha256_init,
- - -- .dia_update = sha256_update,
- - -- .dia_final = sha256_final } }
+++++++++++ .dia_init = sha256_init,
+++++++++++ .dia_update = sha256_update,
+++++++++++ .dia_final = sha256_final } }
++++++ + };
++++++ +
++++++ + static int init(void)
++++++ + {
++++++ + int ret;
++++++ +
++++++ + if (!crypt_s390_func_available(KIMD_SHA_256))
++++++ + return -ENOSYS;
++++++ +
++++++ + ret = crypto_register_alg(&alg);
++++++ + if (ret != 0)
++++++ + printk(KERN_INFO "crypt_s390: sha256_s390 couldn't be loaded.");
++++++ + return ret;
++++++ + }
++++++ +
++++++ + static void __exit fini(void)
++++++ + {
++++++ + crypto_unregister_alg(&alg);
++++++ + }
++++++ +
++++++ + module_init(init);
++++++ + module_exit(fini);
++++++ +
++++++ + MODULE_ALIAS("sha256");
++++++ +
++++++ + MODULE_LICENSE("GPL");
++++++ + MODULE_DESCRIPTION("SHA256 Secure Hash Algorithm");
diff --cc arch/s390/kernel/Makefile
index 9269b57,4865e4b,7434c32,7434c32,7434c32,7434c32,7434c32,7434c32,4865e4b,7434c32,4865e4b,4865e4b..9269b57
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@@@@@@@@@@@@ -16,10 -16,11 -13,14 -13,14 -13,14 -13,14 -13,14 -13,14 -16,11 -13,14 -16,11 -16,11 +16,10 @@@@@@@@@@@@@ extra-y += head.o init_task.o vmlinu
obj-$(CONFIG_MODULES) += s390_ksyms.o module.o
obj-$(CONFIG_SMP) += smp.o
------ - obj-$(CONFIG_S390_SUPPORT) += compat_linux.o compat_signal.o \
------ - compat_ioctl.o compat_wrapper.o \
------ - compat_exec_domain.o
++++++ + obj-$(CONFIG_COMPAT) += compat_linux.o compat_signal.o \
- - -- compat_ioctl.o compat_wrapper.o \
- - -- compat_exec_domain.o
+++++++++++ compat_wrapper.o compat_exec_domain.o
obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o
------ - obj-$(CONFIG_ARCH_S390_31) += entry.o reipl.o
------ - obj-$(CONFIG_ARCH_S390X) += entry64.o reipl64.o
------ -
obj-$(CONFIG_VIRT_TIMER) += vtime.o
# Kexec part
diff --cc arch/s390/kernel/compat_ioctl.c
index 0000000,6504c4e,6504c4e,6504c4e,6504c4e,6504c4e,6504c4e,6504c4e,6504c4e,6504c4e,6504c4e,6504c4e..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/s390/kernel/compat_ioctl.c
+++ /dev/null
diff --cc arch/s390/lib/Makefile
index f20b51f,d9b97b3,b701efa,b701efa,b701efa,b701efa,b701efa,b701efa,d9b97b3,b701efa,d9b97b3,d9b97b3..f20b51f
--- a/arch/s390/lib/Makefile
+++ b/arch/s390/lib/Makefile
@@@@@@@@@@@@@ -4,6 -4,5 -4,6 -4,6 -4,6 -4,6 -4,6 -4,6 -4,5 -4,6 -4,5 -4,5 +4,6 @@@@@@@@@@@@@
EXTRA_AFLAGS := -traditional
- - --lib-y += delay.o string.o spinlock.o
+ + ++lib-y += delay.o string.o
------ - lib-$(CONFIG_ARCH_S390_31) += uaccess.o spinlock.o
------ - lib-$(CONFIG_ARCH_S390X) += uaccess64.o spinlock.o
++++++ + lib-y += $(if $(CONFIG_64BIT),uaccess64.o,uaccess.o)
+++++++++++lib-$(CONFIG_SMP) += spinlock.o
diff --cc arch/s390/oprofile/backtrace.c
index bc4b84a,bc4b84a,0000000,0000000,0000000,0000000,0000000,0000000,bc4b84a,0000000,bc4b84a,bc4b84a..bc4b84a
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/s390/oprofile/backtrace.c
+++ b/arch/s390/oprofile/backtrace.c
diff --cc arch/sh/boards/hp6xx/Makefile
index 927fe0a,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..927fe0a
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/boards/hp6xx/Makefile
+++ b/arch/sh/boards/hp6xx/Makefile
diff --cc arch/sh/boards/hp6xx/hp620/Makefile
index 0000000,20691db,20691db,20691db,20691db,20691db,20691db,20691db,20691db,20691db,20691db,20691db..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/boards/hp6xx/hp620/Makefile
+++ /dev/null
diff --cc arch/sh/boards/hp6xx/hp620/mach.c
index 0000000,0392d82,0392d82,0392d82,0392d82,0392d82,0392d82,0392d82,0392d82,0392d82,0392d82,0392d82..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/boards/hp6xx/hp620/mach.c
+++ /dev/null
diff --cc arch/sh/boards/hp6xx/hp620/setup.c
index 0000000,045fc5d,045fc5d,045fc5d,045fc5d,045fc5d,045fc5d,045fc5d,045fc5d,045fc5d,045fc5d,045fc5d..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/boards/hp6xx/hp620/setup.c
+++ /dev/null
diff --cc arch/sh/boards/hp6xx/hp680/Makefile
index 0000000,0beef11,0beef11,0beef11,0beef11,0beef11,0beef11,0beef11,0beef11,0beef11,0beef11,0beef11..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/boards/hp6xx/hp680/Makefile
+++ /dev/null
diff --cc arch/sh/boards/hp6xx/hp680/mach.c
index 0000000,d734861,d734861,d734861,d734861,d734861,d734861,d734861,d734861,d734861,d734861,d734861..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/boards/hp6xx/hp680/mach.c
+++ /dev/null
diff --cc arch/sh/boards/hp6xx/hp680/setup.c
index 0000000,4170190,4170190,4170190,4170190,4170190,4170190,4170190,4170190,4170190,4170190,4170190..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/boards/hp6xx/hp680/setup.c
+++ /dev/null
diff --cc arch/sh/boards/hp6xx/hp690/Makefile
index 0000000,fbbe95e,fbbe95e,fbbe95e,fbbe95e,fbbe95e,fbbe95e,fbbe95e,fbbe95e,fbbe95e,fbbe95e,fbbe95e..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/boards/hp6xx/hp690/Makefile
+++ /dev/null
diff --cc arch/sh/boards/hp6xx/hp690/mach.c
index 0000000,2a4c687,2a4c687,2a4c687,2a4c687,2a4c687,2a4c687,2a4c687,2a4c687,2a4c687,2a4c687,2a4c687..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/boards/hp6xx/hp690/mach.c
+++ /dev/null
diff --cc arch/sh/boards/hp6xx/mach.c
index 08dbba9,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..08dbba9
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/boards/hp6xx/mach.c
+++ b/arch/sh/boards/hp6xx/mach.c
diff --cc arch/sh/boards/hp6xx/setup.c
index 6d94a8e,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..6d94a8e
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/boards/hp6xx/setup.c
+++ b/arch/sh/boards/hp6xx/setup.c
diff --cc arch/sh/boards/overdrive/time.c
index 0000000,6853369,6853369,6853369,6853369,6853369,6853369,6853369,6853369,6853369,6853369,6853369..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/boards/overdrive/time.c
+++ /dev/null
diff --cc arch/sh/configs/hp680_defconfig
index 0000000,c85d365,c85d365,c85d365,c85d365,c85d365,c85d365,c85d365,c85d365,c85d365,c85d365,c85d365..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/configs/hp680_defconfig
+++ /dev/null
diff --cc arch/sh/configs/hp6xx_defconfig
index b36f102,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..b36f102
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/configs/hp6xx_defconfig
+++ b/arch/sh/configs/hp6xx_defconfig
diff --cc arch/sh/kernel/cpu/clock.c
index 989e7fd,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..989e7fd
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/clock.c
+++ b/arch/sh/kernel/cpu/clock.c
diff --cc arch/sh/kernel/cpu/irq/Makefile
index e3cccea,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..e3cccea
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/irq/Makefile
+++ b/arch/sh/kernel/cpu/irq/Makefile
diff --cc arch/sh/kernel/cpu/irq/imask.c
index baed9a5,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..baed9a5
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/irq/imask.c
+++ b/arch/sh/kernel/cpu/irq/imask.c
diff --cc arch/sh/kernel/cpu/irq/intc2.c
index 06e8afa,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..06e8afa
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/irq/intc2.c
+++ b/arch/sh/kernel/cpu/irq/intc2.c
diff --cc arch/sh/kernel/cpu/irq/ipr.c
index fdbd718,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..fdbd718
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/irq/ipr.c
+++ b/arch/sh/kernel/cpu/irq/ipr.c
diff --cc arch/sh/kernel/cpu/irq/pint.c
index 95d6024,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..95d6024
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/irq/pint.c
+++ b/arch/sh/kernel/cpu/irq/pint.c
diff --cc arch/sh/kernel/cpu/irq_imask.c
index 0000000,a963d00,a963d00,a963d00,a963d00,a963d00,a963d00,a963d00,a963d00,a963d00,a963d00,a963d00..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/kernel/cpu/irq_imask.c
+++ /dev/null
diff --cc arch/sh/kernel/cpu/irq_ipr.c
index 0000000,71f9209,71f9209,71f9209,71f9209,71f9209,71f9209,71f9209,71f9209,71f9209,71f9209,71f9209..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/kernel/cpu/irq_ipr.c
+++ /dev/null
diff --cc arch/sh/kernel/cpu/sh3/clock-sh3.c
index c3c9459,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..c3c9459
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh3.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh3.c
diff --cc arch/sh/kernel/cpu/sh3/clock-sh7300.c
index e804174,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..e804174
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7300.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7300.c
diff --cc arch/sh/kernel/cpu/sh3/clock-sh7705.c
index dfdbf32,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..dfdbf32
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7705.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7705.c
diff --cc arch/sh/kernel/cpu/sh3/clock-sh7709.c
index 10461a7,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..10461a7
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/sh3/clock-sh7709.c
+++ b/arch/sh/kernel/cpu/sh3/clock-sh7709.c
diff --cc arch/sh/kernel/cpu/sh4/clock-sh4-202.c
index bfdf5fe,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..bfdf5fe
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
+++ b/arch/sh/kernel/cpu/sh4/clock-sh4-202.c
diff --cc arch/sh/kernel/cpu/sh4/clock-sh4.c
index dca9f87,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..dca9f87
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/sh4/clock-sh4.c
+++ b/arch/sh/kernel/cpu/sh4/clock-sh4.c
diff --cc arch/sh/kernel/cpu/sh4/clock-sh73180.c
index 2fa5cb2,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..2fa5cb2
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/sh4/clock-sh73180.c
+++ b/arch/sh/kernel/cpu/sh4/clock-sh73180.c
diff --cc arch/sh/kernel/cpu/sh4/clock-sh7770.c
index c8694ba,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..c8694ba
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/sh4/clock-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4/clock-sh7770.c
diff --cc arch/sh/kernel/cpu/sh4/clock-sh7780.c
index 93ad367,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..93ad367
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/cpu/sh4/clock-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4/clock-sh7780.c
diff --cc arch/sh/kernel/cpu/sh4/irq_intc2.c
index 0000000,f6b16ba,f6b16ba,f6b16ba,f6b16ba,f6b16ba,f6b16ba,f6b16ba,f6b16ba,f6b16ba,f6b16ba,f6b16ba..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sh/kernel/cpu/sh4/irq_intc2.c
+++ /dev/null
diff --cc arch/sh/kernel/machine_kexec.c
index 4354652,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..4354652
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/machine_kexec.c
+++ b/arch/sh/kernel/machine_kexec.c
diff --cc arch/sh/kernel/relocate_kernel.S
index b0695cf,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..b0695cf
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/relocate_kernel.S
+++ b/arch/sh/kernel/relocate_kernel.S
diff --cc arch/sh/kernel/timers/Makefile
index 151a6a3,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..151a6a3
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/timers/Makefile
+++ b/arch/sh/kernel/timers/Makefile
diff --cc arch/sh/kernel/timers/timer-tmu.c
index 96a64cb,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..96a64cb
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/timers/timer-tmu.c
+++ b/arch/sh/kernel/timers/timer-tmu.c
diff --cc arch/sh/kernel/timers/timer.c
index dc1f631,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..dc1f631
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/kernel/timers/timer.c
+++ b/arch/sh/kernel/timers/timer.c
diff --cc arch/sh/mm/Kconfig
index fb586b1,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..fb586b1
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
diff --cc arch/sparc64/kernel/ioctl32.c
index 0000000,196b208,196b208,196b208,196b208,196b208,196b208,196b208,196b208,196b208,196b208,196b208..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/sparc64/kernel/ioctl32.c
+++ /dev/null
diff --cc arch/um/drivers/chan_kern.c
index ab0d0b1,cd13b91,5b58fad,5b58fad,5b58fad,5b58fad,5b58fad,5b58fad,cd13b91,5b58fad,cd13b91,cd13b91..ab0d0b1
--- a/arch/um/drivers/chan_kern.c
+++ b/arch/um/drivers/chan_kern.c
@@@@@@@@@@@@@ -186,6 -186,9 -186,9 -186,9 -186,9 -186,9 -186,9 -186,9 -186,9 -186,9 -186,9 -186,9 +186,6 @@@@@@@@@@@@@ static void tty_receive_char(struct tty
}
}
- - -- if((tty->flip.flag_buf_ptr == NULL) ||
------ - if((tty->flip.flag_buf_ptr == NULL) ||
----------- (tty->flip.char_buf_ptr == NULL))
----------- return;
tty_insert_flip_char(tty, ch, TTY_NORMAL);
}
@@@@@@@@@@@@@ -650,8 -653,9 -567,9 -567,9 -567,9 -567,9 -567,9 -567,9 -653,9 -567,9 -653,9 -653,9 +650,8 @@@@@@@@@@@@@ void chan_interrupt(struct list_head *c
chan = list_entry(ele, struct chan, list);
if(!chan->input || (chan->ops->read == NULL)) continue;
do {
- - -- if((tty != NULL) &&
------ - if((tty != NULL) &&
----------- (tty->flip.count >= TTY_FLIPBUF_SIZE)){
------ - schedule_work(task);
+++++++++++ if (tty && !tty_buffer_request_room(tty, 1)) {
++++++ + schedule_delayed_work(task, 1);
goto out;
}
err = chan->ops->read(chan->fd, &c, chan->data);
diff --cc arch/um/drivers/mconsole_kern.c
index e3d5765,be61012,12c9536,12c9536,12c9536,12c9536,12c9536,12c9536,be61012,12c9536,be61012,be61012..e3d5765
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@@@@@@@@@@@@ -463,82 -463,82 -463,7 -463,7 -463,7 -463,7 -463,7 -463,7 -463,82 -463,7 -463,82 -463,82 +463,82 @@@@@@@@@@@@@ out
mconsole_reply(req, err_msg, err, 0);
}
++++++ + static DEFINE_SPINLOCK(console_lock);
++++++ + static LIST_HEAD(clients);
++++++ + static char console_buf[MCONSOLE_MAX_DATA];
++++++ + static int console_index = 0;
++++++ +
++++++ + static void console_write(struct console *console, const char *string,
++++++ + unsigned len)
++++++ + {
++++++ + struct list_head *ele;
++++++ + int n;
++++++ +
++++++ + if(list_empty(&clients))
++++++ + return;
++++++ +
++++++ + while(1){
++++++ + n = min(len, ARRAY_SIZE(console_buf) - console_index);
++++++ + strncpy(&console_buf[console_index], string, n);
++++++ + console_index += n;
++++++ + string += n;
++++++ + len -= n;
++++++ + if(len == 0)
++++++ + return;
++++++ +
++++++ + list_for_each(ele, &clients){
++++++ + struct mconsole_entry *entry;
++++++ +
++++++ + entry = list_entry(ele, struct mconsole_entry, list);
++++++ + mconsole_reply_len(&entry->request, console_buf,
++++++ + console_index, 0, 1);
++++++ + }
++++++ +
++++++ + console_index = 0;
++++++ + }
++++++ + }
++++++ +
++++++ + static struct console mc_console = { .name = "mc",
++++++ + .write = console_write,
- - -- .flags = CON_PRINTBUFFER | CON_ENABLED,
+++++++++++ .flags = CON_ENABLED,
++++++ + .index = -1 };
++++++ +
++++++ + static int mc_add_console(void)
++++++ + {
++++++ + register_console(&mc_console);
++++++ + return 0;
++++++ + }
++++++ +
++++++ + late_initcall(mc_add_console);
++++++ +
++++++ + static void with_console(struct mc_request *req, void (*proc)(void *),
++++++ + void *arg)
++++++ + {
++++++ + struct mconsole_entry entry;
++++++ + unsigned long flags;
++++++ +
++++++ + INIT_LIST_HEAD(&entry.list);
++++++ + entry.request = *req;
++++++ + list_add(&entry.list, &clients);
++++++ + spin_lock_irqsave(&console_lock, flags);
++++++ +
++++++ + (*proc)(arg);
++++++ +
++++++ + mconsole_reply_len(req, console_buf, console_index, 0, 0);
++++++ + console_index = 0;
++++++ +
++++++ + spin_unlock_irqrestore(&console_lock, flags);
++++++ + list_del(&entry.list);
++++++ + }
++++++ +
#ifdef CONFIG_MAGIC_SYSRQ
++++++ + static void sysrq_proc(void *arg)
++++++ + {
++++++ + char *op = arg;
++++++ +
++++++ + handle_sysrq(*op, &current->thread.regs, NULL);
++++++ + }
++++++ +
void mconsole_sysrq(struct mc_request *req)
{
char *ptr = req->request.data;
diff --cc arch/um/include/longjmp.h
index 018b381,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..018b381
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/longjmp.h
+++ b/arch/um/include/longjmp.h
diff --cc arch/um/include/os.h
index eb1710b,c279ee6,2cccfa5,2cccfa5,2cccfa5,2cccfa5,2cccfa5,2cccfa5,c279ee6,2cccfa5,c279ee6,c279ee6..eb1710b
--- a/arch/um/include/os.h
+++ b/arch/um/include/os.h
@@@@@@@@@@@@@ -217,78 -213,10 -213,15 -213,15 -213,15 -213,15 -213,15 -213,15 -213,10 -213,15 -213,10 -213,10 +217,78 @@@@@@@@@@@@@ extern int run_helper_thread(int (*proc
int stack_order);
extern int helper_wait(int pid);
------ - #endif
++++++ + /* umid.c */
------ - /*
------ - * Overrides for Emacs so that we follow Linus's tabbing style.
------ - * Emacs will notice this stuff at the end of the file and automatically
------ - * adjust the settings for this buffer only. This must remain at the end
------ - * of the file.
------ - * ---------------------------------------------------------------------------
------ - * Local variables:
------ - * c-file-style: "linux"
------ - * End:
------ - */
++++++ + extern int umid_file_name(char *name, char *buf, int len);
++++++ + extern int set_umid(char *name);
++++++ + extern char *get_umid(void);
++++++ +
+++++++++++/* signal.c */
+++++++++++extern void set_sigstack(void *sig_stack, int size);
+++++++++++extern void remove_sigstack(void);
+++++++++++extern void set_handler(int sig, void (*handler)(int), int flags, ...);
+++++++++++extern int change_sig(int signal, int on);
+++++++++++extern void block_signals(void);
+++++++++++extern void unblock_signals(void);
+++++++++++extern int get_signals(void);
+++++++++++extern int set_signals(int enable);
+++++++++++extern void os_usr1_signal(int on);
+++++++++++
+++++++++++/* trap.c */
+++++++++++extern void os_fill_handlinfo(struct kern_handlers h);
+++++++++++extern void do_longjmp(void *p, int val);
+++++++++++
+++++++++++/* util.c */
+++++++++++extern void stack_protections(unsigned long address);
+++++++++++extern void task_protections(unsigned long address);
+++++++++++extern int raw(int fd);
+++++++++++extern void setup_machinename(char *machine_out);
+++++++++++extern void setup_hostinfo(void);
+++++++++++extern int setjmp_wrapper(void (*proc)(void *, void *), ...);
+++++++++++
+++++++++++/* time.c */
+++++++++++#define BILLION (1000 * 1000 * 1000)
+++++++++++
+++++++++++extern void switch_timers(int to_real);
+++++++++++extern void idle_sleep(int secs);
+++++++++++extern void enable_timer(void);
+++++++++++extern void disable_timer(void);
+++++++++++extern void user_time_init(void);
+++++++++++extern void uml_idle_timer(void);
+++++++++++extern unsigned long long os_nsecs(void);
+++++++++++
+++++++++++/* skas/mem.c */
+++++++++++extern long run_syscall_stub(struct mm_id * mm_idp,
+++++++++++ int syscall, unsigned long *args, long expected,
+++++++++++ void **addr, int done);
+++++++++++extern long syscall_stub_data(struct mm_id * mm_idp,
+++++++++++ unsigned long *data, int data_count,
+++++++++++ void **addr, void **stub_addr);
+++++++++++extern int map(struct mm_id * mm_idp, unsigned long virt,
+++++++++++ unsigned long len, int r, int w, int x, int phys_fd,
+++++++++++ unsigned long long offset, int done, void **data);
+++++++++++extern int unmap(struct mm_id * mm_idp, void *addr, unsigned long len,
+++++++++++ int done, void **data);
+++++++++++extern int protect(struct mm_id * mm_idp, unsigned long addr,
+++++++++++ unsigned long len, int r, int w, int x, int done,
+++++++++++ void **data);
+++++++++++
+++++++++++/* skas/process.c */
+++++++++++extern int is_skas_winch(int pid, int fd, void *data);
+++++++++++extern int start_userspace(unsigned long stub_stack);
+++++++++++extern int copy_context_skas0(unsigned long stack, int pid);
+++++++++++extern void userspace(union uml_pt_regs *regs);
+++++++++++extern void map_stub_pages(int fd, unsigned long code,
+++++++++++ unsigned long data, unsigned long stack);
+++++++++++extern void new_thread(void *stack, void **switch_buf_ptr,
+++++++++++ void **fork_buf_ptr, void (*handler)(int));
+++++++++++extern void thread_wait(void *sw, void *fb);
+++++++++++extern void switch_threads(void *me, void *next);
+++++++++++extern int start_idle_thread(void *stack, void *switch_buf_ptr,
+++++++++++ void **fork_buf_ptr);
+++++++++++extern void initial_thread_cb_skas(void (*proc)(void *),
+++++++++++ void *arg);
+++++++++++extern void halt_skas(void);
+++++++++++extern void reboot_skas(void);
+++++++++++
++++++ + #endif
diff --cc arch/um/include/signal_user.h
index 0000000,b075e54,b075e54,b075e54,b075e54,b075e54,b075e54,b075e54,b075e54,b075e54,b075e54,b075e54..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/include/signal_user.h
+++ /dev/null
diff --cc arch/um/include/skas/mm_id.h
index 48dd098,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..48dd098
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/skas/mm_id.h
+++ b/arch/um/include/skas/mm_id.h
diff --cc arch/um/include/skas/mmu-skas.h
index d8869a6,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..d8869a6
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/skas/mmu-skas.h
+++ b/arch/um/include/skas/mmu-skas.h
diff --cc arch/um/include/skas/mode-skas.h
index 260065c,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..260065c
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/skas/mode-skas.h
+++ b/arch/um/include/skas/mode-skas.h
diff --cc arch/um/include/skas/mode_kern_skas.h
index 63c5873,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..63c5873
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/skas/mode_kern_skas.h
+++ b/arch/um/include/skas/mode_kern_skas.h
diff --cc arch/um/include/skas/proc_mm.h
index 9028092,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..9028092
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/skas/proc_mm.h
+++ b/arch/um/include/skas/proc_mm.h
diff --cc arch/um/include/skas/skas.h
index 8635728,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..8635728
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/skas/skas.h
+++ b/arch/um/include/skas/skas.h
diff --cc arch/um/include/skas/stub-data.h
index f6ed92c,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..f6ed92c
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/skas/stub-data.h
+++ b/arch/um/include/skas/stub-data.h
diff --cc arch/um/include/skas/uaccess-skas.h
index 224a75f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..224a75f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/skas/uaccess-skas.h
+++ b/arch/um/include/skas/uaccess-skas.h
diff --cc arch/um/include/sysdep-i386/kernel-offsets.h
index 82f96c5,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..82f96c5
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/sysdep-i386/kernel-offsets.h
+++ b/arch/um/include/sysdep-i386/kernel-offsets.h
diff --cc arch/um/include/sysdep-x86_64/kernel-offsets.h
index 5ce93ab,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..5ce93ab
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/sysdep-x86_64/kernel-offsets.h
+++ b/arch/um/include/sysdep-x86_64/kernel-offsets.h
diff --cc arch/um/include/time_user.h
index 0000000,17d7ef2,17d7ef2,17d7ef2,17d7ef2,17d7ef2,17d7ef2,17d7ef2,17d7ef2,17d7ef2,17d7ef2,17d7ef2..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/include/time_user.h
+++ /dev/null
diff --cc arch/um/include/tt/debug.h
index 9778fa8,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..9778fa8
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/tt/debug.h
+++ b/arch/um/include/tt/debug.h
diff --cc arch/um/include/tt/mmu-tt.h
index 572a78b,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..572a78b
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/tt/mmu-tt.h
+++ b/arch/um/include/tt/mmu-tt.h
diff --cc arch/um/include/tt/mode-tt.h
index 2823cd5,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..2823cd5
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/tt/mode-tt.h
+++ b/arch/um/include/tt/mode-tt.h
diff --cc arch/um/include/tt/mode_kern_tt.h
index efa0012,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..efa0012
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/tt/mode_kern_tt.h
+++ b/arch/um/include/tt/mode_kern_tt.h
diff --cc arch/um/include/tt/tt.h
index 8085219,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..8085219
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/tt/tt.h
+++ b/arch/um/include/tt/tt.h
diff --cc arch/um/include/tt/uaccess-tt.h
index b19645f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..b19645f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/include/tt/uaccess-tt.h
+++ b/arch/um/include/tt/uaccess-tt.h
diff --cc arch/um/include/user_util.h
index a6f1f17,b998400,bb505e0,bb505e0,bb505e0,bb505e0,bb505e0,bb505e0,b998400,bb505e0,b998400,b998400..a6f1f17
--- a/arch/um/include/user_util.h
+++ b/arch/um/include/user_util.h
@@@@@@@@@@@@@ -51,8 -60,11 -60,12 -60,12 -60,12 -60,12 -60,12 -60,12 -60,11 -60,12 -60,11 -60,11 +51,8 @@@@@@@@@@@@@ extern void input_cb(void (*proc)(void
extern int get_pty(void);
extern void *um_kmalloc(int size);
extern int switcheroo(int fd, int prot, void *from, void *to, int size);
-----------extern void setup_machinename(char *machine_out);
-----------extern void setup_hostinfo(void);
extern void do_exec(int old_pid, int new_pid);
extern void tracer_panic(char *msg, ...);
------ - extern char *get_umid(int only_if_set);
-----------extern void do_longjmp(void *p, int val);
extern int detach(int pid, int sig);
extern int attach(int pid);
extern void kill_child_dead(int pid);
diff --cc arch/um/kernel/Makefile
index 693018b,6f77005,3de9d21,3de9d21,3de9d21,3de9d21,3de9d21,3de9d21,6f77005,3de9d21,6f77005,6f77005..693018b
--- a/arch/um/kernel/Makefile
+++ b/arch/um/kernel/Makefile
@@@@@@@@@@@@@ -9,8 -9,9 -9,9 -9,9 -9,9 -9,9 -9,9 -9,9 -9,9 -9,9 -9,9 -9,9 +9,8 @@@@@@@@@@@@@ clean-files :
obj-y = config.o exec_kern.o exitcode.o \
init_task.o irq.o irq_user.o ksyms.o mem.o physmem.o \
process_kern.o ptrace.o reboot.o resource.o sigio_user.o sigio_kern.o \
----------- signal_kern.o signal_user.o smp.o syscall_kern.o sysrq.o time.o \
- - -- time_kern.o tlb.o trap_kern.o trap_user.o uaccess.o um_arch.o umid.o \
- - -- user_util.o
------ - time_kern.o tlb.o trap_kern.o trap_user.o uaccess.o um_arch.o \
------ - umid.o user_util.o
+++++++++++ signal_kern.o smp.o syscall_kern.o sysrq.o \
+++++++++++ time_kern.o tlb.o trap_kern.o uaccess.o um_arch.o umid.o
obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
obj-$(CONFIG_GPROF) += gprof_syms.o
@@@@@@@@@@@@@ -23,7 -24,7 -24,7 -24,7 -24,7 -24,7 -24,7 -24,7 -24,7 -24,7 -24,7 -24,7 +23,7 @@@@@@@@@@@@@ obj-$(CONFIG_MODE_SKAS) += skas
user-objs-$(CONFIG_TTY_LOG) += tty_log.o
- - --USER_OBJS := $(user-objs-y) config.o time.o tty_log.o user_util.o
------ - USER_OBJS := $(user-objs-y) config.o time.o tty_log.o umid.o user_util.o
+++++++++++USER_OBJS := $(user-objs-y) config.o tty_log.o
include arch/um/scripts/Makefile.rules
diff --cc arch/um/kernel/sigio_user.c
index f7b18e1,62e5cfd,48b1f64,48b1f64,48b1f64,48b1f64,48b1f64,48b1f64,62e5cfd,48b1f64,62e5cfd,62e5cfd..f7b18e1
--- a/arch/um/kernel/sigio_user.c
+++ b/arch/um/kernel/sigio_user.c
@@@@@@@@@@@@@ -355,21 -358,13 -356,13 -356,13 -356,13 -356,13 -356,13 -356,13 -358,13 -356,13 -358,13 -358,13 +355,21 @@@@@@@@@@@@@ static struct pollfd* setup_initial_pol
void write_sigio_workaround(void)
{
unsigned long stack;
+++++++++++ struct pollfd *p;
int err;
+++++++++++ int l_write_sigio_fds[2];
+++++++++++ int l_sigio_private[2];
+++++++++++ int l_write_sigio_pid;
+++++++++++ /* We call this *tons* of times - and most ones we must just fail. */
sigio_lock();
----------- if(write_sigio_pid != -1)
----------- goto out;
+++++++++++ l_write_sigio_pid = write_sigio_pid;
+++++++++++ sigio_unlock();
++++++ +
- - -- err = os_pipe(write_sigio_fds, 1, 1);
+++++++++++ if (l_write_sigio_pid != -1)
+++++++++++ return;
+ + ++
------ - err = os_pipe(write_sigio_fds, 1, 1);
+++++++++++ err = os_pipe(l_write_sigio_fds, 1, 1);
if(err < 0){
printk("write_sigio_workaround - os_pipe 1 failed, "
"err = %d\n", -err);
@@@@@@@@@@@@@ -414,26 -392,15 -390,15 -390,15 -390,15 -390,15 -390,15 -390,15 -392,15 -390,15 -392,15 -392,15 +414,26 @@@@@@@@@@@@@
return;
out_kill:
----------- os_kill_process(write_sigio_pid, 1);
+++++++++++ l_write_sigio_pid = write_sigio_pid;
++++++ + write_sigio_pid = -1;
+++++++++++ sigio_unlock();
+++++++++++ /* Going to call waitpid, avoid holding the lock. */
+++++++++++ os_kill_process(l_write_sigio_pid, 1);
+++++++++++ goto out_free;
+++++++++++
+++++++++++ out_clear:
+ + ++ write_sigio_pid = -1;
+++++++++++ out_unlock:
+++++++++++ sigio_unlock();
+++++++++++ out_free:
+++++++++++ kfree(p);
out_close2:
----------- os_close_file(sigio_private[0]);
----------- os_close_file(sigio_private[1]);
+++++++++++ os_close_file(l_sigio_private[0]);
+++++++++++ os_close_file(l_sigio_private[1]);
out_close1:
----------- os_close_file(write_sigio_fds[0]);
----------- os_close_file(write_sigio_fds[1]);
----------- sigio_unlock();
+++++++++++ os_close_file(l_write_sigio_fds[0]);
+++++++++++ os_close_file(l_write_sigio_fds[1]);
+++++++++++ return;
}
int read_sigio_fd(int fd)
diff --cc arch/um/kernel/signal_user.c
index 0000000,62f4578,62f4578,62f4578,62f4578,62f4578,62f4578,62f4578,62f4578,62f4578,62f4578,62f4578..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/signal_user.c
+++ /dev/null
diff --cc arch/um/kernel/skas/include/mm_id.h
index 0000000,48dd098,48dd098,48dd098,48dd098,48dd098,48dd098,48dd098,48dd098,48dd098,48dd098,48dd098..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/skas/include/mm_id.h
+++ /dev/null
diff --cc arch/um/kernel/skas/include/mmu-skas.h
index 0000000,44110c5,44110c5,44110c5,44110c5,44110c5,44110c5,44110c5,44110c5,44110c5,44110c5,44110c5..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/skas/include/mmu-skas.h
+++ /dev/null
diff --cc arch/um/kernel/skas/include/mode-skas.h
index 0000000,bcd26a6,bcd26a6,bcd26a6,bcd26a6,bcd26a6,bcd26a6,bcd26a6,bcd26a6,bcd26a6,bcd26a6,bcd26a6..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/skas/include/mode-skas.h
+++ /dev/null
diff --cc arch/um/kernel/skas/include/mode_kern-skas.h
index 0000000,c97a80d,c97a80d,c97a80d,c97a80d,c97a80d,c97a80d,c97a80d,c97a80d,c97a80d,c97a80d,c97a80d..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/skas/include/mode_kern-skas.h
+++ /dev/null
diff --cc arch/um/kernel/skas/include/proc_mm.h
index 0000000,cce61a6,cce61a6,cce61a6,cce61a6,cce61a6,cce61a6,cce61a6,cce61a6,cce61a6,cce61a6,cce61a6..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/skas/include/proc_mm.h
+++ /dev/null
diff --cc arch/um/kernel/skas/include/skas.h
index 0000000,daa2f85,daa2f85,daa2f85,daa2f85,daa2f85,daa2f85,daa2f85,daa2f85,daa2f85,daa2f85,daa2f85..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/skas/include/skas.h
+++ /dev/null
diff --cc arch/um/kernel/skas/include/stub-data.h
index 0000000,f6ed92c,f6ed92c,f6ed92c,f6ed92c,f6ed92c,f6ed92c,f6ed92c,f6ed92c,f6ed92c,f6ed92c,f6ed92c..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/skas/include/stub-data.h
+++ /dev/null
diff --cc arch/um/kernel/skas/include/uaccess-skas.h
index 0000000,64516c5,64516c5,f611f83,64516c5,f611f83,f611f83,f611f83,64516c5,64516c5,64516c5,64516c5..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/skas/include/uaccess-skas.h
+++ /dev/null
@@@@@@@@@@@@@ -1,0 -1,32 -1,32 -1,33 -1,32 -1,33 -1,33 -1,33 -1,32 -1,32 -1,32 -1,32 +1,0 @@@@@@@@@@@@@
-----------/*
----------- * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
----------- * Licensed under the GPL
----------- */
-----------
-----------#ifndef __SKAS_UACCESS_H
-----------#define __SKAS_UACCESS_H
-----------
-----------#include "asm/errno.h"
- --- #include "asm/fixmap.h"
-----------
-----------/* No SKAS-specific checking. */
-----------#define access_ok_skas(type, addr, size) 0
-----------
-----------extern int copy_from_user_skas(void *to, const void __user *from, int n);
-----------extern int copy_to_user_skas(void __user *to, const void *from, int n);
-----------extern int strncpy_from_user_skas(char *dst, const char __user *src, int count);
-----------extern int __clear_user_skas(void __user *mem, int len);
-----------extern int clear_user_skas(void __user *mem, int len);
-----------extern int strnlen_user_skas(const void __user *str, int len);
-----------
-----------#endif
-----------
-----------/*
----------- * Overrides for Emacs so that we follow Linus's tabbing style.
----------- * Emacs will notice this stuff at the end of the file and automatically
----------- * adjust the settings for this buffer only. This must remain at the end
----------- * of the file.
----------- * ---------------------------------------------------------------------------
----------- * Local variables:
----------- * c-file-style: "linux"
----------- * End:
----------- */
diff --cc arch/um/kernel/skas/mem_user.c
index 0000000,1d89640,1d89640,1d89640,1d89640,1d89640,1d89640,1d89640,1d89640,1d89640,1d89640,1d89640..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/skas/mem_user.c
+++ /dev/null
diff --cc arch/um/kernel/skas/trap_user.c
index 0000000,9950a67,9950a67,9950a67,9950a67,9950a67,9950a67,9950a67,9950a67,9950a67,9950a67,9950a67..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/skas/trap_user.c
+++ /dev/null
diff --cc arch/um/kernel/trap_user.c
index 0000000,e9ccd6b,e9ccd6b,e9ccd6b,e9ccd6b,e9ccd6b,e9ccd6b,e9ccd6b,e9ccd6b,e9ccd6b,e9ccd6b,e9ccd6b..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/trap_user.c
+++ /dev/null
diff --cc arch/um/kernel/tt/include/debug.h
index 0000000,7384354,7384354,7384354,7384354,7384354,7384354,7384354,7384354,7384354,7384354,7384354..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/tt/include/debug.h
+++ /dev/null
diff --cc arch/um/kernel/tt/include/mmu-tt.h
index 0000000,0440510,0440510,0440510,0440510,0440510,0440510,0440510,0440510,0440510,0440510,0440510..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/tt/include/mmu-tt.h
+++ /dev/null
diff --cc arch/um/kernel/tt/include/tt.h
index 0000000,c667b67,c667b67,c667b67,c667b67,c667b67,c667b67,c667b67,c667b67,c667b67,c667b67,c667b67..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/tt/include/tt.h
+++ /dev/null
diff --cc arch/um/kernel/tt/include/uaccess-tt.h
index 0000000,b9bfe9c,b9bfe9c,b9bfe9c,b9bfe9c,b9bfe9c,b9bfe9c,b9bfe9c,b9bfe9c,b9bfe9c,b9bfe9c,b9bfe9c..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/tt/include/uaccess-tt.h
+++ /dev/null
diff --cc arch/um/kernel/user_util.c
index 0000000,4c23116,4c23116,4c23116,4c23116,4c23116,4c23116,4c23116,4c23116,4c23116,4c23116,4c23116..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/kernel/user_util.c
+++ /dev/null
diff --cc arch/um/os-Linux/Makefile
index 08a4e62,11e30b13,b83ac8e,b83ac8e,b83ac8e,b83ac8e,b83ac8e,b83ac8e,11e30b13,b83ac8e,11e30b13,11e30b13..08a4e62
--- a/arch/um/os-Linux/Makefile
+++ b/arch/um/os-Linux/Makefile
@@@@@@@@@@@@@ -4,13 -4,11 -4,11 -4,11 -4,11 -4,11 -4,11 -4,11 -4,11 -4,11 -4,11 -4,11 +4,13 @@@@@@@@@@@@@
#
obj-y = aio.o elf_aux.o file.o helper.o main.o mem.o process.o signal.o \
- - -- start_up.o time.o tt.o tty.o uaccess.o umid.o user_syms.o drivers/ \
------ - start_up.o time.o tt.o tty.o uaccess.o user_syms.o drivers/ \
----------- sys-$(SUBARCH)/
+++++++++++ start_up.o time.o trap.o tt.o tty.o uaccess.o umid.o user_syms.o \
+++++++++++ util.o drivers/ sys-$(SUBARCH)/
+++++++++++
+++++++++++obj-$(CONFIG_MODE_SKAS) += skas/
USER_OBJS := aio.o elf_aux.o file.o helper.o main.o mem.o process.o signal.o \
- - -- start_up.o time.o tt.o tty.o uaccess.o umid.o
------ - start_up.o time.o tt.o tty.o uaccess.o
+++++++++++ start_up.o time.o trap.o tt.o tty.o uaccess.o umid.o util.o
elf_aux.o: $(ARCH_DIR)/kernel-offsets.h
CFLAGS_elf_aux.o += -I$(objtree)/arch/um
diff --cc arch/um/os-Linux/skas/Makefile
index 5fd8d4d,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..5fd8d4d
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/os-Linux/skas/Makefile
+++ b/arch/um/os-Linux/skas/Makefile
diff --cc arch/um/os-Linux/skas/mem.c
index 9890e90,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..9890e90
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/os-Linux/skas/mem.c
+++ b/arch/um/os-Linux/skas/mem.c
diff --cc arch/um/os-Linux/skas/process.c
index 120a21c,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..120a21c
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/os-Linux/skas/process.c
+++ b/arch/um/os-Linux/skas/process.c
diff --cc arch/um/os-Linux/skas/trap.c
index 9ad5fbe,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..9ad5fbe
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/os-Linux/skas/trap.c
+++ b/arch/um/os-Linux/skas/trap.c
diff --cc arch/um/os-Linux/trap.c
index a9f6b26,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..a9f6b26
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/os-Linux/trap.c
+++ b/arch/um/os-Linux/trap.c
diff --cc arch/um/os-Linux/umid.c
index ecf107a,ecf107a,0000000,0000000,0000000,0000000,0000000,0000000,ecf107a,0000000,ecf107a,ecf107a..ecf107a
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/um/os-Linux/umid.c
+++ b/arch/um/os-Linux/umid.c
diff --cc arch/um/os-Linux/util.c
index e32065e,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..e32065e
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/um/os-Linux/util.c
+++ b/arch/um/os-Linux/util.c
diff --cc arch/um/sys-i386/kernel-offsets.c
index 0000000,35db850,35db850,35db850,35db850,35db850,35db850,35db850,35db850,35db850,35db850,35db850..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/sys-i386/kernel-offsets.c
+++ /dev/null
diff --cc arch/um/sys-x86_64/kernel-offsets.c
index 0000000,bfcb104,bfcb104,bfcb104,bfcb104,bfcb104,bfcb104,bfcb104,bfcb104,bfcb104,bfcb104,bfcb104..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/um/sys-x86_64/kernel-offsets.c
+++ /dev/null
diff --cc arch/x86_64/boot/.gitignore
index 495f20c,495f20c,0000000,0000000,0000000,0000000,0000000,0000000,495f20c,0000000,495f20c,495f20c..495f20c
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/x86_64/boot/.gitignore
+++ b/arch/x86_64/boot/.gitignore
diff --cc arch/x86_64/boot/compressed/miscsetup.h
index 0000000,bb16205,bb16205,bb16205,bb16205,bb16205,bb16205,bb16205,bb16205,bb16205,bb16205,bb16205..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/x86_64/boot/compressed/miscsetup.h
+++ /dev/null
diff --cc arch/x86_64/boot/tools/.gitignore
index 378eac2,378eac2,0000000,0000000,0000000,0000000,0000000,0000000,378eac2,0000000,378eac2,378eac2..378eac2
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/arch/x86_64/boot/tools/.gitignore
+++ b/arch/x86_64/boot/tools/.gitignore
diff --cc arch/x86_64/ia32/ia32_binfmt.c
index 572b3b2,2b760d0,2b760d0,830feb2,2b760d0,830feb2,830feb2,830feb2,2b760d0,2b760d0,2b760d0,2b760d0..572b3b2
--- a/arch/x86_64/ia32/ia32_binfmt.c
+++ b/arch/x86_64/ia32/ia32_binfmt.c
@@@@@@@@@@@@@ -216,7 -217,7 -217,7 -217,8 -217,7 -217,8 -217,8 -217,8 -217,7 -217,7 -217,7 -217,7 +216,7 @@@@@@@@@@@@@ elf_core_copy_task_fpregs(struct task_s
if (!tsk_used_math(tsk))
return 0;
if (!regs)
-- - ---- regs = ((struct pt_regs *)tsk->thread.rsp0) - 1;
- --- regs = (struct pt_regs *)tsk->thread.rsp0;
- --- --regs;
+++++++++++ regs = task_pt_regs(tsk);
if (tsk == current)
unlazy_fpu(tsk);
set_fs(KERNEL_DS);
diff --cc arch/x86_64/ia32/ia32_ioctl.c
index 0000000,e335bd0,e335bd0,e335bd0,e335bd0,e335bd0,e335bd0,e335bd0,e335bd0,e335bd0,e335bd0,e335bd0..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/x86_64/ia32/ia32_ioctl.c
+++ /dev/null
diff --cc arch/x86_64/ia32/mmap32.c
index 079f413,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..079f413
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/x86_64/ia32/mmap32.c
+++ b/arch/x86_64/ia32/mmap32.c
diff --cc arch/x86_64/kernel/acpi/processor.c
index 0000000,0000000,0000000,0000000,0000000,0000000,3bdc2ba,0000000,0000000,0000000,0000000,0000000..3bdc2ba
mode 000000,000000,000000,000000,000000,000000,100644,000000,000000,000000,000000,000000..100644
--- a/arch/x86_64/kernel/acpi/processor.c
+++ b/arch/x86_64/kernel/acpi/processor.c
diff --cc arch/x86_64/kernel/crash_dump.c
index 942deac,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..942deac
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/x86_64/kernel/crash_dump.c
+++ b/arch/x86_64/kernel/crash_dump.c
diff --cc arch/x86_64/kernel/pci-swiotlb.c
index 3569a25,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..3569a25
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/x86_64/kernel/pci-swiotlb.c
+++ b/arch/x86_64/kernel/pci-swiotlb.c
diff --cc arch/x86_64/kernel/setup.c
index 28895c0,64c4534,750e01d,750e01d,750e01d,750e01d,750e01d,750e01d,64c4534,750e01d,64c4534,64c4534..28895c0
--- a/arch/x86_64/kernel/setup.c
+++ b/arch/x86_64/kernel/setup.c
@@@@@@@@@@@@@ -43,9 -42,7 -42,6 -42,6 -42,6 -42,6 -42,6 -42,6 -42,7 -42,6 -42,7 -42,7 +43,9 @@@@@@@@@@@@@
#include <linux/edd.h>
#include <linux/mmzone.h>
#include <linux/kexec.h>
++++++ + #include <linux/cpufreq.h>
+++++++++++#include <linux/dmi.h>
+++++++++++#include <linux/dma-mapping.h>
#include <asm/mtrr.h>
#include <asm/uaccess.h>
diff --cc arch/x86_64/kernel/vsmp.c
index 92f70c7,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..92f70c7
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/x86_64/kernel/vsmp.c
+++ b/arch/x86_64/kernel/vsmp.c
diff --cc arch/x86_64/mm/ioremap.c
index ae20706,ae20706,0d260e4,ecf7acb,ae20706,ecf7acb,ecf7acb,ecf7acb,ae20706,ae20706,ae20706,ae20706..ae20706
--- a/arch/x86_64/mm/ioremap.c
+++ b/arch/x86_64/mm/ioremap.c
@@@@@@@@@@@@@ -263,31 -263,31 -263,31 -257,12 -263,31 -257,12 -257,12 -257,12 -263,31 -263,31 -263,31 -263,31 +263,31 @@@@@@@@@@@@@ void iounmap(volatile void __iomem *add
addr < phys_to_virt(ISA_END_ADDRESS))
return;
- addr = (volatile void *)(PAGE_MASK & (unsigned long __force)addr);
- --- write_lock(&vmlist_lock);
- --- p = __remove_vm_area((void *)((unsigned long)addr & PAGE_MASK));
- --- if (!p)
++ +++ addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long __force)addr);
+ +++ /* Use the vm area unlocked, assuming the caller
+ +++ ensures there isn't another iounmap for the same address
+ +++ in parallel. Reuse of the virtual address is prevented by
+ +++ leaving it in the global lists until we're done with it.
+ +++ cpa takes care of the direct mappings. */
+ +++ read_lock(&vmlist_lock);
+ +++ for (p = vmlist; p; p = p->next) {
+ +++ if (p->addr == addr)
+ +++ break;
+ +++ }
+ +++ read_unlock(&vmlist_lock);
+ +++
+ +++ if (!p) {
printk("iounmap: bad address %p\n", addr);
- --- else if (p->flags >> 20)
+ +++ dump_stack();
+ +++ return;
+ +++ }
+ +++
+ +++ /* Reset the direct mapping. Can block */
+ +++ if (p->flags >> 20)
ioremap_change_attr(p->phys_addr, p->size, 0);
- --- write_unlock(&vmlist_lock);
+ +++
+ +++ /* Finally remove it */
+ +++ o = remove_vm_area((void *)addr);
+ +++ BUG_ON(p != o || o == NULL);
kfree(p);
}
diff --cc arch/x86_64/mm/mmap.c
index 43e9b99,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..43e9b99
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/arch/x86_64/mm/mmap.c
+++ b/arch/x86_64/mm/mmap.c
diff --cc arch/x86_64/pci/Makefile-BUS
index 0000000,4f0c05a,4f0c05a,4f0c05a,4f0c05a,4f0c05a,4f0c05a,4f0c05a,4f0c05a,4f0c05a,4f0c05a,4f0c05a..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/arch/x86_64/pci/Makefile-BUS
+++ /dev/null
diff --cc arch/x86_64/pci/mmconfig.c
index f16c0d5,f16c0d5,9c4f907,a0838c4,f16c0d5,a0838c4,a0838c4,a0838c4,f16c0d5,f16c0d5,f16c0d5,f16c0d5..f16c0d5
--- a/arch/x86_64/pci/mmconfig.c
+++ b/arch/x86_64/pci/mmconfig.c
@@@@@@@@@@@@@ -22,7 -22,7 -22,7 -19,7 -22,7 -19,7 -19,7 -19,7 -22,7 -22,7 -22,7 -22,7 +22,7 @@@@@@@@@@@@@ struct mmcfg_virt
};
static struct mmcfg_virt *pci_mmcfg_virt;
- static char *get_virt(unsigned int seg, unsigned bus)
- --- static char *get_virt(unsigned int seg, int bus)
++ +++ static char __iomem *get_virt(unsigned int seg, unsigned bus)
{
int cfg_num = -1;
struct acpi_table_mcfg_config *cfg;
@@@@@@@@@@@@@ -43,23 -43,23 -43,23 -41,17 -43,23 -41,17 -41,17 -41,17 -43,23 -43,23 -43,23 -43,23 +43,23 @@@@@@@@@@@@@
}
}
- static char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
- --- static inline char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
++ +++ static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
{
- char *addr;
- ---
- --- return get_virt(seg, bus) + ((bus << 20) | (devfn << 12));
++ +++ char __iomem *addr;
+ +++ if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), &fallback_slots))
+ +++ return NULL;
+ +++ addr = get_virt(seg, bus);
+ +++ if (!addr)
+ +++ return NULL;
+ +++ return addr + ((bus << 20) | (devfn << 12));
}
static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
unsigned int devfn, int reg, int len, u32 *value)
{
- char *addr;
- --- char *addr = pci_dev_base(seg, bus, devfn);
++ +++ char __iomem *addr;
+ +++ /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
if (unlikely(!value || (bus > 255) || (devfn > 255) || (reg > 4095)))
return -EINVAL;
@@@@@@@@@@@@@ -85,9 -85,9 -85,9 -73,8 -85,9 -73,8 -73,8 -73,8 -85,9 -85,9 -85,9 -85,9 +85,9 @@@@@@@@@@@@@
static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
unsigned int devfn, int reg, int len, u32 value)
{
- char *addr;
- --- char *addr = pci_dev_base(seg, bus, devfn);
++ +++ char __iomem *addr;
+ +++ /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
return -EINVAL;
@@@@@@@@@@@@@ -115,30 -115,30 -115,30 -98,6 -115,30 -98,6 -98,6 -98,6 -115,30 -115,30 -115,30 -115,30 +115,30 @@@@@@@@@@@@@ static struct pci_raw_ops pci_mmcfg =
.write = pci_mmcfg_write,
};
+ +++ /* K8 systems have some devices (typically in the builtin northbridge)
+ +++ that are only accessible using type1
+ +++ Normally this can be expressed in the MCFG by not listing them
+ +++ and assigning suitable _SEGs, but this isn't implemented in some BIOS.
+ +++ Instead try to discover all devices on bus 0 that are unreachable using MM
+ +++ and fallback for them.
+ +++ We only do this for bus 0/seg 0 */
+ +++ static __init void unreachable_devices(void)
+ +++ {
+ +++ int i;
+ +++ for (i = 0; i < 32; i++) {
+ +++ u32 val1;
- char *addr;
++ +++ char __iomem *addr;
+ +++
+ +++ pci_conf1_read(0, 0, PCI_DEVFN(i,0), 0, 4, &val1);
+ +++ if (val1 == 0xffffffff)
+ +++ continue;
+ +++ addr = pci_dev_base(0, 0, PCI_DEVFN(i, 0));
+ +++ if (addr == NULL|| readl(addr) != val1) {
+ +++ set_bit(i, &fallback_slots);
+ +++ }
+ +++ }
+ +++ }
+ +++
static int __init pci_mmcfg_init(void)
{
int i;
diff --cc block/elevator.c
index c9f424d,39dcccc,6c3fc8a,6c3fc8a,6c3fc8a,6c3fc8a,6c3fc8a,6c3fc8a,39dcccc,6c3fc8a,39dcccc,39dcccc..c9f424d
--- a/block/elevator.c
+++ b/block/elevator.c
@@@@@@@@@@@@@ -617,24 -611,24 -593,10 -593,10 -593,10 -593,10 -593,10 -593,10 -611,24 -593,10 -611,24 -611,24 +617,24 @@@@@@@@@@@@@ void elv_completed_request(request_queu
* request is released from the driver, io must be done
*/
if (blk_account_rq(rq)) {
- - -- struct request *first_rq = list_entry_rq(q->queue_head.next);
- - --
q->in_flight--;
+ + ++ if (blk_sorted_rq(rq) && e->ops->elevator_completed_req_fn)
+ + ++ e->ops->elevator_completed_req_fn(q, rq);
+ + ++ }
++++++ +
- - -- /*
- - -- * Check if the queue is waiting for fs requests to be
- - -- * drained for flush sequence.
- - -- */
- - -- if (q->ordseq && q->in_flight == 0 &&
+++++++++++ /*
+++++++++++ * Check if the queue is waiting for fs requests to be
+++++++++++ * drained for flush sequence.
+++++++++++ */
+++++++++++ if (unlikely(q->ordseq)) {
+++++++++++ struct request *first_rq = list_entry_rq(q->queue_head.next);
+++++++++++ if (q->in_flight == 0 &&
++++++ + blk_ordered_cur_seq(q) == QUEUE_ORDSEQ_DRAIN &&
++++++ + blk_ordered_req_seq(first_rq) > QUEUE_ORDSEQ_DRAIN) {
++++++ + blk_ordered_complete_seq(q, QUEUE_ORDSEQ_DRAIN, 0);
++++++ + q->request_fn(q);
++++++ + }
- - --
- - -- if (blk_sorted_rq(rq) && e->ops->elevator_completed_req_fn)
- - -- e->ops->elevator_completed_req_fn(q, rq);
++++++ + }
}
int elv_register_queue(struct request_queue *q)
diff --cc block/genhd.c
index db57546,f1ed83f,f04609d,f04609d,f04609d,f04609d,f04609d,f04609d,f1ed83f,f04609d,f1ed83f,f1ed83f..db57546
--- a/block/genhd.c
+++ b/block/genhd.c
@@@@@@@@@@@@@ -38,100 -38,34 -38,34 -38,34 -38,34 -38,34 -38,34 -38,34 -38,34 -38,34 -38,34 -38,34 +38,100 @@@@@@@@@@@@@ static inline int major_to_index(int ma
return major % MAX_PROBE_HASH;
}
-----------#ifdef CONFIG_PROC_FS
-----------/* get block device names in somewhat random order */
-----------int get_blkdev_list(char *p, int used)
+++++++++++struct blkdev_info {
+++++++++++ int index;
+++++++++++ struct blk_major_name *bd;
+++++++++++};
+++++++++++
+++++++++++/*
+++++++++++ * iterate over a list of blkdev_info structures. allows
+++++++++++ * the major_names array to be iterated over from outside this file
+++++++++++ * must be called with the block_subsys_sem held
+++++++++++ */
+++++++++++void *get_next_blkdev(void *dev)
+++++++++++{
+++++++++++ struct blkdev_info *info;
+++++++++++
+++++++++++ if (dev == NULL) {
+++++++++++ info = kmalloc(sizeof(*info), GFP_KERNEL);
+++++++++++ if (!info)
+++++++++++ goto out;
+++++++++++ info->index=0;
+++++++++++ info->bd = major_names[info->index];
+++++++++++ if (info->bd)
+++++++++++ goto out;
+++++++++++ } else {
+++++++++++ info = dev;
+++++++++++ }
+++++++++++
+++++++++++ while (info->index < ARRAY_SIZE(major_names)) {
+++++++++++ if (info->bd)
+++++++++++ info->bd = info->bd->next;
+++++++++++ if (info->bd)
+++++++++++ goto out;
+++++++++++ /*
+++++++++++ * No devices on this chain, move to the next
+++++++++++ */
+++++++++++ info->index++;
+++++++++++ info->bd = (info->index < ARRAY_SIZE(major_names)) ?
+++++++++++ major_names[info->index] : NULL;
+++++++++++ if (info->bd)
+++++++++++ goto out;
+++++++++++ }
+++++++++++
+++++++++++out:
+++++++++++ return info;
+++++++++++}
+++++++++++
+++++++++++void *acquire_blkdev_list(void)
+++++++++++{
+++++++++++ down(&block_subsys_sem);
+++++++++++ return get_next_blkdev(NULL);
+++++++++++}
+++++++++++
+++++++++++void release_blkdev_list(void *dev)
+++++++++++{
+++++++++++ up(&block_subsys_sem);
+++++++++++ kfree(dev);
+++++++++++}
+++++++++++
+++++++++++
+++++++++++/*
+++++++++++ * Count the number of records in the blkdev_list.
+++++++++++ * must be called with the block_subsys_sem held
+++++++++++ */
+++++++++++int count_blkdev_list(void)
{
struct blk_major_name *n;
----------- int i, len;
+++++++++++ int i, count;
----------- len = snprintf(p, (PAGE_SIZE-used), "\nBlock devices:\n");
+++++++++++ count = 0;
----------- down(&block_subsys_sem);
for (i = 0; i < ARRAY_SIZE(major_names); i++) {
----------- for (n = major_names[i]; n; n = n->next) {
----------- /*
----------- * If the curent string plus the 5 extra characters
----------- * in the line would run us off the page, then we're done
----------- */
----------- if ((len + used + strlen(n->name) + 5) >= PAGE_SIZE)
----------- goto page_full;
----------- len += sprintf(p+len, "%3d %s\n",
----------- n->major, n->name);
----------- }
+++++++++++ for (n = major_names[i]; n; n = n->next)
+++++++++++ count++;
}
-----------page_full:
----------- up(&block_subsys_sem);
----------- return len;
+++++++++++ return count;
+ + ++}
------ - #endif
+++++++++++
+++++++++++/*
+++++++++++ * extract the major and name values from a blkdev_info struct
+++++++++++ * passed in as a void to *dev. Must be called with
+++++++++++ * block_subsys_sem held
+++++++++++ */
+++++++++++int get_blkdev_info(void *dev, int *major, char **name)
+++++++++++{
+++++++++++ struct blkdev_info *info = dev;
+++++++++++
+++++++++++ if (info->bd == NULL)
+++++++++++ return 1;
+++++++++++
+++++++++++ *major = info->bd->major;
+++++++++++ *name = info->bd->name;
+++++++++++ return 0;
++++++ + }
- - --#endif
+++++++++++
int register_blkdev(unsigned int major, const char *name)
{
diff --cc block/ll_rw_blk.c
index 8e27d0a,91d3b48,99c9ca6,99c9ca6,99c9ca6,99c9ca6,99c9ca6,99c9ca6,91d3b48,99c9ca6,91d3b48,91d3b48..8e27d0a
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@@@@@@@@@@@@ -2747,35 -2735,59 -2609,29 -2609,29 -2609,29 -2609,29 -2609,29 -2609,29 -2735,59 -2609,29 -2735,59 -2735,59 +2747,35 @@@@@@@@@@@@@ static inline int attempt_front_merge(r
return 0;
}
-----------/**
----------- * blk_attempt_remerge - attempt to remerge active head with next request
----------- * @q: The &request_queue_t belonging to the device
----------- * @rq: The head request (usually)
----------- *
----------- * Description:
----------- * For head-active devices, the queue can easily be unplugged so quickly
----------- * that proper merging is not done on the front request. This may hurt
----------- * performance greatly for some devices. The block layer cannot safely
----------- * do merging on that first request for these queues, but the driver can
----------- * call this function and make it happen any way. Only the driver knows
----------- * when it is safe to do so.
----------- **/
-----------void blk_attempt_remerge(request_queue_t *q, struct request *rq)
- - --{
- - -- unsigned long flags;
- - --
- - -- spin_lock_irqsave(q->queue_lock, flags);
- - -- attempt_back_merge(q, rq);
- - -- spin_unlock_irqrestore(q->queue_lock, flags);
- - --}
- - --
- - --EXPORT_SYMBOL(blk_attempt_remerge);
- - --
++++++ + static void init_request_from_bio(struct request *req, struct bio *bio)
{
------ - unsigned long flags;
++++++ + req->flags |= REQ_CMD;
------ - spin_lock_irqsave(q->queue_lock, flags);
------ - attempt_back_merge(q, rq);
------ - spin_unlock_irqrestore(q->queue_lock, flags);
------ - }
++++++ + /*
++++++ + * inherit FAILFAST from bio (for read-ahead, and explicit FAILFAST)
++++++ + */
++++++ + if (bio_rw_ahead(bio) || bio_failfast(bio))
++++++ + req->flags |= REQ_FAILFAST;
------ - EXPORT_SYMBOL(blk_attempt_remerge);
++++++ + /*
++++++ + * REQ_BARRIER implies no merging, but lets make it explicit
++++++ + */
++++++ + if (unlikely(bio_barrier(bio)))
++++++ + req->flags |= (REQ_HARDBARRIER | REQ_NOMERGE);
++++++ +
++++++ + req->errors = 0;
++++++ + req->hard_sector = req->sector = bio->bi_sector;
++++++ + req->hard_nr_sectors = req->nr_sectors = bio_sectors(bio);
++++++ + req->current_nr_sectors = req->hard_cur_sectors = bio_cur_sectors(bio);
++++++ + req->nr_phys_segments = bio_phys_segments(req->q, bio);
++++++ + req->nr_hw_segments = bio_hw_segments(req->q, bio);
++++++ + req->buffer = bio_data(bio); /* see ->buffer comment above */
++++++ + req->waiting = NULL;
++++++ + req->bio = req->biotail = bio;
++++++ + req->ioprio = bio_prio(bio);
++++++ + req->rq_disk = bio->bi_bdev->bd_disk;
++++++ + req->start_time = jiffies;
++++++ + }
static int __make_request(request_queue_t *q, struct bio *bio)
{
@@@@@@@@@@@@@ -3275,100 -3287,19 -3155,11 -3155,11 -3155,11 -3155,11 -3155,11 -3155,11 -3287,19 -3155,11 -3287,19 -3287,19 +3275,100 @@@@@@@@@@@@@ int end_that_request_chunk(struct reque
EXPORT_SYMBOL(end_that_request_chunk);
/*
+++++++++++ * splice the completion data to a local structure and hand off to
+++++++++++ * process_completion_queue() to complete the requests
+++++++++++ */
+++++++++++static void blk_done_softirq(struct softirq_action *h)
+++++++++++{
+++++++++++ struct list_head *cpu_list;
+++++++++++ LIST_HEAD(local_list);
+++++++++++
+++++++++++ local_irq_disable();
+++++++++++ cpu_list = &__get_cpu_var(blk_cpu_done);
+++++++++++ list_splice_init(cpu_list, &local_list);
+++++++++++ local_irq_enable();
+++++++++++
+++++++++++ while (!list_empty(&local_list)) {
+++++++++++ struct request *rq = list_entry(local_list.next, struct request, donelist);
+++++++++++
+++++++++++ list_del_init(&rq->donelist);
+++++++++++ rq->q->softirq_done_fn(rq);
+++++++++++ }
+++++++++++}
+++++++++++
+++++++++++#ifdef CONFIG_HOTPLUG_CPU
+++++++++++
+++++++++++static int blk_cpu_notify(struct notifier_block *self, unsigned long action,
+++++++++++ void *hcpu)
+++++++++++{
+++++++++++ /*
+++++++++++ * If a CPU goes away, splice its entries to the current CPU
+++++++++++ * and trigger a run of the softirq
+++++++++++ */
+++++++++++ if (action == CPU_DEAD) {
+++++++++++ int cpu = (unsigned long) hcpu;
+++++++++++
+++++++++++ local_irq_disable();
+++++++++++ list_splice_init(&per_cpu(blk_cpu_done, cpu),
+++++++++++ &__get_cpu_var(blk_cpu_done));
+++++++++++ raise_softirq_irqoff(BLOCK_SOFTIRQ);
+++++++++++ local_irq_enable();
+++++++++++ }
+++++++++++
+++++++++++ return NOTIFY_OK;
+++++++++++}
+++++++++++
+++++++++++
+++++++++++static struct notifier_block __devinitdata blk_cpu_notifier = {
+++++++++++ .notifier_call = blk_cpu_notify,
+++++++++++};
+++++++++++
+++++++++++#endif /* CONFIG_HOTPLUG_CPU */
+++++++++++
+++++++++++/**
+++++++++++ * blk_complete_request - end I/O on a request
+++++++++++ * @req: the request being processed
+++++++++++ *
+++++++++++ * Description:
+++++++++++ * Ends all I/O on a request. It does not handle partial completions,
+++++++++++ * unless the driver actually implements this in its completionc callback
+++++++++++ * through requeueing. Theh actual completion happens out-of-order,
+++++++++++ * through a softirq handler. The user must have registered a completion
+++++++++++ * callback through blk_queue_softirq_done().
+++++++++++ **/
+++++++++++
+++++++++++void blk_complete_request(struct request *req)
+++++++++++{
+++++++++++ struct list_head *cpu_list;
+++++++++++ unsigned long flags;
+++++++++++
+++++++++++ BUG_ON(!req->q->softirq_done_fn);
+++++++++++
+++++++++++ local_irq_save(flags);
+++++++++++
+++++++++++ cpu_list = &__get_cpu_var(blk_cpu_done);
+++++++++++ list_add_tail(&req->donelist, cpu_list);
+++++++++++ raise_softirq_irqoff(BLOCK_SOFTIRQ);
+++++++++++
+++++++++++ local_irq_restore(flags);
+++++++++++}
+++++++++++
+++++++++++EXPORT_SYMBOL(blk_complete_request);
+++++++++++
+++++++++++/*
* queue lock must be held
*/
------ - void end_that_request_last(struct request *req)
++++++ + void end_that_request_last(struct request *req, int uptodate)
{
struct gendisk *disk = req->rq_disk;
++++++ + int error;
++++++ +
++++++ + /*
++++++ + * extend uptodate bool to allow < 0 value to be direct io error
++++++ + */
++++++ + error = 0;
++++++ + if (end_io_error(uptodate))
++++++ + error = !uptodate ? -EIO : uptodate;
if (unlikely(laptop_mode) && blk_fs_request(req))
laptop_io_completion();
diff --cc drivers/acpi/processor_idle.c
index cc04933,552420e,5f51057,40c9f9c,807b0df,70d8a6e,1915c37,70d8a6e,807b0df,807b0df,807b0df,807b0df..be2dae5
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@@@@@@@@@@@@ -274,19 -309,19 -274,18 -278,18 -274,19 -278,8 -278,8 -278,8 -274,19 -274,19 -274,19 -274,19 +309,19 @@@@@@@@@@@@@ static void acpi_processor_idle(void
}
}
-- cx->usage++;
--
+++ #ifdef CONFIG_HOTPLUG_CPU
+++ /*
+++ * Check for P_LVL2_UP flag before entering C2 and above on
+++ * an SMP system. We do it here instead of doing it at _CST/P_LVL
+++ * detection phase, to work cleanly with logical CPU hotplug.
+++ */
+++ if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
-- !pr->flags.has_cst && acpi_fadt.plvl2_up)
-- cx->type = ACPI_STATE_C1;
++ +++ !pr->flags.has_cst && !acpi_fadt.plvl2_up)
++ +++ cx = &pr->power.states[ACPI_STATE_C1];
+++ #endif
++ +++
++ cx->usage++;
++
/*
* Sleep:
* ------
@@@@@@@@@@@@@ -556,20 -591,20 -546,20 -536,14 -556,20 -528,11 -528,11 -528,11 -556,20 -556,20 -556,20 -556,20 +589,14 @@@@@@@@@@@@@ static int acpi_processor_get_power_inf
pr->power.states[ACPI_STATE_C2].type = ACPI_STATE_C2;
pr->power.states[ACPI_STATE_C3].type = ACPI_STATE_C3;
--- -------- /* the C0 state only exists as a filler in our array,
--- -------- * and all processors need to support C1 */
--- -------- pr->power.states[ACPI_STATE_C0].valid = 1;
--- -------- pr->power.states[ACPI_STATE_C1].valid = 1;
--- - ----
+++ #ifndef CONFIG_HOTPLUG_CPU
+++ /*
+++ * Check for P_LVL2_UP flag before entering C2 and above on
+++ * an SMP system.
+++ */
-- if ((num_online_cpus() > 1) && acpi_fadt.plvl2_up)
++ +++ if ((num_online_cpus() > 1) && !acpi_fadt.plvl2_up)
+++ return_VALUE(-ENODEV);
+++ #endif
/* determine C2 and C3 address from pblk */
pr->power.states[ACPI_STATE_C2].address = pr->pblk + 4;
@@@@@@@@@@@@@ -723,11 -758,11 -713,11 -702,11 -723,11 -686,11 -686,11 -686,11 -723,11 -723,11 -723,11 -723,11 +755,11 @@@@@@@@@@@@@ static int acpi_processor_get_power_inf
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d power states\n",
--- -------- pr->power.count));
+++ ++++++++ current_count));
/* Validate number of power states discovered */
--- -------- if (pr->power.count < 2)
--- status = -ENODEV;
+++ ++++++++ if (current_count < 2)
+++ status = -EFAULT;
end:
acpi_os_free(buffer.pointer);
@@@@@@@@@@@@@ -892,12 -912,12 -867,12 -856,13 -877,12 -840,12 -840,12 -840,12 -877,12 -877,12 -877,12 -877,12 +924,13 @@@@@@@@@@@@@ static int acpi_processor_get_power_inf
/* NOTE: the idle thread may not be running while calling
* this function */
+++ ++++++++ /* Adding C1 state */
+++ ++++++++ acpi_processor_get_power_info_default_c1(pr);
result = acpi_processor_get_power_info_cst(pr);
--- if ((result) || (acpi_processor_power_verify(pr) < 2)) {
--- result = acpi_processor_get_power_info_fadt(pr);
--- if ((result) || (acpi_processor_power_verify(pr) < 2))
--- result = acpi_processor_get_power_info_default_c1(pr);
--- }
+++ if (result == -ENODEV)
--- - ---- result = acpi_processor_get_power_info_fadt(pr);
+++ ++++++++ acpi_processor_get_power_info_fadt(pr);
+++
--- - ---- if ((result) || (acpi_processor_power_verify(pr) < 2))
--- - ---- result = acpi_processor_get_power_info_default_c1(pr);
+++ ++++++++ pr->power.count = acpi_processor_power_verify(pr);
/*
* Set Default Policy
diff --cc drivers/acpi/processor_thermal.c
index dc9817c,dc9817c,f375840,37528c3,dc9817c,37528c3,37528c3,37528c3,dc9817c,dc9817c,f99ad05,dc9817c..f99ad05
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@@@@@@@@@@@@ -101,9 -101,9 -101,9 -101,11 -101,9 -101,11 -101,11 -101,11 -101,9 -101,9 -101,9 -101,9 +101,9 @@@@@@@@@@@@@ static unsigned int acpi_thermal_cpufre
static int cpu_has_cpufreq(unsigned int cpu)
{
struct cpufreq_policy policy;
- --- if (!acpi_thermal_cpufreq_is_init)
- --- return -ENODEV;
- --- if (!cpufreq_get_policy(&policy, cpu))
- --- return -ENODEV;
- --- return 0;
+ +++ if (!acpi_thermal_cpufreq_is_init || cpufreq_get_policy(&policy, cpu))
- return -ENODEV;
- return 0;
++ +++ return 0;
++ +++ return 1;
}
static int acpi_thermal_cpufreq_increase(unsigned int cpu)
diff --cc drivers/acpi/resources/rsinfo.c
index 0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,d9ae64b,0000000,0000000,0000000..d9ae64b
mode 000000,000000,000000,000000,000000,000000,000000,000000,100644,000000,000000,000000..100644
--- a/drivers/acpi/resources/rsinfo.c
+++ b/drivers/acpi/resources/rsinfo.c
diff --cc drivers/acpi/utilities/utmisc.c
index 2ce872d,2ce872d,0c5abc5,0c5abc5,2ce872d,0c5abc5,0c5abc5,0c5abc5,a77ffcd,2ce872d,2ce872d,2ce872d..a77ffcd
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@@@@@@@@@@@@ -82,19 -82,19 -82,19 -82,19 -82,19 -82,19 -82,19 -82,19 -84,52 -82,19 -82,19 -82,19 +84,52 @@@@@@@@@@@@@ acpi_status acpi_ut_allocate_owner_id(a
return_ACPI_STATUS(status);
}
-------- --- /* Find a free owner ID */
++++++++ +++ /*
++++++++ +++ * Find a free owner ID, cycle through all possible IDs on repeated
++++++++ +++ * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index may have
++++++++ +++ * to be scanned twice.
++++++++ +++ */
++++++++ +++ for (i = 0, j = acpi_gbl_last_owner_id_index;
++++++++ +++ i < (ACPI_NUM_OWNERID_MASKS + 1); i++, j++) {
++++++++ +++ if (j >= ACPI_NUM_OWNERID_MASKS) {
++++++++ +++ j = 0; /* Wraparound to start of mask array */
++++++++ +++ }
++++++++ +++
++++++++ +++ for (k = acpi_gbl_next_owner_id_offset; k < 32; k++) {
++++++++ +++ if (acpi_gbl_owner_id_mask[j] == ACPI_UINT32_MAX) {
++++++++ +++ /* There are no free IDs in this mask */
++++++++ +++
++++++++ +++ break;
++++++++ +++ }
++++++++ +++
++++++++ +++ if (!(acpi_gbl_owner_id_mask[j] & (1 << k))) {
++++++++ +++ /*
++++++++ +++ * Found a free ID. The actual ID is the bit index plus one,
++++++++ +++ * making zero an invalid Owner ID. Save this as the last ID
++++++++ +++ * allocated and update the global ID mask.
++++++++ +++ */
++++++++ +++ acpi_gbl_owner_id_mask[j] |= (1 << k);
++++++++ +++
++++++++ +++ acpi_gbl_last_owner_id_index = (u8) j;
++++++++ +++ acpi_gbl_next_owner_id_offset = (u8) (k + 1);
-- - --- for (i = 0; i < 64; i++) {
-- - --- if (!(acpi_gbl_owner_id_mask & (1ULL << i))) {
-- --- for (i = 0; i < 32; i++) {
-- --- if (!(acpi_gbl_owner_id_mask & (1 << i))) {
-------- --- ACPI_DEBUG_PRINT((ACPI_DB_VALUES,
-- - --- "Current owner_id mask: %16.16LX New ID: %2.2X\n",
-- --- "Current owner_id mask: %8.8X New ID: %2.2X\n",
-------- --- acpi_gbl_owner_id_mask,
-------- --- (unsigned int)(i + 1)));
++++++++ +++ /*
++++++++ +++ * Construct encoded ID from the index and bit position
++++++++ +++ *
++++++++ +++ * Note: Last [j].k (bit 255) is never used and is marked
++++++++ +++ * permanently allocated (prevents +1 overflow)
++++++++ +++ */
++++++++ +++ *owner_id =
++++++++ +++ (acpi_owner_id) ((k + 1) + ACPI_MUL_32(j));
-- - --- acpi_gbl_owner_id_mask |= (1ULL << i);
-- --- acpi_gbl_owner_id_mask |= (1 << i);
-------- --- *owner_id = (acpi_owner_id) (i + 1);
-------- --- goto exit;
++++++++ +++ ACPI_DEBUG_PRINT((ACPI_DB_VALUES,
++++++++ +++ "Allocated owner_id: %2.2X\n",
++++++++ +++ (unsigned int)*owner_id));
++++++++ +++ goto exit;
++++++++ +++ }
}
++++++++ +++
++++++++ +++ acpi_gbl_next_owner_id_offset = 0;
}
/*
@@@@@@@@@@@@@ -103,10 -103,10 -103,10 -103,10 -103,10 -103,10 -103,10 -103,10 -138,12 -103,10 -103,10 -103,10 +138,12 @@@@@@@@@@@@@
* allocated upon table load (one per table) and method execution, and
* they are released when a table is unloaded or a method completes
* execution.
++++++++ +++ *
++++++++ +++ * If this error happens, there may be very deep nesting of invoked control
++++++++ +++ * methods, or there may be a bug where the IDs are not released.
*/
-------- --- *owner_id = 0;
status = AE_OWNER_ID_LIMIT;
-- - --- ACPI_REPORT_ERROR(("Could not allocate new owner_id (64 max), AE_OWNER_ID_LIMIT\n"));
-- --- ACPI_REPORT_ERROR(("Could not allocate new owner_id (32 max), AE_OWNER_ID_LIMIT\n"));
++++++++ +++ ACPI_REPORT_ERROR(("Could not allocate new owner_id (255 max), AE_OWNER_ID_LIMIT\n"));
exit:
(void)acpi_ut_release_mutex(ACPI_MTX_CACHES);
@@@@@@@@@@@@@ -123,7 -123,7 -123,7 -123,7 -123,7 -123,7 -123,7 -123,7 -160,7 -123,7 -123,7 -123,7 +160,7 @@@@@@@@@@@@@
* control method or unloading a table. Either way, we would
* ignore any error anyway.
*
-- - --- * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 64
-- --- * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 32
++++++++ +++ * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 255
*
******************************************************************************/
@@@@@@@@@@@@@ -140,7 -140,7 -140,7 -140,7 -140,7 -140,7 -140,7 -140,7 -179,7 -140,7 -140,7 -140,7 +179,7 @@@@@@@@@@@@@ void acpi_ut_release_owner_id(acpi_owne
/* Zero is not a valid owner_iD */
-- - --- if ((owner_id == 0) || (owner_id > 64)) {
-- --- if ((owner_id == 0) || (owner_id > 32)) {
++++++++ +++ if (owner_id == 0) {
ACPI_REPORT_ERROR(("Invalid owner_id: %2.2X\n", owner_id));
return_VOID;
}
@@@@@@@@@@@@@ -156,10 -156,10 -156,10 -156,10 -156,10 -156,10 -156,10 -156,10 -195,18 -156,10 -156,10 -156,10 +195,18 @@@@@@@@@@@@@
owner_id--;
++++++++ +++ /* Decode ID to index/offset pair */
++++++++ +++
++++++++ +++ index = ACPI_DIV_32(owner_id);
++++++++ +++ bit = 1 << ACPI_MOD_32(owner_id);
++++++++ +++
/* Free the owner ID only if it is valid */
-- - --- if (acpi_gbl_owner_id_mask & (1ULL << owner_id)) {
-- - --- acpi_gbl_owner_id_mask ^= (1ULL << owner_id);
-- --- if (acpi_gbl_owner_id_mask & (1 << owner_id)) {
-- --- acpi_gbl_owner_id_mask ^= (1 << owner_id);
++++++++ +++ if (acpi_gbl_owner_id_mask[index] & bit) {
++++++++ +++ acpi_gbl_owner_id_mask[index] ^= bit;
++++++++ +++ } else {
++++++++ +++ ACPI_REPORT_ERROR(("Release of non-allocated owner_id: %2.2X\n",
++++++++ +++ owner_id + 1));
}
(void)acpi_ut_release_mutex(ACPI_MTX_CACHES);
diff --cc drivers/acpi/utilities/utresrc.c
index 0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,36bf9e4,0000000,0000000,0000000..36bf9e4
mode 000000,000000,000000,000000,000000,000000,000000,000000,100644,000000,000000,000000..100644
--- a/drivers/acpi/utilities/utresrc.c
+++ b/drivers/acpi/utilities/utresrc.c
diff --cc drivers/amba/Makefile
index 40fe740,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..40fe740
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/amba/Makefile
+++ b/drivers/amba/Makefile
diff --cc drivers/amba/bus.c
index 889855d,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..889855d
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
diff --cc drivers/base/core.c
index 6b355bd,fd80599,8615b42,8615b42,8615b42,8615b42,8615b42,8615b42,fd80599,8615b42,fd80599,fd80599..6b355bd
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@@@@@@@@@@@@ -161,11 -161,11 -161,11 -161,11 -161,11 -161,11 -161,11 -161,11 -161,11 -161,11 -161,11 -161,11 +161,11 @@@@@@@@@@@@@ static ssize_t store_uevent(struct devi
return count;
}
-----------/**
----------- * device_subsys - structure to be registered with kobject core.
+++++++++++/*
+++++++++++ * devices_subsys - structure to be registered with kobject core.
*/
------ - decl_subsys(devices, &ktype_device, &device_hotplug_ops);
++++++ + decl_subsys(devices, &ktype_device, &device_uevent_ops);
/**
diff --cc drivers/base/memory.c
index d1a0522,58801d7,b7ddd65,b7ddd65,bc3ca6a,b7ddd65,b7ddd65,b7ddd65,58801d7,bc3ca6a,58801d7,58801d7..d1a0522
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@@@@@@@@@@@@ -28,8 -28,8 -28,9 -28,9 -28,8 -28,9 -28,9 -28,9 -28,8 -28,8 -28,8 -28,8 +28,8 @@@@@@@@@@@@@
static struct sysdev_class memory_sysdev_class = {
set_kset_name(MEMORY_CLASS_NAME),
};
-- --- EXPORT_SYMBOL(memory_sysdev_class);
------ - static char *memory_hotplug_name(struct kset *kset, struct kobject *kobj)
++++++ + static const char *memory_uevent_name(struct kset *kset, struct kobject *kobj)
{
return MEMORY_CLASS_NAME;
}
diff --cc drivers/base/platform.c
index 461554a,0f81731,8827daf,8827daf,8827daf,8827daf,8827daf,8827daf,0f81731,8827daf,0f81731,0f81731..461554a
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@@@@@@@@@@@@ -305,37 -305,37 -310,9 -310,9 -310,9 -310,9 -310,9 -310,9 -305,37 -310,9 -305,37 -305,37 +305,37 @@@@@@@@@@@@@ void platform_device_del(struct platfor
release_resource(r);
}
------ - device_unregister(&pdev->dev);
++++++ + device_del(&pdev->dev);
}
}
++++++ + EXPORT_SYMBOL_GPL(platform_device_del);
++++++ +
++++++ + /**
++++++ + * platform_device_register - add a platform-level device
++++++ + * @pdev: platform device we're adding
++++++ + *
++++++ + */
++++++ + int platform_device_register(struct platform_device * pdev)
++++++ + {
++++++ + device_initialize(&pdev->dev);
++++++ + return platform_device_add(pdev);
++++++ + }
++++++ + EXPORT_SYMBOL_GPL(platform_device_register);
++++++ +
++++++ + /**
++++++ + * platform_device_unregister - unregister a platform-level device
++++++ + * @pdev: platform device we're unregistering
++++++ + *
++++++ + * Unregistration is done in 2 steps. Fisrt we release all resources
- - -- * and remove it from the sybsystem, then we drop reference count by
+++++++++++ * and remove it from the subsystem, then we drop reference count by
++++++ + * calling platform_device_put().
++++++ + */
++++++ + void platform_device_unregister(struct platform_device * pdev)
++++++ + {
++++++ + platform_device_del(pdev);
++++++ + platform_device_put(pdev);
++++++ + }
++++++ + EXPORT_SYMBOL_GPL(platform_device_unregister);
/**
* platform_device_register_simple
diff --cc drivers/block/cciss.c
index 12d7b9b,d2815b7,c3441b3,a9e33db,c3441b3,a9e33db,a9e33db,a9e33db,d2815b7,c3441b3,d2815b7,d2815b7..12d7b9b
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@@@@@@@@@@@@ -2327,10 -2294,24 -2294,24 -2294,24 -2294,24 -2294,24 -2294,24 -2294,24 -2294,24 -2294,24 -2294,24 -2294,24 +2327,10 @@@@@@@@@@@@@ static inline void complete_command( ct
resend_cciss_cmd(h,cmd);
return;
}
----------- /* command did not need to be retried */
----------- /* unmap the DMA mapping for all the scatter gather elements */
----------- for(i=0; i<cmd->Header.SGList; i++) {
----------- temp64.val32.lower = cmd->SG[i].Addr.lower;
----------- temp64.val32.upper = cmd->SG[i].Addr.upper;
----------- pci_unmap_page(hba[cmd->ctlr]->pdev,
----------- temp64.val, cmd->SG[i].Len,
----------- (cmd->Request.Type.Direction == XFER_READ) ?
----------- PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE);
----------- }
----------- complete_buffers(cmd->rq->bio, status);
- ---
- --- #ifdef CCISS_DEBUG
- --- printk("Done with %p\n", cmd->rq);
- --- #endif /* CCISS_DEBUG */
-- - ----#ifdef CCISS_DEBUG
-- - ---- printk("Done with %p\n", cmd->rq);
-- - ----#endif /* CCISS_DEBUG */
-- - ----
- - -- end_that_request_last(cmd->rq, status ? 1 : -EIO);
------ - end_that_request_last(cmd->rq);
----------- cmd_free(h,cmd,1);
+++++++++++ cmd->rq->completion_data = cmd;
+++++++++++ cmd->rq->errors = status;
+++++++++++ blk_complete_request(cmd->rq);
}
/*
diff --cc drivers/block/loop.c
index 5f6d1a5,a452b13,96c664a,96c664a,96c664a,96c664a,96c664a,96c664a,a452b13,96c664a,a452b13,a452b13..5f6d1a5
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@@@@@@@@@@@@ -213,9 -213,9 -213,9 -213,9 -213,9 -213,9 -213,9 -213,9 -213,9 -213,9 -213,9 -213,9 +213,9 @@@@@@@@@@@@@ static int do_lo_send_aops(struct loop_
struct address_space_operations *aops = mapping->a_ops;
pgoff_t index;
unsigned offset, bv_offs;
------ - int len, ret = 0;
++++++ + int len, ret;
----------- down(&mapping->host->i_sem);
+++++++++++ mutex_lock(&mapping->host->i_mutex);
index = pos >> PAGE_CACHE_SHIFT;
offset = pos & ((pgoff_t)PAGE_CACHE_SIZE - 1);
bv_offs = bvec->bv_offset;
@@@@@@@@@@@@@ -276,9 -276,9 -264,8 -264,8 -264,8 -264,8 -264,8 -264,8 -276,9 -264,8 -276,9 -276,9 +276,9 @@@@@@@@@@@@@
unlock_page(page);
page_cache_release(page);
}
++++++ + ret = 0;
out:
----------- up(&mapping->host->i_sem);
+++++++++++ mutex_unlock(&mapping->host->i_mutex);
return ret;
unlock:
unlock_page(page);
diff --cc drivers/char/Kconfig
index 4135d8c,5ebd06b,b46a72d,970f70d,84e68cd,970f70d,970f70d,970f70d,5ebd06b,84e68cd,5ebd06b,5ebd06b..4135d8c
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@@@@@@@@@@@@ -695,7 -687,7 -687,7 -687,7 -687,7 -687,7 -687,7 -687,7 -687,7 -687,7 -687,7 -687,7 +695,7 @@@@@@@@@@@@@ config NVRA
config RTC
tristate "Enhanced Real Time Clock Support"
- - ---- depends on !PPC32 && !PARISC && !IA64 && !M68K && (!SPARC || PCI)
-- --- depends on !PPC32 && !PARISC && !IA64 && !M68K
+++++++++++ depends on !PPC32 && !PARISC && !IA64 && !M68K && (!SPARC || PCI) && !FRV
---help---
If you say Y here and create a character special file /dev/rtc with
major number 10 and minor number 135 using mknod ("man mknod"), you
@@@@@@@@@@@@@ -743,7 -735,7 -735,7 -735,7 -735,7 -735,7 -735,7 -735,7 -735,7 -735,7 -735,7 -735,7 +743,7 @@@@@@@@@@@@@ config SGI_IP27_RT
config GEN_RTC
tristate "Generic /dev/rtc emulation"
- - ---- depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC
-- --- depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC32 && !SPARC64
+++++++++++ depends on RTC!=y && !IA64 && !ARM && !M32R && !SPARC && !FRV
---help---
If you say Y here and create a character special file /dev/rtc with
major number 10 and minor number 135 using mknod ("man mknod"), you
@@@@@@@@@@@@@ -990,9 -983,9 -983,9 -974,18 -983,9 -974,18 -974,18 -974,18 -983,9 -983,9 -983,9 -983,9 +990,9 @@@@@@@@@@@@@ config HPET_MMA
exposed to the user. If this applies to your hardware,
say N here.
- --- config MAX_RAW_DEVS
- --- int "Maximum number of RAW devices to support (1-8192)"
- --- depends on RAW_DRIVER
- --- default "256"
- --- help
- --- The maximum number of RAW devices that are supported.
- --- Default is 256. Increase this number in case you need lots of
- --- raw devices.
- ---
config HANGCHECK_TIMER
tristate "Hangcheck timer"
------ - depends on X86 || IA64 || PPC64 || ARCH_S390
++++++ + depends on X86 || IA64 || PPC64 || S390
help
The hangcheck-timer module detects when the system has gone
out to lunch past a certain margin. It can reboot the system
diff --cc drivers/char/cs5535_gpio.c
index 5d72f50,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..5d72f50
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/char/cs5535_gpio.c
+++ b/drivers/char/cs5535_gpio.c
diff --cc drivers/char/drm/drm_context.c
index f842545,bd958d6,bd958d6,bdd168d,bd958d6,bd958d6,bd958d6,bd958d6,bd958d6,bd958d6,bd958d6,bd958d6..f842545
--- a/drivers/char/drm/drm_context.c
+++ b/drivers/char/drm/drm_context.c
@@@@@@@@@@@@@ -432,10 -432,10 -432,10 -432,7 -432,10 -432,10 -432,10 -432,10 -432,10 -432,10 -432,10 -432,10 +432,10 @@@@@@@@@@@@@ int drm_addctx(struct inode *inode, str
if (ctx.handle != DRM_KERNEL_CONTEXT) {
if (dev->driver->context_ctor)
- dev->driver->context_ctor(dev, ctx.handle);
+ if (!dev->driver->context_ctor(dev, ctx.handle)) {
-- -------- DRM_DEBUG( "Running out of ctxs or memory.\n");
+++++++++++ DRM_DEBUG("Running out of ctxs or memory.\n");
+ return -ENOMEM;
+ }
}
ctx_entry = drm_alloc(sizeof(*ctx_entry), DRM_MEM_CTXLIST);
diff --cc drivers/char/drm/drm_init.c
index 0000000,754b934,754b934,754b934,754b934,754b934,754b934,754b934,754b934,754b934,754b934,754b934..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/drm/drm_init.c
+++ /dev/null
diff --cc drivers/char/drm/radeon_cp.c
index 915665c,342302d,9f2b4ef,03839ea,342302d,03839ea,03839ea,03839ea,342302d,b517ae5,342302d,342302d..915665c
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@@@@@@@@@@@@ -1313,18 -1311,14 -1311,14 -1311,14 -1311,14 -1311,14 -1311,14 -1311,14 -1311,14 -1311,16 -1311,14 -1311,14 +1313,18 @@@@@@@@@@@@@ static void radeon_set_pcigart(drm_rade
static int radeon_do_init_cp(drm_device_t * dev, drm_radeon_init_t * init)
{
-- --- drm_radeon_private_t *dev_priv = dev->dev_private;;
++ +++ drm_radeon_private_t *dev_priv = dev->dev_private;
- unsigned int mem_size, aper_size;
++++++++ ++
DRM_DEBUG("\n");
----------- dev_priv->is_pci = init->is_pci;
+++++++++++ if (init->is_pci && (dev_priv->flags & CHIP_IS_AGP))
+++++++++++ {
+++++++++++ DRM_DEBUG("Forcing AGP card to PCI mode\n");
+++++++++++ dev_priv->flags &= ~CHIP_IS_AGP;
+++++++++++ }
----------- if (dev_priv->is_pci && !dev->sg) {
+++++++++++ if ((!(dev_priv->flags & CHIP_IS_AGP)) && !dev->sg) {
DRM_ERROR("PCI GART memory not allocated!\n");
----------- dev->dev_private = (void *)dev_priv;
radeon_do_cleanup_cp(dev);
return DRM_ERR(EINVAL);
}
@@@@@@@@@@@@@ -1510,11 -1521,11 -1521,11 -1521,11 -1521,11 -1521,11 -1521,11 -1521,11 -1521,11 -1523,16 -1521,11 -1521,11 +1510,11 @@@@@@@@@@@@@
+ dev_priv->fb_location) >> 10));
dev_priv->gart_size = init->gart_size;
-
- mem_size = RADEON_READ(RADEON_CONFIG_MEMSIZE);
- if (mem_size == 0)
- mem_size = 0x800000;
- aper_size = max(RADEON_READ(RADEON_CONFIG_APER_SIZE), mem_size);
-
- dev_priv->gart_vm_start = dev_priv->fb_location + aper_size;
+ dev_priv->gart_vm_start = dev_priv->fb_location
- + RADEON_READ(RADEON_CONFIG_APER_SIZE) * 2;
+ + + RADEON_READ(RADEON_CONFIG_APER_SIZE);
#if __OS_HAS_AGP
----------- if (!dev_priv->is_pci)
+++++++++++ if (dev_priv->flags & CHIP_IS_AGP)
dev_priv->gart_buffers_offset = (dev->agp_buffer_map->offset
- dev->agp->base
+ dev_priv->gart_vm_start);
diff --cc drivers/char/drm/via_dmablit.c
index 9d5e027,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..9d5e027
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/char/drm/via_dmablit.c
+++ b/drivers/char/drm/via_dmablit.c
diff --cc drivers/char/drm/via_dmablit.h
index f4036cd,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..f4036cd
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/char/drm/via_dmablit.h
+++ b/drivers/char/drm/via_dmablit.h
diff --cc drivers/char/rio/brates.h
index 0000000,bd4fc84,bd4fc84,bd4fc84,bd4fc84,bd4fc84,bd4fc84,bd4fc84,bd4fc84,bd4fc84,bd4fc84,bd4fc84..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/brates.h
+++ /dev/null
diff --cc drivers/char/rio/chan.h
index 0000000,5b30654,5b30654,5b30654,5b30654,5b30654,5b30654,5b30654,5b30654,5b30654,5b30654,5b30654..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/chan.h
+++ /dev/null
diff --cc drivers/char/rio/cmd.h
index 0000000,c369eda,c369eda,c369eda,c369eda,c369eda,c369eda,c369eda,c369eda,c369eda,c369eda,c369eda..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/cmd.h
+++ /dev/null
diff --cc drivers/char/rio/data.h
index 0000000,dabc2d1,dabc2d1,dabc2d1,dabc2d1,dabc2d1,dabc2d1,dabc2d1,dabc2d1,dabc2d1,dabc2d1,dabc2d1..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/data.h
+++ /dev/null
diff --cc drivers/char/rio/debug.h
index 0000000,b6e0d09,b6e0d09,b6e0d09,b6e0d09,b6e0d09,b6e0d09,b6e0d09,b6e0d09,b6e0d09,b6e0d09,b6e0d09..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/debug.h
+++ /dev/null
diff --cc drivers/char/rio/eisa.h
index 0000000,59371b0,59371b0,59371b0,59371b0,59371b0,59371b0,59371b0,59371b0,59371b0,59371b0,59371b0..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/eisa.h
+++ /dev/null
diff --cc drivers/char/rio/enable.h
index 0000000,8e9a419,8e9a419,8e9a419,8e9a419,8e9a419,8e9a419,8e9a419,8e9a419,8e9a419,8e9a419,8e9a419..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/enable.h
+++ /dev/null
diff --cc drivers/char/rio/formpkt.h
index 0000000,a8b65ae,a8b65ae,a8b65ae,a8b65ae,a8b65ae,a8b65ae,a8b65ae,a8b65ae,a8b65ae,a8b65ae,a8b65ae..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/formpkt.h
+++ /dev/null
diff --cc drivers/char/rio/hosthw.h
index 0000000,f6f31ec,f6f31ec,f6f31ec,f6f31ec,f6f31ec,f6f31ec,f6f31ec,f6f31ec,f6f31ec,f6f31ec,f6f31ec..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/hosthw.h
+++ /dev/null
diff --cc drivers/char/rio/lrt.h
index 0000000,bbac8fa,bbac8fa,bbac8fa,bbac8fa,bbac8fa,bbac8fa,bbac8fa,bbac8fa,bbac8fa,bbac8fa,bbac8fa..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/lrt.h
+++ /dev/null
diff --cc drivers/char/rio/ltt.h
index 0000000,f27dcec,f27dcec,f27dcec,f27dcec,f27dcec,f27dcec,f27dcec,f27dcec,f27dcec,f27dcec,f27dcec..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/ltt.h
+++ /dev/null
diff --cc drivers/char/rio/lttwake.h
index 0000000,fe17d0e,fe17d0e,fe17d0e,fe17d0e,fe17d0e,fe17d0e,fe17d0e,fe17d0e,fe17d0e,fe17d0e,fe17d0e..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/lttwake.h
+++ /dev/null
diff --cc drivers/char/rio/mca.h
index 0000000,08a327e,08a327e,08a327e,08a327e,08a327e,08a327e,08a327e,08a327e,08a327e,08a327e,08a327e..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/mca.h
+++ /dev/null
diff --cc drivers/char/rio/mesg.h
index 0000000,9cf6c0b,9cf6c0b,9cf6c0b,9cf6c0b,9cf6c0b,9cf6c0b,9cf6c0b,9cf6c0b,9cf6c0b,9cf6c0b,9cf6c0b..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/mesg.h
+++ /dev/null
diff --cc drivers/char/rio/poll.h
index 0000000,d9b8e98,d9b8e98,d9b8e98,d9b8e98,d9b8e98,d9b8e98,d9b8e98,d9b8e98,d9b8e98,d9b8e98,d9b8e98..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/poll.h
+++ /dev/null
diff --cc drivers/char/rio/proto.h
index 0000000,ddff0ef,ddff0ef,ddff0ef,ddff0ef,ddff0ef,ddff0ef,ddff0ef,ddff0ef,ddff0ef,ddff0ef,ddff0ef..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/proto.h
+++ /dev/null
diff --cc drivers/char/rio/riolocks.h
index 0000000,0e0cdac,0e0cdac,0e0cdac,0e0cdac,0e0cdac,0e0cdac,0e0cdac,0e0cdac,0e0cdac,0e0cdac,0e0cdac..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/riolocks.h
+++ /dev/null
diff --cc drivers/char/rio/riotime.h
index 0000000,66d52bc,66d52bc,66d52bc,66d52bc,66d52bc,66d52bc,66d52bc,66d52bc,66d52bc,66d52bc,66d52bc..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/riotime.h
+++ /dev/null
diff --cc drivers/char/rio/riowinif.h
index 0000000,18a4f14,18a4f14,18a4f14,18a4f14,18a4f14,18a4f14,18a4f14,18a4f14,18a4f14,18a4f14,18a4f14..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/riowinif.h
+++ /dev/null
diff --cc drivers/char/rio/riscos.h
index 0000000,7685cc1,7685cc1,7685cc1,7685cc1,7685cc1,7685cc1,7685cc1,7685cc1,7685cc1,7685cc1,7685cc1..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/riscos.h
+++ /dev/null
diff --cc drivers/char/rio/rtahw.h
index 0000000,0686011,0686011,0686011,0686011,0686011,0686011,0686011,0686011,0686011,0686011,0686011..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/rtahw.h
+++ /dev/null
diff --cc drivers/char/rio/rupstat.h
index 0000000,b4aafaf,b4aafaf,b4aafaf,b4aafaf,b4aafaf,b4aafaf,b4aafaf,b4aafaf,b4aafaf,b4aafaf,b4aafaf..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/rupstat.h
+++ /dev/null
diff --cc drivers/char/rio/selftest.h
index 0000000,deae487,deae487,deae487,deae487,deae487,deae487,deae487,deae487,deae487,deae487,deae487..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/selftest.h
+++ /dev/null
diff --cc drivers/char/rio/sysmap.h
index 0000000,fdc7313,fdc7313,fdc7313,fdc7313,fdc7313,fdc7313,fdc7313,fdc7313,fdc7313,fdc7313,fdc7313..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/sysmap.h
+++ /dev/null
diff --cc drivers/char/rio/timeouts.h
index 0000000,11b3133,11b3133,11b3133,11b3133,11b3133,11b3133,11b3133,11b3133,11b3133,11b3133,11b3133..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/char/rio/timeouts.h
+++ /dev/null
diff --cc drivers/char/synclink_gt.c
index a85a60a,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..a85a60a
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
diff --cc drivers/char/tpm/tpm_bios.c
index aedf7a8,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..aedf7a8
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/char/tpm/tpm_bios.c
+++ b/drivers/char/tpm/tpm_bios.c
diff --cc drivers/char/watchdog/mpc83xx_wdt.c
index 5d6f506,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..5d6f506
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/char/watchdog/mpc83xx_wdt.c
+++ b/drivers/char/watchdog/mpc83xx_wdt.c
diff --cc drivers/char/watchdog/sbc_epx_c3.c
index 9517646,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..9517646
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/char/watchdog/sbc_epx_c3.c
+++ b/drivers/char/watchdog/sbc_epx_c3.c
diff --cc drivers/connector/cn_proc.c
index 4b4d7db,969d2b4,969d2b4,fcdf0ff,969d2b4,fcdf0ff,fcdf0ff,fcdf0ff,969d2b4,969d2b4,969d2b4,969d2b4..4b4d7db
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@@@@@@@@@@@@ -57,7 -56,7 -56,7 -56,6 -56,7 -56,6 -56,6 -56,6 -56,7 -56,7 -56,7 -56,7 +57,7 @@@@@@@@@@@@@ void proc_fork_connector(struct task_st
msg = (struct cn_msg*)buffer;
ev = (struct proc_event*)msg->data;
get_seq(&msg->seq, &ev->cpu);
-- - ---- getnstimestamp(&ev->timestamp);
+++++++++++ ktime_get_ts(&ev->timestamp); /* get high res monotonic timestamp */
ev->what = PROC_EVENT_FORK;
ev->event_data.fork.parent_pid = task->real_parent->pid;
ev->event_data.fork.parent_tgid = task->real_parent->tgid;
@@@@@@@@@@@@@ -83,7 -82,7 -82,7 -81,6 -82,7 -81,6 -81,6 -81,6 -82,7 -82,7 -82,7 -82,7 +83,7 @@@@@@@@@@@@@ void proc_exec_connector(struct task_st
msg = (struct cn_msg*)buffer;
ev = (struct proc_event*)msg->data;
get_seq(&msg->seq, &ev->cpu);
-- - ---- getnstimestamp(&ev->timestamp);
+++++++++++ ktime_get_ts(&ev->timestamp);
ev->what = PROC_EVENT_EXEC;
ev->event_data.exec.process_pid = task->pid;
ev->event_data.exec.process_tgid = task->tgid;
@@@@@@@@@@@@@ -117,7 -116,7 -116,7 -114,6 -116,7 -114,6 -114,6 -114,6 -116,7 -116,7 -116,7 -116,7 +117,7 @@@@@@@@@@@@@ void proc_id_connector(struct task_stru
} else
return;
get_seq(&msg->seq, &ev->cpu);
-- - ---- getnstimestamp(&ev->timestamp);
+++++++++++ ktime_get_ts(&ev->timestamp);
memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
msg->ack = 0; /* not used */
@@@@@@@@@@@@@ -137,7 -136,7 -136,7 -133,6 -136,7 -133,6 -133,6 -133,6 -136,7 -136,7 -136,7 -136,7 +137,7 @@@@@@@@@@@@@ void proc_exit_connector(struct task_st
msg = (struct cn_msg*)buffer;
ev = (struct proc_event*)msg->data;
get_seq(&msg->seq, &ev->cpu);
-- - ---- getnstimestamp(&ev->timestamp);
+++++++++++ ktime_get_ts(&ev->timestamp);
ev->what = PROC_EVENT_EXIT;
ev->event_data.exit.process_pid = task->pid;
ev->event_data.exit.process_tgid = task->tgid;
@@@@@@@@@@@@@ -170,7 -169,7 -169,7 -165,6 -169,7 -165,6 -165,6 -165,6 -169,7 -169,7 -169,7 -169,7 +170,7 @@@@@@@@@@@@@ static void cn_proc_ack(int err, int rc
msg = (struct cn_msg*)buffer;
ev = (struct proc_event*)msg->data;
msg->seq = rcvd_seq;
-- - ---- getnstimestamp(&ev->timestamp);
+++++++++++ ktime_get_ts(&ev->timestamp);
ev->cpu = -1;
ev->what = PROC_EVENT_NONE;
ev->event_data.ack.err = err;
diff --cc drivers/edac/Kconfig
index 4819e7f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..4819e7f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
diff --cc drivers/edac/Makefile
index 93137fd,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..93137fd
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/edac/Makefile
+++ b/drivers/edac/Makefile
diff --cc drivers/edac/amd76x_edac.c
index 2fcc812,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..2fcc812
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/edac/amd76x_edac.c
+++ b/drivers/edac/amd76x_edac.c
diff --cc drivers/edac/e752x_edac.c
index 770a5a6,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..770a5a6
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/edac/e752x_edac.c
+++ b/drivers/edac/e752x_edac.c
diff --cc drivers/edac/e7xxx_edac.c
index d5e320d,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..d5e320d
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/edac/e7xxx_edac.c
+++ b/drivers/edac/e7xxx_edac.c
diff --cc drivers/edac/edac_mc.c
index 4be9bd0,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..4be9bd0
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
diff --cc drivers/edac/edac_mc.h
index 75ecf48,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..75ecf48
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/edac/edac_mc.h
+++ b/drivers/edac/edac_mc.h
diff --cc drivers/edac/i82860_edac.c
index 52596e7,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..52596e7
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/edac/i82860_edac.c
+++ b/drivers/edac/i82860_edac.c
diff --cc drivers/edac/i82875p_edac.c
index 009c08f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..009c08f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/edac/i82875p_edac.c
+++ b/drivers/edac/i82875p_edac.c
diff --cc drivers/edac/r82600_edac.c
index e908928,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..e908928
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/edac/r82600_edac.c
+++ b/drivers/edac/r82600_edac.c
diff --cc drivers/hwmon/vt8231.c
index 3eb08f0,d00a726,0000000,0000000,0000000,0000000,0000000,0000000,d00a726,0000000,d00a726,d00a726..3eb08f0
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/hwmon/vt8231.c
+++ b/drivers/hwmon/vt8231.c
@@@@@@@@@@@@@ -1,862 -1,862 -1,0 -1,0 -1,0 -1,0 -1,0 -1,0 -1,862 -1,0 -1,862 -1,862 +1,862 @@@@@@@@@@@@@
++++++ + /*
++++++ + vt8231.c - Part of lm_sensors, Linux kernel modules
++++++ + for hardware monitoring
++++++ +
++++++ + Copyright (c) 2005 Roger Lucas <roger@planbit.co.uk>
++++++ + Copyright (c) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com>
++++++ + Aaron M. Marsh <amarsh@sdf.lonestar.org>
++++++ +
++++++ + This program is free software; you can redistribute it and/or modify
++++++ + it under the terms of the GNU General Public License as published by
++++++ + the Free Software Foundation; either version 2 of the License, or
++++++ + (at your option) any later version.
++++++ +
++++++ + This program is distributed in the hope that it will be useful,
++++++ + but WITHOUT ANY WARRANTY; without even the implied warranty of
++++++ + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++++++ + GNU General Public License for more details.
++++++ +
++++++ + You should have received a copy of the GNU General Public License
++++++ + along with this program; if not, write to the Free Software
++++++ + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++++++ + */
++++++ +
++++++ + /* Supports VIA VT8231 South Bridge embedded sensors
++++++ + */
++++++ +
++++++ + #include <linux/module.h>
++++++ + #include <linux/init.h>
++++++ + #include <linux/slab.h>
++++++ + #include <linux/pci.h>
++++++ + #include <linux/jiffies.h>
++++++ + #include <linux/i2c.h>
++++++ + #include <linux/i2c-isa.h>
++++++ + #include <linux/hwmon.h>
++++++ + #include <linux/hwmon-sysfs.h>
++++++ + #include <linux/hwmon-vid.h>
++++++ + #include <linux/err.h>
++++++ + #include <asm/io.h>
++++++ +
++++++ + static int force_addr;
++++++ + module_param(force_addr, int, 0);
++++++ + MODULE_PARM_DESC(force_addr, "Initialize the base address of the sensors");
++++++ +
++++++ + /* Device address
++++++ + Note that we can't determine the ISA address until we have initialized
++++++ + our module */
++++++ + static unsigned short isa_address;
++++++ +
++++++ + #define VT8231_EXTENT 0x80
++++++ + #define VT8231_BASE_REG 0x70
++++++ + #define VT8231_ENABLE_REG 0x74
++++++ +
++++++ + /* The VT8231 registers
++++++ +
++++++ + The reset value for the input channel configuration is used (Reg 0x4A=0x07)
++++++ + which sets the selected inputs marked with '*' below if multiple options are
++++++ + possible:
++++++ +
++++++ + Voltage Mode Temperature Mode
++++++ + Sensor Linux Id Linux Id VIA Id
++++++ + -------- -------- -------- ------
++++++ + CPU Diode N/A temp1 0
++++++ + UIC1 in0 temp2 * 1
++++++ + UIC2 in1 * temp3 2
++++++ + UIC3 in2 * temp4 3
++++++ + UIC4 in3 * temp5 4
++++++ + UIC5 in4 * temp6 5
++++++ + 3.3V in5 N/A
++++++ +
++++++ + Note that the BIOS may set the configuration register to a different value
++++++ + to match the motherboard configuration.
++++++ + */
++++++ +
++++++ + /* fans numbered 0-1 */
++++++ + #define VT8231_REG_FAN_MIN(nr) (0x3b + (nr))
++++++ + #define VT8231_REG_FAN(nr) (0x29 + (nr))
++++++ +
++++++ + /* Voltage inputs numbered 0-5 */
++++++ +
++++++ + static const u8 regvolt[] = { 0x21, 0x22, 0x23, 0x24, 0x25, 0x26 };
++++++ + static const u8 regvoltmax[] = { 0x3d, 0x2b, 0x2d, 0x2f, 0x31, 0x33 };
++++++ + static const u8 regvoltmin[] = { 0x3e, 0x2c, 0x2e, 0x30, 0x32, 0x34 };
++++++ +
++++++ + /* Temperatures are numbered 1-6 according to the Linux kernel specification.
++++++ + **
++++++ + ** In the VIA datasheet, however, the temperatures are numbered from zero.
++++++ + ** Since it is important that this driver can easily be compared to the VIA
++++++ + ** datasheet, we will use the VIA numbering within this driver and map the
++++++ + ** kernel sysfs device name to the VIA number in the sysfs callback.
++++++ + */
++++++ +
++++++ + #define VT8231_REG_TEMP_LOW01 0x49
++++++ + #define VT8231_REG_TEMP_LOW25 0x4d
++++++ +
++++++ + static const u8 regtemp[] = { 0x1f, 0x21, 0x22, 0x23, 0x24, 0x25 };
++++++ + static const u8 regtempmax[] = { 0x39, 0x3d, 0x2b, 0x2d, 0x2f, 0x31 };
++++++ + static const u8 regtempmin[] = { 0x3a, 0x3e, 0x2c, 0x2e, 0x30, 0x32 };
++++++ +
++++++ + #define TEMP_FROM_REG(reg) (((253 * 4 - (reg)) * 550 + 105) / 210)
++++++ + #define TEMP_MAXMIN_FROM_REG(reg) (((253 - (reg)) * 2200 + 105) / 210)
++++++ + #define TEMP_MAXMIN_TO_REG(val) (253 - ((val) * 210 + 1100) / 2200)
++++++ +
++++++ + #define VT8231_REG_CONFIG 0x40
++++++ + #define VT8231_REG_ALARM1 0x41
++++++ + #define VT8231_REG_ALARM2 0x42
++++++ + #define VT8231_REG_FANDIV 0x47
++++++ + #define VT8231_REG_UCH_CONFIG 0x4a
++++++ + #define VT8231_REG_TEMP1_CONFIG 0x4b
++++++ + #define VT8231_REG_TEMP2_CONFIG 0x4c
++++++ +
++++++ + /* temps 0-5 as numbered in VIA datasheet - see later for mapping to Linux
++++++ + ** numbering
++++++ + */
++++++ + #define ISTEMP(i, ch_config) ((i) == 0 ? 1 : \
++++++ + ((ch_config) >> ((i)+1)) & 0x01)
++++++ + /* voltages 0-5 */
++++++ + #define ISVOLT(i, ch_config) ((i) == 5 ? 1 : \
++++++ + !(((ch_config) >> ((i)+2)) & 0x01))
++++++ +
++++++ + #define DIV_FROM_REG(val) (1 << (val))
++++++ +
++++++ + /* NB The values returned here are NOT temperatures. The calibration curves
++++++ + ** for the thermistor curves are board-specific and must go in the
++++++ + ** sensors.conf file. Temperature sensors are actually ten bits, but the
++++++ + ** VIA datasheet only considers the 8 MSBs obtained from the regtemp[]
++++++ + ** register. The temperature value returned should have a magnitude of 3,
++++++ + ** so we use the VIA scaling as the "true" scaling and use the remaining 2
++++++ + ** LSBs as fractional precision.
++++++ + **
++++++ + ** All the on-chip hardware temperature comparisons for the alarms are only
++++++ + ** 8-bits wide, and compare against the 8 MSBs of the temperature. The bits
++++++ + ** in the registers VT8231_REG_TEMP_LOW01 and VT8231_REG_TEMP_LOW25 are
++++++ + ** ignored.
++++++ + */
++++++ +
++++++ + /******** FAN RPM CONVERSIONS ********
++++++ + ** This chip saturates back at 0, not at 255 like many the other chips.
++++++ + ** So, 0 means 0 RPM
++++++ + */
++++++ + static inline u8 FAN_TO_REG(long rpm, int div)
++++++ + {
++++++ + if (rpm == 0)
++++++ + return 0;
++++++ + return SENSORS_LIMIT(1310720 / (rpm * div), 1, 255);
++++++ + }
++++++ +
++++++ + #define FAN_FROM_REG(val, div) ((val) == 0 ? 0 : 1310720 / ((val) * (div)))
++++++ +
++++++ + struct vt8231_data {
++++++ + struct i2c_client client;
++++++ + struct semaphore update_lock;
++++++ + struct class_device *class_dev;
++++++ + char valid; /* !=0 if following fields are valid */
++++++ + unsigned long last_updated; /* In jiffies */
++++++ +
++++++ + u8 in[6]; /* Register value */
++++++ + u8 in_max[6]; /* Register value */
++++++ + u8 in_min[6]; /* Register value */
++++++ + u16 temp[6]; /* Register value 10 bit, right aligned */
++++++ + u8 temp_max[6]; /* Register value */
++++++ + u8 temp_min[6]; /* Register value */
++++++ + u8 fan[2]; /* Register value */
++++++ + u8 fan_min[2]; /* Register value */
++++++ + u8 fan_div[2]; /* Register encoding, shifted right */
++++++ + u16 alarms; /* Register encoding */
++++++ + u8 uch_config;
++++++ + };
++++++ +
++++++ + static struct pci_dev *s_bridge;
++++++ + static int vt8231_detect(struct i2c_adapter *adapter);
++++++ + static int vt8231_detach_client(struct i2c_client *client);
++++++ + static struct vt8231_data *vt8231_update_device(struct device *dev);
++++++ + static void vt8231_init_client(struct i2c_client *client);
++++++ +
++++++ + static inline int vt8231_read_value(struct i2c_client *client, u8 reg)
++++++ + {
++++++ + return inb_p(client->addr + reg);
++++++ + }
++++++ +
++++++ + static inline void vt8231_write_value(struct i2c_client *client, u8 reg,
++++++ + u8 value)
++++++ + {
++++++ + outb_p(value, client->addr + reg);
++++++ + }
++++++ +
++++++ + /* following are the sysfs callback functions */
++++++ + static ssize_t show_in(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ +
++++++ + return sprintf(buf, "%d\n", ((data->in[nr] - 3) * 10000) / 958);
++++++ + }
++++++ +
++++++ + static ssize_t show_in_min(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ +
++++++ + return sprintf(buf, "%d\n", ((data->in_min[nr] - 3) * 10000) / 958);
++++++ + }
++++++ +
++++++ + static ssize_t show_in_max(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ +
++++++ + return sprintf(buf, "%d\n", (((data->in_max[nr] - 3) * 10000) / 958));
++++++ + }
++++++ +
++++++ + static ssize_t set_in_min(struct device *dev, struct device_attribute *attr,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct i2c_client *client = to_i2c_client(dev);
++++++ + struct vt8231_data *data = i2c_get_clientdata(client);
++++++ + unsigned long val = simple_strtoul(buf, NULL, 10);
++++++ +
++++++ + down(&data->update_lock);
++++++ + data->in_min[nr] = SENSORS_LIMIT(((val * 958) / 10000) + 3, 0, 255);
++++++ + vt8231_write_value(client, regvoltmin[nr], data->in_min[nr]);
++++++ + up(&data->update_lock);
++++++ + return count;
++++++ + }
++++++ +
++++++ + static ssize_t set_in_max(struct device *dev, struct device_attribute *attr,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct i2c_client *client = to_i2c_client(dev);
++++++ + struct vt8231_data *data = i2c_get_clientdata(client);
++++++ + unsigned long val = simple_strtoul(buf, NULL, 10);
++++++ +
++++++ + down(&data->update_lock);
++++++ + data->in_max[nr] = SENSORS_LIMIT(((val * 958) / 10000) + 3, 0, 255);
++++++ + vt8231_write_value(client, regvoltmax[nr], data->in_max[nr]);
++++++ + up(&data->update_lock);
++++++ + return count;
++++++ + }
++++++ +
++++++ + /* Special case for input 5 as this has 3.3V scaling built into the chip */
++++++ + static ssize_t show_in5(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ +
++++++ + return sprintf(buf, "%d\n",
++++++ + (((data->in[5] - 3) * 10000 * 54) / (958 * 34)));
++++++ + }
++++++ +
++++++ + static ssize_t show_in5_min(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ +
++++++ + return sprintf(buf, "%d\n",
++++++ + (((data->in_min[5] - 3) * 10000 * 54) / (958 * 34)));
++++++ + }
++++++ +
++++++ + static ssize_t show_in5_max(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ +
++++++ + return sprintf(buf, "%d\n",
++++++ + (((data->in_max[5] - 3) * 10000 * 54) / (958 * 34)));
++++++ + }
++++++ +
++++++ + static ssize_t set_in5_min(struct device *dev, struct device_attribute *attr,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct i2c_client *client = to_i2c_client(dev);
++++++ + struct vt8231_data *data = i2c_get_clientdata(client);
++++++ + unsigned long val = simple_strtoul(buf, NULL, 10);
++++++ +
++++++ + down(&data->update_lock);
++++++ + data->in_min[5] = SENSORS_LIMIT(((val * 958 * 34) / (10000 * 54)) + 3,
++++++ + 0, 255);
++++++ + vt8231_write_value(client, regvoltmin[5], data->in_min[5]);
++++++ + up(&data->update_lock);
++++++ + return count;
++++++ + }
++++++ +
++++++ + static ssize_t set_in5_max(struct device *dev, struct device_attribute *attr,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct i2c_client *client = to_i2c_client(dev);
++++++ + struct vt8231_data *data = i2c_get_clientdata(client);
++++++ + unsigned long val = simple_strtoul(buf, NULL, 10);
++++++ +
++++++ + down(&data->update_lock);
++++++ + data->in_max[5] = SENSORS_LIMIT(((val * 958 * 34) / (10000 * 54)) + 3,
++++++ + 0, 255);
++++++ + vt8231_write_value(client, regvoltmax[5], data->in_max[5]);
++++++ + up(&data->update_lock);
++++++ + return count;
++++++ + }
++++++ +
++++++ + #define define_voltage_sysfs(offset) \
++++++ + static SENSOR_DEVICE_ATTR(in##offset##_input, S_IRUGO, \
++++++ + show_in, NULL, offset); \
++++++ + static SENSOR_DEVICE_ATTR(in##offset##_min, S_IRUGO | S_IWUSR, \
++++++ + show_in_min, set_in_min, offset); \
++++++ + static SENSOR_DEVICE_ATTR(in##offset##_max, S_IRUGO | S_IWUSR, \
++++++ + show_in_max, set_in_max, offset)
++++++ +
++++++ + define_voltage_sysfs(0);
++++++ + define_voltage_sysfs(1);
++++++ + define_voltage_sysfs(2);
++++++ + define_voltage_sysfs(3);
++++++ + define_voltage_sysfs(4);
++++++ +
++++++ + static DEVICE_ATTR(in5_input, S_IRUGO, show_in5, NULL);
++++++ + static DEVICE_ATTR(in5_min, S_IRUGO | S_IWUSR, show_in5_min, set_in5_min);
++++++ + static DEVICE_ATTR(in5_max, S_IRUGO | S_IWUSR, show_in5_max, set_in5_max);
++++++ +
++++++ + /* Temperatures */
++++++ + static ssize_t show_temp0(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ + return sprintf(buf, "%d\n", data->temp[0] * 250);
++++++ + }
++++++ +
++++++ + static ssize_t show_temp0_max(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ + return sprintf(buf, "%d\n", data->temp_max[0] * 1000);
++++++ + }
++++++ +
++++++ + static ssize_t show_temp0_min(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ + return sprintf(buf, "%d\n", data->temp_min[0] * 1000);
++++++ + }
++++++ +
++++++ + static ssize_t set_temp0_max(struct device *dev, struct device_attribute *attr,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct i2c_client *client = to_i2c_client(dev);
++++++ + struct vt8231_data *data = i2c_get_clientdata(client);
++++++ + int val = simple_strtol(buf, NULL, 10);
++++++ +
++++++ + down(&data->update_lock);
++++++ + data->temp_max[0] = SENSORS_LIMIT((val + 500) / 1000, 0, 255);
++++++ + vt8231_write_value(client, regtempmax[0], data->temp_max[0]);
++++++ + up(&data->update_lock);
++++++ + return count;
++++++ + }
++++++ + static ssize_t set_temp0_min(struct device *dev, struct device_attribute *attr,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct i2c_client *client = to_i2c_client(dev);
++++++ + struct vt8231_data *data = i2c_get_clientdata(client);
++++++ + int val = simple_strtol(buf, NULL, 10);
++++++ +
++++++ + down(&data->update_lock);
++++++ + data->temp_min[0] = SENSORS_LIMIT((val + 500) / 1000, 0, 255);
++++++ + vt8231_write_value(client, regtempmin[0], data->temp_min[0]);
++++++ + up(&data->update_lock);
++++++ + return count;
++++++ + }
++++++ +
++++++ + static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ + return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[nr]));
++++++ + }
++++++ +
++++++ + static ssize_t show_temp_max(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ + return sprintf(buf, "%d\n", TEMP_MAXMIN_FROM_REG(data->temp_max[nr]));
++++++ + }
++++++ +
++++++ + static ssize_t show_temp_min(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ + return sprintf(buf, "%d\n", TEMP_MAXMIN_FROM_REG(data->temp_min[nr]));
++++++ + }
++++++ +
++++++ + static ssize_t set_temp_max(struct device *dev, struct device_attribute *attr,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct i2c_client *client = to_i2c_client(dev);
++++++ + struct vt8231_data *data = i2c_get_clientdata(client);
++++++ + int val = simple_strtol(buf, NULL, 10);
++++++ +
++++++ + down(&data->update_lock);
++++++ + data->temp_max[nr] = SENSORS_LIMIT(TEMP_MAXMIN_TO_REG(val), 0, 255);
++++++ + vt8231_write_value(client, regtempmax[nr], data->temp_max[nr]);
++++++ + up(&data->update_lock);
++++++ + return count;
++++++ + }
++++++ + static ssize_t set_temp_min(struct device *dev, struct device_attribute *attr,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct i2c_client *client = to_i2c_client(dev);
++++++ + struct vt8231_data *data = i2c_get_clientdata(client);
++++++ + int val = simple_strtol(buf, NULL, 10);
++++++ +
++++++ + down(&data->update_lock);
++++++ + data->temp_min[nr] = SENSORS_LIMIT(TEMP_MAXMIN_TO_REG(val), 0, 255);
++++++ + vt8231_write_value(client, regtempmin[nr], data->temp_min[nr]);
++++++ + up(&data->update_lock);
++++++ + return count;
++++++ + }
++++++ +
++++++ + /* Note that these map the Linux temperature sensor numbering (1-6) to the VIA
++++++ + ** temperature sensor numbering (0-5)
++++++ + */
++++++ + #define define_temperature_sysfs(offset) \
++++++ + static SENSOR_DEVICE_ATTR(temp##offset##_input, S_IRUGO, \
++++++ + show_temp, NULL, offset - 1); \
++++++ + static SENSOR_DEVICE_ATTR(temp##offset##_max, S_IRUGO | S_IWUSR, \
++++++ + show_temp_max, set_temp_max, offset - 1); \
++++++ + static SENSOR_DEVICE_ATTR(temp##offset##_min, S_IRUGO | S_IWUSR, \
++++++ + show_temp_min, set_temp_min, offset - 1)
++++++ +
++++++ + static DEVICE_ATTR(temp1_input, S_IRUGO, show_temp0, NULL);
++++++ + static DEVICE_ATTR(temp1_max, S_IRUGO | S_IWUSR, show_temp0_max, set_temp0_max);
++++++ + static DEVICE_ATTR(temp1_min, S_IRUGO | S_IWUSR, show_temp0_min, set_temp0_min);
++++++ +
++++++ + define_temperature_sysfs(2);
++++++ + define_temperature_sysfs(3);
++++++ + define_temperature_sysfs(4);
++++++ + define_temperature_sysfs(5);
++++++ + define_temperature_sysfs(6);
++++++ +
++++++ + #define CFG_INFO_TEMP(id) { &sensor_dev_attr_temp##id##_input.dev_attr, \
++++++ + &sensor_dev_attr_temp##id##_min.dev_attr, \
++++++ + &sensor_dev_attr_temp##id##_max.dev_attr }
++++++ + #define CFG_INFO_VOLT(id) { &sensor_dev_attr_in##id##_input.dev_attr, \
++++++ + &sensor_dev_attr_in##id##_min.dev_attr, \
++++++ + &sensor_dev_attr_in##id##_max.dev_attr }
++++++ +
++++++ + struct str_device_attr_table {
++++++ + struct device_attribute *input;
++++++ + struct device_attribute *min;
++++++ + struct device_attribute *max;
++++++ + };
++++++ +
++++++ + static struct str_device_attr_table cfg_info_temp[] = {
++++++ + { &dev_attr_temp1_input, &dev_attr_temp1_min, &dev_attr_temp1_max },
++++++ + CFG_INFO_TEMP(2),
++++++ + CFG_INFO_TEMP(3),
++++++ + CFG_INFO_TEMP(4),
++++++ + CFG_INFO_TEMP(5),
++++++ + CFG_INFO_TEMP(6)
++++++ + };
++++++ +
++++++ + static struct str_device_attr_table cfg_info_volt[] = {
++++++ + CFG_INFO_VOLT(0),
++++++ + CFG_INFO_VOLT(1),
++++++ + CFG_INFO_VOLT(2),
++++++ + CFG_INFO_VOLT(3),
++++++ + CFG_INFO_VOLT(4),
++++++ + { &dev_attr_in5_input, &dev_attr_in5_min, &dev_attr_in5_max }
++++++ + };
++++++ +
++++++ + /* Fans */
++++++ + static ssize_t show_fan(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ + return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[nr],
++++++ + DIV_FROM_REG(data->fan_div[nr])));
++++++ + }
++++++ +
++++++ + static ssize_t show_fan_min(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ + return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan_min[nr],
++++++ + DIV_FROM_REG(data->fan_div[nr])));
++++++ + }
++++++ +
++++++ + static ssize_t show_fan_div(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ + return sprintf(buf, "%d\n", DIV_FROM_REG(data->fan_div[nr]));
++++++ + }
++++++ +
++++++ + static ssize_t set_fan_min(struct device *dev, struct device_attribute *attr,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + int nr = sensor_attr->index;
++++++ + struct i2c_client *client = to_i2c_client(dev);
++++++ + struct vt8231_data *data = i2c_get_clientdata(client);
++++++ + int val = simple_strtoul(buf, NULL, 10);
++++++ +
++++++ + down(&data->update_lock);
++++++ + data->fan_min[nr] = FAN_TO_REG(val, DIV_FROM_REG(data->fan_div[nr]));
++++++ + vt8231_write_value(client, VT8231_REG_FAN_MIN(nr), data->fan_min[nr]);
++++++ + up(&data->update_lock);
++++++ + return count;
++++++ + }
++++++ +
++++++ + static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct i2c_client *client = to_i2c_client(dev);
++++++ + struct vt8231_data *data = i2c_get_clientdata(client);
++++++ + struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
++++++ + unsigned long val = simple_strtoul(buf, NULL, 10);
++++++ + int nr = sensor_attr->index;
++++++ + int old = vt8231_read_value(client, VT8231_REG_FANDIV);
++++++ + long min = FAN_FROM_REG(data->fan_min[nr],
++++++ + DIV_FROM_REG(data->fan_div[nr]));
++++++ +
++++++ + down(&data->update_lock);
++++++ + switch (val) {
++++++ + case 1: data->fan_div[nr] = 0; break;
++++++ + case 2: data->fan_div[nr] = 1; break;
++++++ + case 4: data->fan_div[nr] = 2; break;
++++++ + case 8: data->fan_div[nr] = 3; break;
++++++ + default:
++++++ + dev_err(&client->dev, "fan_div value %ld not supported."
++++++ + "Choose one of 1, 2, 4 or 8!\n", val);
++++++ + up(&data->update_lock);
++++++ + return -EINVAL;
++++++ + }
++++++ +
++++++ + /* Correct the fan minimum speed */
++++++ + data->fan_min[nr] = FAN_TO_REG(min, DIV_FROM_REG(data->fan_div[nr]));
++++++ + vt8231_write_value(client, VT8231_REG_FAN_MIN(nr), data->fan_min[nr]);
++++++ +
++++++ + old = (old & 0x0f) | (data->fan_div[1] << 6) | (data->fan_div[0] << 4);
++++++ + vt8231_write_value(client, VT8231_REG_FANDIV, old);
++++++ + up(&data->update_lock);
++++++ + return count;
++++++ + }
++++++ +
++++++ +
++++++ + #define define_fan_sysfs(offset) \
++++++ + static SENSOR_DEVICE_ATTR(fan##offset##_input, S_IRUGO, \
++++++ + show_fan, NULL, offset - 1); \
++++++ + static SENSOR_DEVICE_ATTR(fan##offset##_div, S_IRUGO | S_IWUSR, \
++++++ + show_fan_div, set_fan_div, offset - 1); \
++++++ + static SENSOR_DEVICE_ATTR(fan##offset##_min, S_IRUGO | S_IWUSR, \
++++++ + show_fan_min, set_fan_min, offset - 1)
++++++ +
++++++ + define_fan_sysfs(1);
++++++ + define_fan_sysfs(2);
++++++ +
++++++ + /* Alarms */
++++++ + static ssize_t show_alarms(struct device *dev, struct device_attribute *attr,
++++++ + char *buf)
++++++ + {
++++++ + struct vt8231_data *data = vt8231_update_device(dev);
++++++ + return sprintf(buf, "%d\n", data->alarms);
++++++ + }
++++++ +
++++++ + static DEVICE_ATTR(alarms, S_IRUGO, show_alarms, NULL);
++++++ +
++++++ + static struct i2c_driver vt8231_driver = {
++++++ + .driver = {
++++++ + .name = "vt8231",
++++++ + },
++++++ + .attach_adapter = vt8231_detect,
++++++ + .detach_client = vt8231_detach_client,
++++++ + };
++++++ +
++++++ + static struct pci_device_id vt8231_pci_ids[] = {
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231_4) },
++++++ + { 0, }
++++++ + };
++++++ +
++++++ + MODULE_DEVICE_TABLE(pci, vt8231_pci_ids);
++++++ +
++++++ + static int __devinit vt8231_pci_probe(struct pci_dev *dev,
++++++ + const struct pci_device_id *id);
++++++ +
++++++ + static struct pci_driver vt8231_pci_driver = {
++++++ + .name = "vt8231",
++++++ + .id_table = vt8231_pci_ids,
++++++ + .probe = vt8231_pci_probe,
++++++ + };
++++++ +
++++++ + int vt8231_detect(struct i2c_adapter *adapter)
++++++ + {
++++++ + struct i2c_client *client;
++++++ + struct vt8231_data *data;
++++++ + int err = 0, i;
++++++ + u16 val;
++++++ +
++++++ + /* 8231 requires multiple of 256 */
++++++ + if (force_addr) {
++++++ + isa_address = force_addr & 0xFF00;
++++++ + dev_warn(&adapter->dev, "forcing ISA address 0x%04X\n",
++++++ + isa_address);
++++++ + if (PCIBIOS_SUCCESSFUL != pci_write_config_word(s_bridge,
++++++ + VT8231_BASE_REG, isa_address))
++++++ + return -ENODEV;
++++++ + }
++++++ +
++++++ + if (PCIBIOS_SUCCESSFUL !=
++++++ + pci_read_config_word(s_bridge, VT8231_ENABLE_REG, &val))
++++++ + return -ENODEV;
++++++ +
++++++ + if (!(val & 0x0001)) {
++++++ + dev_warn(&adapter->dev, "enabling sensors\n");
++++++ + if (PCIBIOS_SUCCESSFUL !=
++++++ + pci_write_config_word(s_bridge, VT8231_ENABLE_REG,
++++++ + val | 0x0001))
++++++ + return -ENODEV;
++++++ + }
++++++ +
++++++ + /* Reserve the ISA region */
++++++ + if (!request_region(isa_address, VT8231_EXTENT,
++++++ + vt8231_pci_driver.name)) {
++++++ + dev_err(&adapter->dev, "region 0x%x already in use!\n",
++++++ + isa_address);
++++++ + return -ENODEV;
++++++ + }
++++++ +
++++++ + if (!(data = kzalloc(sizeof(struct vt8231_data), GFP_KERNEL))) {
++++++ + err = -ENOMEM;
++++++ + goto exit_release;
++++++ + }
++++++ +
++++++ + client = &data->client;
++++++ + i2c_set_clientdata(client, data);
++++++ + client->addr = isa_address;
++++++ + client->adapter = adapter;
++++++ + client->driver = &vt8231_driver;
++++++ + client->dev.parent = &adapter->dev;
++++++ +
++++++ + /* Fill in the remaining client fields and put into the global list */
++++++ + strlcpy(client->name, "vt8231", I2C_NAME_SIZE);
++++++ +
++++++ + init_MUTEX(&data->update_lock);
++++++ +
++++++ + /* Tell the I2C layer a new client has arrived */
++++++ + if ((err = i2c_attach_client(client)))
++++++ + goto exit_free;
++++++ +
++++++ + vt8231_init_client(client);
++++++ +
++++++ + /* Register sysfs hooks */
++++++ + data->class_dev = hwmon_device_register(&client->dev);
++++++ + if (IS_ERR(data->class_dev)) {
++++++ + err = PTR_ERR(data->class_dev);
++++++ + goto exit_detach;
++++++ + }
++++++ +
++++++ + /* Must update device information to find out the config field */
++++++ + data->uch_config = vt8231_read_value(client, VT8231_REG_UCH_CONFIG);
++++++ +
++++++ + for (i = 0; i < ARRAY_SIZE(cfg_info_temp); i++) {
++++++ + if (ISTEMP(i, data->uch_config)) {
++++++ + device_create_file(&client->dev,
++++++ + cfg_info_temp[i].input);
++++++ + device_create_file(&client->dev, cfg_info_temp[i].max);
++++++ + device_create_file(&client->dev, cfg_info_temp[i].min);
++++++ + }
++++++ + }
++++++ +
++++++ + for (i = 0; i < ARRAY_SIZE(cfg_info_volt); i++) {
++++++ + if (ISVOLT(i, data->uch_config)) {
++++++ + device_create_file(&client->dev,
++++++ + cfg_info_volt[i].input);
++++++ + device_create_file(&client->dev, cfg_info_volt[i].max);
++++++ + device_create_file(&client->dev, cfg_info_volt[i].min);
++++++ + }
++++++ + }
++++++ +
++++++ + device_create_file(&client->dev, &sensor_dev_attr_fan1_input.dev_attr);
++++++ + device_create_file(&client->dev, &sensor_dev_attr_fan2_input.dev_attr);
++++++ + device_create_file(&client->dev, &sensor_dev_attr_fan1_min.dev_attr);
++++++ + device_create_file(&client->dev, &sensor_dev_attr_fan2_min.dev_attr);
++++++ + device_create_file(&client->dev, &sensor_dev_attr_fan1_div.dev_attr);
++++++ + device_create_file(&client->dev, &sensor_dev_attr_fan2_div.dev_attr);
++++++ +
++++++ + device_create_file(&client->dev, &dev_attr_alarms);
++++++ + return 0;
++++++ +
++++++ + exit_detach:
++++++ + i2c_detach_client(client);
++++++ + exit_free:
++++++ + kfree(data);
++++++ + exit_release:
++++++ + release_region(isa_address, VT8231_EXTENT);
++++++ + return err;
++++++ + }
++++++ +
++++++ + static int vt8231_detach_client(struct i2c_client *client)
++++++ + {
++++++ + struct vt8231_data *data = i2c_get_clientdata(client);
++++++ + int err;
++++++ +
++++++ + hwmon_device_unregister(data->class_dev);
++++++ +
++++++ + if ((err = i2c_detach_client(client))) {
++++++ + return err;
++++++ + }
++++++ +
++++++ + release_region(client->addr, VT8231_EXTENT);
++++++ + kfree(data);
++++++ +
++++++ + return 0;
++++++ + }
++++++ +
++++++ + static void vt8231_init_client(struct i2c_client *client)
++++++ + {
++++++ + vt8231_write_value(client, VT8231_REG_TEMP1_CONFIG, 0);
++++++ + vt8231_write_value(client, VT8231_REG_TEMP2_CONFIG, 0);
++++++ + }
++++++ +
++++++ + static struct vt8231_data *vt8231_update_device(struct device *dev)
++++++ + {
++++++ + struct i2c_client *client = to_i2c_client(dev);
++++++ + struct vt8231_data *data = i2c_get_clientdata(client);
++++++ + int i;
++++++ + u16 low;
++++++ +
++++++ + down(&data->update_lock);
++++++ +
++++++ + if (time_after(jiffies, data->last_updated + HZ + HZ / 2)
++++++ + || !data->valid) {
++++++ + for (i = 0; i < 6; i++) {
++++++ + if (ISVOLT(i, data->uch_config)) {
++++++ + data->in[i] = vt8231_read_value(client,
++++++ + regvolt[i]);
++++++ + data->in_min[i] = vt8231_read_value(client,
++++++ + regvoltmin[i]);
++++++ + data->in_max[i] = vt8231_read_value(client,
++++++ + regvoltmax[i]);
++++++ + }
++++++ + }
++++++ + for (i = 0; i < 2; i++) {
++++++ + data->fan[i] = vt8231_read_value(client,
++++++ + VT8231_REG_FAN(i));
++++++ + data->fan_min[i] = vt8231_read_value(client,
++++++ + VT8231_REG_FAN_MIN(i));
++++++ + }
++++++ +
++++++ + low = vt8231_read_value(client, VT8231_REG_TEMP_LOW01);
++++++ + low = (low >> 6) | ((low & 0x30) >> 2)
++++++ + | (vt8231_read_value(client, VT8231_REG_TEMP_LOW25) << 4);
++++++ + for (i = 0; i < 6; i++) {
++++++ + if (ISTEMP(i, data->uch_config)) {
++++++ + data->temp[i] = (vt8231_read_value(client,
++++++ + regtemp[i]) << 2)
++++++ + | ((low >> (2 * i)) & 0x03);
++++++ + data->temp_max[i] = vt8231_read_value(client,
++++++ + regtempmax[i]);
++++++ + data->temp_min[i] = vt8231_read_value(client,
++++++ + regtempmin[i]);
++++++ + }
++++++ + }
++++++ +
++++++ + i = vt8231_read_value(client, VT8231_REG_FANDIV);
++++++ + data->fan_div[0] = (i >> 4) & 0x03;
++++++ + data->fan_div[1] = i >> 6;
++++++ + data->alarms = vt8231_read_value(client, VT8231_REG_ALARM1) |
++++++ + (vt8231_read_value(client, VT8231_REG_ALARM2) << 8);
++++++ +
++++++ + /* Set alarm flags correctly */
++++++ + if (!data->fan[0] && data->fan_min[0]) {
++++++ + data->alarms |= 0x40;
++++++ + } else if (data->fan[0] && !data->fan_min[0]) {
++++++ + data->alarms &= ~0x40;
++++++ + }
++++++ +
++++++ + if (!data->fan[1] && data->fan_min[1]) {
++++++ + data->alarms |= 0x80;
++++++ + } else if (data->fan[1] && !data->fan_min[1]) {
++++++ + data->alarms &= ~0x80;
++++++ + }
++++++ +
++++++ + data->last_updated = jiffies;
++++++ + data->valid = 1;
++++++ + }
++++++ +
++++++ + up(&data->update_lock);
++++++ +
++++++ + return data;
++++++ + }
++++++ +
++++++ + static int __devinit vt8231_pci_probe(struct pci_dev *dev,
++++++ + const struct pci_device_id *id)
++++++ + {
++++++ + u16 val;
++++++ +
++++++ + if (PCIBIOS_SUCCESSFUL != pci_read_config_word(dev, VT8231_BASE_REG,
++++++ + &val))
++++++ + return -ENODEV;
++++++ +
++++++ + isa_address = val & ~(VT8231_EXTENT - 1);
++++++ + if (isa_address == 0 && force_addr == 0) {
++++++ + dev_err(&dev->dev, "base address not set -\
++++++ + upgrade BIOS or use force_addr=0xaddr\n");
++++++ + return -ENODEV;
++++++ + }
++++++ +
++++++ + s_bridge = pci_dev_get(dev);
++++++ +
++++++ + if (i2c_isa_add_driver(&vt8231_driver)) {
++++++ + pci_dev_put(s_bridge);
++++++ + s_bridge = NULL;
++++++ + }
++++++ +
++++++ + /* Always return failure here. This is to allow other drivers to bind
++++++ + * to this pci device. We don't really want to have control over the
++++++ + * pci device, we only wanted to read as few register values from it.
++++++ + */
++++++ + return -ENODEV;
++++++ + }
++++++ +
++++++ + static int __init sm_vt8231_init(void)
++++++ + {
- - -- return pci_module_init(&vt8231_pci_driver);
+++++++++++ return pci_register_driver(&vt8231_pci_driver);
++++++ + }
++++++ +
++++++ + static void __exit sm_vt8231_exit(void)
++++++ + {
++++++ + pci_unregister_driver(&vt8231_pci_driver);
++++++ + if (s_bridge != NULL) {
++++++ + i2c_isa_del_driver(&vt8231_driver);
++++++ + pci_dev_put(s_bridge);
++++++ + s_bridge = NULL;
++++++ + }
++++++ + }
++++++ +
++++++ + MODULE_AUTHOR("Roger Lucas <roger@planbit.co.uk>");
++++++ + MODULE_DESCRIPTION("VT8231 sensors");
++++++ + MODULE_LICENSE("GPL");
++++++ +
++++++ + module_init(sm_vt8231_init);
++++++ + module_exit(sm_vt8231_exit);
diff --cc drivers/i2c/busses/i2c-keywest.c
index 0000000,d61f748,d61f748,d61f748,d61f748,d61f748,d61f748,d61f748,d61f748,d61f748,d61f748,d61f748..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/i2c/busses/i2c-keywest.c
+++ /dev/null
diff --cc drivers/i2c/busses/i2c-keywest.h
index 0000000,c5022e1,c5022e1,c5022e1,c5022e1,c5022e1,c5022e1,c5022e1,c5022e1,c5022e1,c5022e1,c5022e1..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/i2c/busses/i2c-keywest.h
+++ /dev/null
diff --cc drivers/i2c/busses/i2c-pmac-smu.c
index 0000000,bfefe7f,bfefe7f,bfefe7f,bfefe7f,bfefe7f,bfefe7f,bfefe7f,bfefe7f,bfefe7f,bfefe7f,bfefe7f..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/i2c/busses/i2c-pmac-smu.c
+++ /dev/null
diff --cc drivers/i2c/busses/i2c-powermac.c
index df786eb,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..df786eb
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/i2c/busses/i2c-powermac.c
+++ b/drivers/i2c/busses/i2c-powermac.c
diff --cc drivers/i2c/i2c-core.c
index 0ce58b5,52b7747,82ea1b7,82ea1b7,82ea1b7,82ea1b7,82ea1b7,82ea1b7,52b7747,82ea1b7,52b7747,52b7747..0ce58b5
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@@@@@@@@@@@@ -292,8 -292,10 -295,11 -295,11 -295,11 -295,11 -295,11 -295,11 -292,10 -295,11 -292,10 -292,10 +292,8 @@@@@@@@@@@@@ int i2c_register_driver(struct module *
down(&core_lists);
/* add the driver to the list of i2c drivers in the driver core */
------ - driver->driver.owner = driver->owner;
------ - driver->driver.name = driver->name;
++++++ + driver->driver.owner = owner;
driver->driver.bus = &i2c_bus_type;
----------- driver->driver.probe = i2c_device_probe;
----------- driver->driver.remove = i2c_device_remove;
res = driver_register(&driver->driver);
if (res)
diff --cc drivers/ide/ide-disk.c
index ca25f9e,4b44172,449522f,f4e3d35,449522f,f4e3d35,f4e3d35,f4e3d35,4b44172,449522f,4b44172,4b44172..ca25f9e
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@@@@@@@@@@@@ -1006,9 -1007,11 -1038,11 -1040,9 -1038,11 -1040,9 -1040,9 -1040,9 -1007,11 -1038,11 -1007,11 -1007,11 +1006,9 @@@@@@@@@@@@@ static void ide_disk_remove(ide_drive_
del_gendisk(g);
- --- ide_disk_put(idkp);
+ +++ ide_cacheflush_p(drive);
- --- return 0;
+ +++ ide_disk_put(idkp);
-- - ----
-- - ---- return 0;
}
static void ide_disk_release(struct kref *kref)
diff --cc drivers/ide/ide-io.c
index 8d50df4,b5dc6df,ecfafcd,ecfafcd,ecfafcd,ecfafcd,ecfafcd,ecfafcd,b5dc6df,ecfafcd,b5dc6df,b5dc6df..8d50df4
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@@@@@@@@@@@@ -83,12 -83,15 -83,15 -83,15 -83,15 -83,15 -83,15 -83,15 -83,15 -83,15 -83,15 -83,15 +83,12 @@@@@@@@@@@@@ int __ide_end_request(ide_drive_t *driv
if (!end_that_request_first(rq, uptodate, nr_sectors)) {
add_disk_randomness(rq->rq_disk);
-----------
----------- if (blk_rq_tagged(rq))
----------- blk_queue_end_tag(drive->queue, rq);
-----------
blkdev_dequeue_request(rq);
HWGROUP(drive)->rq = NULL;
------ - end_that_request_last(rq);
++++++ + end_that_request_last(rq, uptodate);
ret = 0;
}
+++++++++++
return ret;
}
EXPORT_SYMBOL(__ide_end_request);
diff --cc drivers/ide/ide.c
index afeb02b,4b524f6,8af179b,8af179b,8af179b,8af179b,8af179b,8af179b,4b524f6,8af179b,4b524f6,4b524f6..afeb02b
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@@@@@@@@@@@@ -1891,100 -1904,69 -1904,9 -1904,9 -1904,9 -1904,9 -1904,9 -1904,9 -1904,69 -1904,9 -1904,69 -1904,69 +1891,100 @@@@@@@@@@@@@ static int ide_bus_match(struct device
return 1;
}
++++++ + static char *media_string(ide_drive_t *drive)
++++++ + {
++++++ + switch (drive->media) {
++++++ + case ide_disk:
++++++ + return "disk";
++++++ + case ide_cdrom:
++++++ + return "cdrom";
++++++ + case ide_tape:
++++++ + return "tape";
++++++ + case ide_floppy:
++++++ + return "floppy";
++++++ + default:
++++++ + return "UNKNOWN";
++++++ + }
++++++ + }
++++++ +
++++++ + static ssize_t media_show(struct device *dev, struct device_attribute *attr, char *buf)
++++++ + {
++++++ + ide_drive_t *drive = to_ide_device(dev);
++++++ + return sprintf(buf, "%s\n", media_string(drive));
++++++ + }
++++++ +
++++++ + static ssize_t drivename_show(struct device *dev, struct device_attribute *attr, char *buf)
++++++ + {
++++++ + ide_drive_t *drive = to_ide_device(dev);
++++++ + return sprintf(buf, "%s\n", drive->name);
++++++ + }
++++++ +
++++++ + static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf)
++++++ + {
++++++ + ide_drive_t *drive = to_ide_device(dev);
++++++ + return sprintf(buf, "ide:m-%s\n", media_string(drive));
++++++ + }
++++++ +
++++++ + static struct device_attribute ide_dev_attrs[] = {
++++++ + __ATTR_RO(media),
++++++ + __ATTR_RO(drivename),
++++++ + __ATTR_RO(modalias),
++++++ + __ATTR_NULL
++++++ + };
++++++ +
++++++ + static int ide_uevent(struct device *dev, char **envp, int num_envp,
++++++ + char *buffer, int buffer_size)
++++++ + {
++++++ + ide_drive_t *drive = to_ide_device(dev);
++++++ + int i = 0;
++++++ + int length = 0;
++++++ +
++++++ + add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length,
++++++ + "MEDIA=%s", media_string(drive));
++++++ + add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length,
++++++ + "DRIVENAME=%s", drive->name);
++++++ + add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length,
++++++ + "MODALIAS=ide:m-%s", media_string(drive));
++++++ + envp[i] = NULL;
++++++ + return 0;
++++++ + }
++++++ +
+++++++++++static int generic_ide_probe(struct device *dev)
+++++++++++{
+++++++++++ ide_drive_t *drive = to_ide_device(dev);
+++++++++++ ide_driver_t *drv = to_ide_driver(dev->driver);
+++++++++++
+++++++++++ return drv->probe ? drv->probe(drive) : -ENODEV;
+++++++++++}
+++++++++++
+++++++++++static int generic_ide_remove(struct device *dev)
+++++++++++{
+++++++++++ ide_drive_t *drive = to_ide_device(dev);
+++++++++++ ide_driver_t *drv = to_ide_driver(dev->driver);
+++++++++++
+++++++++++ if (drv->remove)
+++++++++++ drv->remove(drive);
+++++++++++
+++++++++++ return 0;
+++++++++++}
+++++++++++
+++++++++++static void generic_ide_shutdown(struct device *dev)
+++++++++++{
+++++++++++ ide_drive_t *drive = to_ide_device(dev);
+++++++++++ ide_driver_t *drv = to_ide_driver(dev->driver);
+++++++++++
+++++++++++ if (dev->driver && drv->shutdown)
+++++++++++ drv->shutdown(drive);
+++++++++++}
+++++++++++
struct bus_type ide_bus_type = {
.name = "ide",
.match = ide_bus_match,
++++++ + .uevent = ide_uevent,
+++++++++++ .probe = generic_ide_probe,
+++++++++++ .remove = generic_ide_remove,
+++++++++++ .shutdown = generic_ide_shutdown,
++++++ + .dev_attrs = ide_dev_attrs,
.suspend = generic_ide_suspend,
.resume = generic_ide_resume,
};
diff --cc drivers/ieee1394/.gitignore
index 33da10a,33da10a,0000000,0000000,0000000,0000000,0000000,0000000,33da10a,0000000,33da10a,33da10a..33da10a
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/ieee1394/.gitignore
+++ b/drivers/ieee1394/.gitignore
diff --cc drivers/ieee1394/amdtp.c
index 0000000,7589750,7589750,7589750,7589750,7589750,7589750,7589750,7589750,7589750,7589750,7589750..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/ieee1394/amdtp.c
+++ /dev/null
diff --cc drivers/ieee1394/amdtp.h
index 0000000,531f28e,531f28e,531f28e,531f28e,531f28e,531f28e,531f28e,531f28e,531f28e,531f28e,531f28e..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/ieee1394/amdtp.h
+++ /dev/null
diff --cc drivers/ieee1394/cmp.c
index 0000000,69aed26,69aed26,69aed26,69aed26,69aed26,69aed26,69aed26,69aed26,69aed26,69aed26,69aed26..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/ieee1394/cmp.c
+++ /dev/null
diff --cc drivers/ieee1394/cmp.h
index 0000000,f9288bf,f9288bf,f9288bf,f9288bf,f9288bf,f9288bf,f9288bf,f9288bf,f9288bf,f9288bf,f9288bf..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/ieee1394/cmp.h
+++ /dev/null
diff --cc drivers/ieee1394/hosts.h
index 07d188c,07d188c,38f4211,38f4211,ae9b02c,38f4211,38f4211,38f4211,07d188c,ae9b02c,07d188c,07d188c..07d188c
--- a/drivers/ieee1394/hosts.h
+++ b/drivers/ieee1394/hosts.h
@@@@@@@@@@@@@ -28,31 -28,31 -28,30 -28,30 -28,31 -28,30 -28,30 -28,30 -28,31 -28,31 -28,31 -28,31 +28,31 @@@@@@@@@@@@@ struct hpsb_host
struct timer_list timeout;
unsigned long timeout_interval;
------ - unsigned char iso_listen_count[64];
++++++ + unsigned char iso_listen_count[64];
------ - int node_count; /* number of identified nodes on this bus */
------ - int selfid_count; /* total number of SelfIDs received */
++++++ + int node_count; /* number of identified nodes on this bus */
++++++ + int selfid_count; /* total number of SelfIDs received */
int nodes_active; /* number of nodes that are actually active */
------ - nodeid_t node_id; /* node ID of this host */
------ - nodeid_t irm_id; /* ID of this bus' isochronous resource manager */
------ - nodeid_t busmgr_id; /* ID of this bus' bus manager */
++++++ + nodeid_t node_id; /* node ID of this host */
++++++ + nodeid_t irm_id; /* ID of this bus' isochronous resource manager */
++++++ + nodeid_t busmgr_id; /* ID of this bus' bus manager */
------ - /* this nodes state */
------ - unsigned in_bus_reset:1;
------ - unsigned is_shutdown:1;
++++++ + /* this nodes state */
++++++ + unsigned in_bus_reset:1;
++++++ + unsigned is_shutdown:1;
++ +++ unsigned resume_packet_sent:1;
------ - /* this nodes' duties on the bus */
------ - unsigned is_root:1;
------ - unsigned is_cycmst:1;
------ - unsigned is_irm:1;
------ - unsigned is_busmgr:1;
++++++ + /* this nodes' duties on the bus */
++++++ + unsigned is_root:1;
++++++ + unsigned is_cycmst:1;
++++++ + unsigned is_irm:1;
++++++ + unsigned is_busmgr:1;
------ - int reset_retries;
------ - quadlet_t *topology_map;
------ - u8 *speed_map;
------ - struct csr_control csr;
++++++ + int reset_retries;
++++++ + quadlet_t *topology_map;
++++++ + u8 *speed_map;
++++++ + struct csr_control csr;
/* Per node tlabel pool allocation */
struct hpsb_tlabel_pool tpool[64];
diff --cc drivers/ieee1394/nodemgr.c
index 082c7fd,082c7fd,7fff5a1,7fff5a1,0ea37b1,7fff5a1,7fff5a1,7fff5a1,082c7fd,0ea37b1,082c7fd,082c7fd..082c7fd
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@@@@@@@@@@@@ -1453,26 -1453,26 -1413,9 -1413,9 -1442,25 -1413,9 -1413,9 -1413,9 -1453,26 -1442,25 -1453,26 -1453,26 +1453,26 @@@@@@@@@@@@@ static void nodemgr_node_probe(struct h
return;
}
-- --- /* Because we are a 1394a-2000 compliant IRM, we need to inform all the other
-- --- * nodes of the broadcast channel. (Really we're only setting the validity
-- --- * bit). Other IRM responsibilities go in here as well. */
++ +++ static int nodemgr_send_resume_packet(struct hpsb_host *host)
++ +++ {
++ +++ struct hpsb_packet *packet;
++ +++ int ret = 1;
++ +++
++ +++ packet = hpsb_make_phypacket(host,
- - 0x003c0000 | NODEID_TO_NODE(host->node_id) << 24);
++++++ + EXTPHYPACKET_TYPE_RESUME |
++++++ + NODEID_TO_NODE(host->node_id) << PHYPACKET_PORT_SHIFT);
++ +++ if (packet) {
++ +++ packet->no_waiter = 1;
++ +++ packet->generation = get_hpsb_generation(host);
++ +++ ret = hpsb_send_packet(packet);
++ +++ }
++ +++ if (ret)
++ +++ HPSB_WARN("fw-host%d: Failed to broadcast resume packet",
++ +++ host->id);
++ +++ return ret;
++ +++ }
++ +++
++ +++ /* Perform a few high-level IRM responsibilities. */
static int nodemgr_do_irm_duties(struct hpsb_host *host, int cycles)
{
quadlet_t bc;
diff --cc drivers/infiniband/core/sysfs.c
index 5982d68,1f1743c,08648b1,08648b1,08648b1,08648b1,08648b1,08648b1,1f1743c,08648b1,1f1743c,1f1743c..5982d68
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@@@@@@@@@@@@ -445,7 -445,13 -445,13 -445,13 -445,13 -445,13 -445,13 -445,13 -445,13 -445,13 -445,13 -445,13 +445,7 @@@@@@@@@@@@@ static int ib_device_uevent(struct clas
return -ENOMEM;
/*
- - -- * It might be nice to pass the node GUID with the event, but
------ - * It might be nice to pass the node GUID to hotplug, but
----------- * right now the only way to get it is to query the device
----------- * provider, and this can crash during device removal because
----------- * we are will be running after driver removal has started.
----------- * We could add a node_guid field to struct ib_device, or we
- - -- * could just let userspace read the node GUID from sysfs when
- - -- * devices are added.
------ - * could just let the hotplug script read the node GUID from
------ - * sysfs when devices are added.
+++++++++++ * It would be nice to pass the node GUID with the event...
*/
envp[i] = NULL;
diff --cc drivers/infiniband/core/uverbs_cmd.c
index 407b628,a57d021,a57d021,ed45da8,a57d021,ed45da8,ed45da8,ed45da8,a57d021,a57d021,a57d021,a57d021..407b628
--- a/drivers/infiniband/core/uverbs_cmd.c
+++ b/drivers/infiniband/core/uverbs_cmd.c
@@@@@@@@@@@@@ -930,11 -922,11 -922,11 -921,11 -922,11 -921,11 -921,11 -921,11 -922,11 -922,11 -922,11 -922,11 +930,11 @@@@@@@@@@@@@ retry
goto err_idr;
}
----------- down(&file->mutex);
- --- list_add_tail(&uobj->uobject.list, &file->ucontext->qp_list);
- --- up(&file->mutex);
+++++++++++ mutex_lock(&file->mutex);
+ +++ list_add_tail(&uobj->uevent.uobject.list, &file->ucontext->qp_list);
-- - ---- up(&file->mutex);
+++++++++++ mutex_unlock(&file->mutex);
----------- up(&ib_uverbs_idr_mutex);
+++++++++++ mutex_unlock(&ib_uverbs_idr_mutex);
return in_len;
@@@@@@@@@@@@@ -1073,13 -1060,13 -1060,13 -1054,13 -1060,13 -1054,13 -1054,13 -1054,13 -1060,13 -1060,13 -1060,13 -1060,13 +1073,13 @@@@@@@@@@@@@ ssize_t ib_uverbs_destroy_qp(struct ib_
idr_remove(&ib_uverbs_qp_idr, cmd.qp_handle);
----------- down(&file->mutex);
- --- list_del(&uobj->uobject.list);
- --- up(&file->mutex);
+++++++++++ mutex_lock(&file->mutex);
+ +++ list_del(&uobj->uevent.uobject.list);
-- - ---- up(&file->mutex);
+++++++++++ mutex_unlock(&file->mutex);
- --- ib_uverbs_release_uevent(file, uobj);
+ +++ ib_uverbs_release_uevent(file, &uobj->uevent);
- --- resp.events_reported = uobj->events_reported;
+ +++ resp.events_reported = uobj->uevent.events_reported;
kfree(uobj);
@@@@@@@@@@@@@ -1569,40 -1555,40 -1555,40 -1547,13 -1555,40 -1547,13 -1547,13 -1547,13 -1555,40 -1555,40 -1555,40 -1555,40 +1569,40 @@@@@@@@@@@@@ ssize_t ib_uverbs_attach_mcast(struct i
if (copy_from_user(&cmd, buf, sizeof cmd))
return -EFAULT;
----------- down(&ib_uverbs_idr_mutex);
+++++++++++ mutex_lock(&ib_uverbs_idr_mutex);
qp = idr_find(&ib_uverbs_qp_idr, cmd.qp_handle);
- --- if (qp && qp->uobject->context == file->ucontext)
- --- ret = ib_attach_mcast(qp, (union ib_gid *) cmd.gid, cmd.mlid);
+ +++ if (!qp || qp->uobject->context != file->ucontext)
+ +++ goto out;
- --- up(&ib_uverbs_idr_mutex);
+ +++ uobj = container_of(qp->uobject, struct ib_uqp_object, uevent.uobject);
+ +++
+ +++ list_for_each_entry(mcast, &uobj->mcast_list, list)
+ +++ if (cmd.mlid == mcast->lid &&
+ +++ !memcmp(cmd.gid, mcast->gid.raw, sizeof mcast->gid.raw)) {
+ +++ ret = 0;
+ +++ goto out;
+ +++ }
+ +++
+ +++ mcast = kmalloc(sizeof *mcast, GFP_KERNEL);
+ +++ if (!mcast) {
+ +++ ret = -ENOMEM;
+ +++ goto out;
+ +++ }
+ +++
+ +++ mcast->lid = cmd.mlid;
+ +++ memcpy(mcast->gid.raw, cmd.gid, sizeof mcast->gid.raw);
+ +++
+ +++ ret = ib_attach_mcast(qp, &mcast->gid, cmd.mlid);
+ +++ if (!ret) {
+ +++ uobj = container_of(qp->uobject, struct ib_uqp_object,
+ +++ uevent.uobject);
+ +++ list_add_tail(&mcast->list, &uobj->mcast_list);
+ +++ } else
+ +++ kfree(mcast);
+ +++
+ +++ out:
-- - ---- up(&ib_uverbs_idr_mutex);
+++++++++++ mutex_unlock(&ib_uverbs_idr_mutex);
return ret ? ret : in_len;
}
@@@@@@@@@@@@@ -1620,28 -1606,28 -1606,28 -1569,13 -1606,28 -1569,13 -1569,13 -1569,13 -1606,28 -1606,28 -1606,28 -1606,28 +1620,28 @@@@@@@@@@@@@ ssize_t ib_uverbs_detach_mcast(struct i
if (copy_from_user(&cmd, buf, sizeof cmd))
return -EFAULT;
----------- down(&ib_uverbs_idr_mutex);
+++++++++++ mutex_lock(&ib_uverbs_idr_mutex);
qp = idr_find(&ib_uverbs_qp_idr, cmd.qp_handle);
- --- if (qp && qp->uobject->context == file->ucontext)
- --- ret = ib_detach_mcast(qp, (union ib_gid *) cmd.gid, cmd.mlid);
+ +++ if (!qp || qp->uobject->context != file->ucontext)
+ +++ goto out;
+ +++
+ +++ ret = ib_detach_mcast(qp, (union ib_gid *) cmd.gid, cmd.mlid);
+ +++ if (ret)
+ +++ goto out;
+ +++
+ +++ uobj = container_of(qp->uobject, struct ib_uqp_object, uevent.uobject);
- --- up(&ib_uverbs_idr_mutex);
+ +++ list_for_each_entry(mcast, &uobj->mcast_list, list)
+ +++ if (cmd.mlid == mcast->lid &&
+ +++ !memcmp(cmd.gid, mcast->gid.raw, sizeof mcast->gid.raw)) {
+ +++ list_del(&mcast->list);
+ +++ kfree(mcast);
+ +++ break;
+ +++ }
+ +++
+ +++ out:
-- - ---- up(&ib_uverbs_idr_mutex);
+++++++++++ mutex_unlock(&ib_uverbs_idr_mutex);
return ret ? ret : in_len;
}
diff --cc drivers/infiniband/hw/mthca/mthca_qp.c
index fba608e,7450550,7450550,dd4e133,7450550,dd4e133,dd4e133,dd4e133,7450550,7450550,7450550,7450550..fba608e
--- a/drivers/infiniband/hw/mthca/mthca_qp.c
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c
@@@@@@@@@@@@@ -795,19 -729,71 -729,71 -729,71 -729,71 -729,71 -729,71 -729,71 -729,71 -729,71 -729,71 -729,71 +795,19 @@@@@@@@@@@@@ int mthca_modify_qp(struct ib_qp *ibqp
qp_context->snd_db_index = cpu_to_be32(qp->sq.db_index);
}
----------- if (attr_mask & IB_QP_ACCESS_FLAGS) {
----------- qp_context->params2 |=
----------- cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_WRITE ?
----------- MTHCA_QP_BIT_RWE : 0);
-----------
----------- /*
----------- * Only enable RDMA reads and atomics if we have
----------- * responder resources set to a non-zero value.
----------- */
----------- if (qp->resp_depth) {
----------- qp_context->params2 |=
----------- cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_READ ?
----------- MTHCA_QP_BIT_RRE : 0);
----------- qp_context->params2 |=
----------- cpu_to_be32(attr->qp_access_flags & IB_ACCESS_REMOTE_ATOMIC ?
----------- MTHCA_QP_BIT_RAE : 0);
----------- }
-----------
----------- qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RWE |
----------- MTHCA_QP_OPTPAR_RRE |
----------- MTHCA_QP_OPTPAR_RAE);
-----------
----------- qp->atomic_rd_en = attr->qp_access_flags;
----------- }
-----------
if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC) {
----------- u8 rra_max;
-----------
----------- if (qp->resp_depth && !attr->max_dest_rd_atomic) {
----------- /*
----------- * Lowering our responder resources to zero.
----------- * Turn off reads RDMA and atomics as responder.
----------- * (RRE/RAE in params2 already zero)
----------- */
----------- qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRE |
----------- MTHCA_QP_OPTPAR_RAE);
----------- }
-----------
----------- if (!qp->resp_depth && attr->max_dest_rd_atomic) {
----------- /*
----------- * Increasing our responder resources from
----------- * zero. Turn on RDMA reads and atomics as
----------- * appropriate.
----------- */
- --- qp_context->params2 |=
- --- cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_READ ?
- --- MTHCA_QP_BIT_RRE : 0);
+++++++++++ if (attr->max_dest_rd_atomic)
qp_context->params2 |=
-- - ---- cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_READ ?
-- - ---- MTHCA_QP_BIT_RRE : 0);
-- - ---- qp_context->params2 |=
----------- cpu_to_be32(qp->atomic_rd_en & IB_ACCESS_REMOTE_ATOMIC ?
----------- MTHCA_QP_BIT_RAE : 0);
-- - ----
-- - ---- qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRE |
-- - ---- MTHCA_QP_OPTPAR_RAE);
-- - ---- }
+++++++++++ cpu_to_be32(fls(attr->max_dest_rd_atomic - 1) << 21);
- --- qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRE |
- --- MTHCA_QP_OPTPAR_RAE);
- --- }
- ---
----------- for (rra_max = 0;
----------- 1 << rra_max < attr->max_dest_rd_atomic &&
----------- rra_max < dev->qp_table.rdb_shift;
----------- ++rra_max)
----------- ; /* nothing */
-----------
----------- qp_context->params2 |= cpu_to_be32(rra_max << 21);
qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RRA_MAX);
+++++++++++ }
----------- qp->resp_depth = attr->max_dest_rd_atomic;
+++++++++++ if (attr_mask & (IB_QP_ACCESS_FLAGS | IB_QP_MAX_DEST_RD_ATOMIC)) {
+++++++++++ qp_context->params2 |= get_hw_access_flags(qp, attr, attr_mask);
+++++++++++ qp_param->opt_param_mask |= cpu_to_be32(MTHCA_QP_OPTPAR_RWE |
+++++++++++ MTHCA_QP_OPTPAR_RRE |
+++++++++++ MTHCA_QP_OPTPAR_RAE);
}
qp_context->params2 |= cpu_to_be32(MTHCA_QP_BIT_RSC);
diff --cc drivers/infiniband/ulp/ipoib/ipoib_ib.c
index 86bcdd7,2388580,2388580,54ef2fe,2388580,54ef2fe,54ef2fe,54ef2fe,2388580,2388580,2388580,2388580..86bcdd7
--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
@@@@@@@@@@@@@ -599,13 -608,13 -608,13 -608,9 -608,13 -608,9 -608,9 -608,9 -608,13 -608,13 -608,13 -608,13 +599,13 @@@@@@@@@@@@@ void ipoib_ib_dev_flush(void *_dev
if (test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags))
ipoib_ib_dev_up(dev);
-- - ---- down(&priv->vlan_mutex);
+++++++++++ mutex_lock(&priv->vlan_mutex);
+ +++
/* Flush any child interfaces too */
list_for_each_entry(cpriv, &priv->child_intfs, list)
ipoib_ib_dev_flush(&cpriv->dev);
+ +++
-- - ---- up(&priv->vlan_mutex);
+++++++++++ mutex_unlock(&priv->vlan_mutex);
}
void ipoib_ib_dev_cleanup(struct net_device *dev)
diff --cc drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 98039da,ed0c2ea,ef3ee03,c33ed87,ef3ee03,c33ed87,c33ed87,c33ed87,ed0c2ea,ef3ee03,ed0c2ea,ed0c2ea..98039da
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@@@@@@@@@@@@ -748,11 -747,27 -745,27 -747,27 -745,27 -747,27 -747,27 -747,27 -747,27 -745,27 -747,27 -747,27 +748,11 @@@@@@@@@@@@@ void ipoib_mcast_dev_flush(struct net_d
ipoib_dbg_mcast(priv, "flushing multicast list\n");
spin_lock_irqsave(&priv->lock, flags);
----------- list_for_each_entry_safe(mcast, tmcast, &priv->multicast_list, list) {
----------- nmcast = ipoib_mcast_alloc(dev, 0);
----------- if (nmcast) {
----------- nmcast->flags =
----------- mcast->flags & (1 << IPOIB_MCAST_FLAG_SENDONLY);
------ -
------ - nmcast->mcmember.mgid = mcast->mcmember.mgid;
------ -
------ - /* Add the new group in before the to-be-destroyed group */
------ - list_add_tail(&nmcast->list, &mcast->list);
------ - list_del_init(&mcast->list);
------ -
------ - rb_replace_node(&mcast->rb_node, &nmcast->rb_node,
------ - &priv->multicast_tree);
- - -- nmcast->mcmember.mgid = mcast->mcmember.mgid;
- - --
- - -- /* Add the new group in before the to-be-destroyed group */
- - -- list_add_tail(&nmcast->list, &mcast->list);
- - -- list_del_init(&mcast->list);
- - --
- - -- rb_replace_node(&mcast->rb_node, &nmcast->rb_node,
- - -- &priv->multicast_tree);
- - --
----------- list_add_tail(&mcast->list, &remove_list);
----------- } else {
----------- ipoib_warn(priv, "could not reallocate multicast group "
----------- IPOIB_GID_FMT "\n",
----------- IPOIB_GID_ARG(mcast->mcmember.mgid));
----------- }
+++++++++++ list_for_each_entry_safe(mcast, tmcast, &priv->multicast_list, list) {
+++++++++++ list_del(&mcast->list);
+++++++++++ rb_erase(&mcast->rb_node, &priv->multicast_tree);
+++++++++++ list_add_tail(&mcast->list, &remove_list);
}
if (priv->broadcast) {
diff --cc drivers/input/evdev.c
index 745979f,a1e660e,9f2352b,9f2352b,9f2352b,9f2352b,9f2352b,9f2352b,a1e660e,9f2352b,a1e660e,a1e660e..745979f
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@@@@@@@@@@@@ -154,13 -153,11 -153,11 -153,11 -153,11 -153,11 -153,11 -153,11 -153,11 -153,11 -153,11 -153,11 +154,13 @@@@@@@@@@@@@ struct input_event_compat
__s32 value;
};
+++++++++++/* Note to the author of this code: did it ever occur to
+++++++++++ you why the ifdefs are needed? Think about it again. -AK */
#ifdef CONFIG_X86_64
-----------# define COMPAT_TEST test_thread_flag(TIF_IA32)
+++++++++++# define COMPAT_TEST is_compat_task()
#elif defined(CONFIG_IA64)
-----------# define COMPAT_TEST IS_IA32_PROCESS(ia64_task_regs(current))
------ - #elif defined(CONFIG_ARCH_S390)
+++++++++++# define COMPAT_TEST IS_IA32_PROCESS(task_pt_regs(current))
++++++ + #elif defined(CONFIG_S390)
# define COMPAT_TEST test_thread_flag(TIF_31BIT)
#elif defined(CONFIG_MIPS)
# define COMPAT_TEST (current->thread.mflags & MF_32BIT_ADDR)
diff --cc drivers/input/input.c
index 4fe3da3,ef5824c,bdd2a7f,bdd2a7f,bdd2a7f,bdd2a7f,bdd2a7f,bdd2a7f,ef5824c,bdd2a7f,ef5824c,ef5824c..4fe3da3
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@@@@@@@@@@@@ -528,60 -528,44 -529,6 -529,6 -529,6 -529,6 -529,6 -529,6 -528,44 -529,6 -528,44 -528,44 +528,60 @@@@@@@@@@@@@ INPUT_DEV_STRING_ATTR_SHOW(name)
INPUT_DEV_STRING_ATTR_SHOW(phys);
INPUT_DEV_STRING_ATTR_SHOW(uniq);
- - --static int print_modalias_bits(char *buf, char prefix, unsigned long *arr,
+++++++++++static int print_modalias_bits(char *buf, int size, char prefix, unsigned long *arr,
++++++ + unsigned int min, unsigned int max)
++++++ + {
++++++ + int len, i;
++++++ +
- - -- len = sprintf(buf, "%c", prefix);
+++++++++++ len = snprintf(buf, size, "%c", prefix);
++++++ + for (i = min; i < max; i++)
++++++ + if (arr[LONG(i)] & BIT(i))
- - -- len += sprintf(buf+len, "%X,", i);
+++++++++++ len += snprintf(buf + len, size - len, "%X,", i);
++++++ + return len;
++++++ + }
++++++ +
- - --static ssize_t input_dev_show_modalias(struct class_device *dev, char *buf)
+++++++++++static int print_modalias(char *buf, int size, struct input_dev *id)
++++++ + {
- - -- struct input_dev *id = to_input_dev(dev);
- - -- ssize_t len = 0;
+++++++++++ int len;
++++++ +
- - -- len += sprintf(buf+len, "input:b%04Xv%04Xp%04Xe%04X-",
+++++++++++ len = snprintf(buf, size, "input:b%04Xv%04Xp%04Xe%04X-",
++++++ + id->id.bustype,
++++++ + id->id.vendor,
++++++ + id->id.product,
++++++ + id->id.version);
++++++ +
- - -- len += print_modalias_bits(buf+len, 'e', id->evbit, 0, EV_MAX);
- - -- len += print_modalias_bits(buf+len, 'k', id->keybit,
+++++++++++ len += print_modalias_bits(buf + len, size - len, 'e', id->evbit,
+++++++++++ 0, EV_MAX);
+++++++++++ len += print_modalias_bits(buf + len, size - len, 'k', id->keybit,
++++++ + KEY_MIN_INTERESTING, KEY_MAX);
- - -- len += print_modalias_bits(buf+len, 'r', id->relbit, 0, REL_MAX);
- - -- len += print_modalias_bits(buf+len, 'a', id->absbit, 0, ABS_MAX);
- - -- len += print_modalias_bits(buf+len, 'm', id->mscbit, 0, MSC_MAX);
- - -- len += print_modalias_bits(buf+len, 'l', id->ledbit, 0, LED_MAX);
- - -- len += print_modalias_bits(buf+len, 's', id->sndbit, 0, SND_MAX);
- - -- len += print_modalias_bits(buf+len, 'f', id->ffbit, 0, FF_MAX);
- - -- len += print_modalias_bits(buf+len, 'w', id->swbit, 0, SW_MAX);
- - -- len += sprintf(buf+len, "\n");
+++++++++++ len += print_modalias_bits(buf + len, size - len, 'r', id->relbit,
+++++++++++ 0, REL_MAX);
+++++++++++ len += print_modalias_bits(buf + len, size - len, 'a', id->absbit,
+++++++++++ 0, ABS_MAX);
+++++++++++ len += print_modalias_bits(buf + len, size - len, 'm', id->mscbit,
+++++++++++ 0, MSC_MAX);
+++++++++++ len += print_modalias_bits(buf + len, size - len, 'l', id->ledbit,
+++++++++++ 0, LED_MAX);
+++++++++++ len += print_modalias_bits(buf + len, size - len, 's', id->sndbit,
+++++++++++ 0, SND_MAX);
+++++++++++ len += print_modalias_bits(buf + len, size - len, 'f', id->ffbit,
+++++++++++ 0, FF_MAX);
+++++++++++ len += print_modalias_bits(buf + len, size - len, 'w', id->swbit,
+++++++++++ 0, SW_MAX);
+++++++++++ return len;
+++++++++++}
+++++++++++
+++++++++++static ssize_t input_dev_show_modalias(struct class_device *dev, char *buf)
+++++++++++{
+++++++++++ struct input_dev *id = to_input_dev(dev);
+++++++++++ ssize_t len;
+++++++++++
+++++++++++ len = print_modalias(buf, PAGE_SIZE, id);
+++++++++++ len += snprintf(buf + len, PAGE_SIZE-len, "\n");
++++++ + return len;
++++++ + }
++++++ + static CLASS_DEVICE_ATTR(modalias, S_IRUGO, input_dev_show_modalias, NULL);
++++++ +
static struct attribute *input_dev_attrs[] = {
&class_device_attr_name.attr,
&class_device_attr_phys.attr,
diff --cc drivers/input/misc/wistron_btns.c
index 4b415d9,bac3085,49d0416,49d0416,bac3085,49d0416,49d0416,49d0416,bac3085,bac3085,bac3085,bac3085..4b415d9
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@@@@@@@@@@@@ -330,16 -320,7 -320,7 -320,7 -320,7 -320,7 -320,7 -320,7 -320,7 -320,7 -320,7 -320,7 +330,16 @@@@@@@@@@@@@ static struct dmi_system_id dmi_ids[]
},
.driver_data = keymap_acer_aspire_1500
},
-- --- { 0, }
+++++++++++ {
+++++++++++ .callback = dmi_matched,
+++++++++++ .ident = "Acer TravelMate 240",
+++++++++++ .matches = {
+++++++++++ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+++++++++++ DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 240"),
+++++++++++ },
+++++++++++ .driver_data = keymap_acer_travelmate_240
+++++++++++ },
++ +++ { NULL, }
};
static int __init select_keymap(void)
diff --cc drivers/input/mouse/alps.c
index 2141501,4f41ec3,4f41ec3,4acc7fd,4f41ec3,4acc7fd,4acc7fd,4acc7fd,4f41ec3,4f41ec3,4f41ec3,4f41ec3..2141501
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@@@@@@@@@@@@ -40,10 -40,9 -40,9 -40,9 -40,9 -40,9 -40,9 -40,9 -40,9 -40,9 -40,9 -40,9 +40,10 @@@@@@@@@@@@@ static struct alps_model_info alps_mode
{ { 0x33, 0x02, 0x0a }, 0x88, 0xf8, ALPS_OLDPROTO }, /* UMAX-530T */
{ { 0x53, 0x02, 0x0a }, 0xf8, 0xf8, 0 },
{ { 0x53, 0x02, 0x14 }, 0xf8, 0xf8, 0 },
+++++++++++ { { 0x60, 0x03, 0xc8 }, 0xf8, 0xf8, 0 }, /* HP ze1115 */
{ { 0x63, 0x02, 0x0a }, 0xf8, 0xf8, 0 },
{ { 0x63, 0x02, 0x14 }, 0xf8, 0xf8, 0 },
- --- { { 0x63, 0x02, 0x28 }, 0xf8, 0xf8, 0 },
+ +++ { { 0x63, 0x02, 0x28 }, 0xf8, 0xf8, ALPS_FW_BK_2 }, /* Fujitsu Siemens S6010 */
{ { 0x63, 0x02, 0x3c }, 0x8f, 0x8f, ALPS_WHEEL }, /* Toshiba Satellite S2400-103 */
{ { 0x63, 0x02, 0x50 }, 0xef, 0xef, ALPS_FW_BK_1 }, /* NEC Versa L320 */
{ { 0x63, 0x02, 0x64 }, 0xf8, 0xf8, 0 },
diff --cc drivers/input/mouse/maplemouse.c
index 0000000,b5b34fe,b5b34fe,b5b34fe,b5b34fe,b5b34fe,b5b34fe,b5b34fe,b5b34fe,b5b34fe,b5b34fe,b5b34fe..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/input/mouse/maplemouse.c
+++ /dev/null
diff --cc drivers/input/touchscreen/ads7846.c
index dd8c6a9,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..dd8c6a9
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
diff --cc drivers/macintosh/macio_asic.c
index ed6d317,228e185,c34c96d,c34c96d,c34c96d,c34c96d,c34c96d,c34c96d,228e185,c34c96d,228e185,228e185..ed6d317
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@@@@@@@@@@@@ -210,10 -203,7 -203,7 -203,7 -203,7 -203,7 -203,7 -203,7 -203,7 -203,7 -203,7 -203,7 +210,10 @@@@@@@@@@@@@ extern struct device_attribute macio_de
struct bus_type macio_bus_type = {
.name = "macio",
.match = macio_bus_match,
------ - .hotplug = macio_hotplug,
++++++ + .uevent = macio_uevent,
+++++++++++ .probe = macio_device_probe,
+++++++++++ .remove = macio_device_remove,
+++++++++++ .shutdown = macio_device_shutdown,
.suspend = macio_device_suspend,
.resume = macio_device_resume,
.dev_attrs = macio_dev_attrs,
diff --cc drivers/md/.gitignore
index a7afec6,a7afec6,0000000,0000000,0000000,0000000,0000000,0000000,a7afec6,0000000,a7afec6,a7afec6..a7afec6
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/md/.gitignore
+++ b/drivers/md/.gitignore
diff --cc drivers/md/dm.c
index 8c16359,0e48151,930b9fc,930b9fc,930b9fc,930b9fc,930b9fc,930b9fc,0e48151,930b9fc,0e48151,0e48151..8c16359
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@@@@@@@@@@@@ -838,9 -837,9 -836,9 -836,9 -836,9 -836,9 -836,9 -836,9 -837,9 -836,9 -837,9 -837,9 +838,9 @@@@@@@@@@@@@ static void __set_size(struct mapped_de
{
set_capacity(md->disk, size);
- - -- down(&md->suspended_bdev->bd_inode->i_sem);
------ - down(&md->frozen_bdev->bd_inode->i_sem);
------ - i_size_write(md->frozen_bdev->bd_inode, (loff_t)size << SECTOR_SHIFT);
------ - up(&md->frozen_bdev->bd_inode->i_sem);
+++++++++++ mutex_lock(&md->suspended_bdev->bd_inode->i_mutex);
++++++ + i_size_write(md->suspended_bdev->bd_inode, (loff_t)size << SECTOR_SHIFT);
- - -- up(&md->suspended_bdev->bd_inode->i_sem);
+++++++++++ mutex_unlock(&md->suspended_bdev->bd_inode->i_mutex);
}
static int __bind(struct mapped_device *md, struct dm_table *t)
diff --cc drivers/md/md.c
index 7145cd1,1b76fb2,cd12fca,cd12fca,8175a2a,cd12fca,cd12fca,cd12fca,1b76fb2,8175a2a,1b76fb2,1b76fb2..7145cd1
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@@@@@@@@@@@@ -1916,37 -1913,37 -1725,16 -1725,16 -1725,16 -1725,16 -1725,16 -1725,16 -1913,37 -1725,16 -1913,37 -1913,37 +1916,37 @@@@@@@@@@@@@ static void analyze_sbs(mddev_t * mddev
static ssize_t
level_show(mddev_t *mddev, char *page)
{
------ - mdk_personality_t *p = mddev->pers;
------ - if (p == NULL && mddev->raid_disks == 0)
------ - return 0;
------ - if (mddev->level >= 0)
-- --- return sprintf(page, "RAID-%d\n", mddev->level);
- - return sprintf(page, "raid%d\n", mddev->level);
------ - else
++++++ + struct mdk_personality *p = mddev->pers;
++++++ + if (p)
return sprintf(page, "%s\n", p->name);
++++++ + else if (mddev->clevel[0])
++++++ + return sprintf(page, "%s\n", mddev->clevel);
++++++ + else if (mddev->level != LEVEL_NONE)
++++++ + return sprintf(page, "%d\n", mddev->level);
++++++ + else
++++++ + return 0;
}
------ - static struct md_sysfs_entry md_level = __ATTR_RO(level);
++++++ + static ssize_t
++++++ + level_store(mddev_t *mddev, const char *buf, size_t len)
++++++ + {
++++++ + int rv = len;
++++++ + if (mddev->pers)
++++++ + return -EBUSY;
++++++ + if (len == 0)
++++++ + return 0;
++++++ + if (len >= sizeof(mddev->clevel))
++++++ + return -ENOSPC;
++++++ + strncpy(mddev->clevel, buf, len);
++++++ + if (mddev->clevel[len-1] == '\n')
++++++ + len--;
++++++ + mddev->clevel[len] = 0;
++++++ + mddev->level = LEVEL_NONE;
++++++ + return rv;
++++++ + }
++++++ +
++++++ + static struct md_sysfs_entry md_level =
++++++ + __ATTR(level, 0644, level_show, level_store);
static ssize_t
raid_disks_show(mddev_t *mddev, char *page)
@@@@@@@@@@@@@ -3425,81 -3421,81 -2942,6 -2942,6 -2942,6 -2942,6 -2942,6 -2942,6 -3421,81 -2942,6 -3421,81 -3421,81 +3425,81 @@@@@@@@@@@@@ static int set_array_info(mddev_t * mdd
return 0;
}
++++++ + static int update_size(mddev_t *mddev, unsigned long size)
++++++ + {
++++++ + mdk_rdev_t * rdev;
++++++ + int rv;
++++++ + struct list_head *tmp;
++++++ +
++++++ + if (mddev->pers->resize == NULL)
++++++ + return -EINVAL;
++++++ + /* The "size" is the amount of each device that is used.
++++++ + * This can only make sense for arrays with redundancy.
++++++ + * linear and raid0 always use whatever space is available
++++++ + * We can only consider changing the size if no resync
++++++ + * or reconstruction is happening, and if the new size
++++++ + * is acceptable. It must fit before the sb_offset or,
++++++ + * if that is <data_offset, it must fit before the
++++++ + * size of each device.
++++++ + * If size is zero, we find the largest size that fits.
++++++ + */
++++++ + if (mddev->sync_thread)
++++++ + return -EBUSY;
++++++ + ITERATE_RDEV(mddev,rdev,tmp) {
++++++ + sector_t avail;
++++++ + int fit = (size == 0);
++++++ + if (rdev->sb_offset > rdev->data_offset)
++++++ + avail = (rdev->sb_offset*2) - rdev->data_offset;
++++++ + else
++++++ + avail = get_capacity(rdev->bdev->bd_disk)
++++++ + - rdev->data_offset;
++++++ + if (fit && (size == 0 || size > avail/2))
++++++ + size = avail/2;
++++++ + if (avail < ((sector_t)size << 1))
++++++ + return -ENOSPC;
++++++ + }
++++++ + rv = mddev->pers->resize(mddev, (sector_t)size *2);
++++++ + if (!rv) {
++++++ + struct block_device *bdev;
++++++ +
++++++ + bdev = bdget_disk(mddev->gendisk, 0);
++++++ + if (bdev) {
- - -- down(&bdev->bd_inode->i_sem);
+++++++++++ mutex_lock(&bdev->bd_inode->i_mutex);
++++++ + i_size_write(bdev->bd_inode, mddev->array_size << 10);
- - -- up(&bdev->bd_inode->i_sem);
+++++++++++ mutex_unlock(&bdev->bd_inode->i_mutex);
++++++ + bdput(bdev);
++++++ + }
++++++ + }
++++++ + return rv;
++++++ + }
++++++ +
++++++ + static int update_raid_disks(mddev_t *mddev, int raid_disks)
++++++ + {
++++++ + int rv;
++++++ + /* change the number of raid disks */
++++++ + if (mddev->pers->reshape == NULL)
++++++ + return -EINVAL;
++++++ + if (raid_disks <= 0 ||
++++++ + raid_disks >= mddev->max_disks)
++++++ + return -EINVAL;
++++++ + if (mddev->sync_thread)
++++++ + return -EBUSY;
++++++ + rv = mddev->pers->reshape(mddev, raid_disks);
++++++ + if (!rv) {
++++++ + struct block_device *bdev;
++++++ +
++++++ + bdev = bdget_disk(mddev->gendisk, 0);
++++++ + if (bdev) {
- - -- down(&bdev->bd_inode->i_sem);
+++++++++++ mutex_lock(&bdev->bd_inode->i_mutex);
++++++ + i_size_write(bdev->bd_inode, mddev->array_size << 10);
- - -- up(&bdev->bd_inode->i_sem);
+++++++++++ mutex_unlock(&bdev->bd_inode->i_mutex);
++++++ + bdput(bdev);
++++++ + }
++++++ + }
++++++ + return rv;
++++++ + }
++++++ +
++++++ +
/*
* update_array_info is used to change the configuration of an
* on-line array.
diff --cc drivers/md/raid1.c
index d39f584,a06ff91,229d7b2,3066c58,229d7b2,3066c58,3066c58,3066c58,a06ff91,229d7b2,a06ff91,a06ff91..d39f584
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@@@@@@@@@@@@ -176,8 -176,8 -158,10 -158,10 -158,10 -158,10 -158,10 -158,10 -176,8 -158,10 -176,8 -176,8 +176,8 @@@@@@@@@@@@@ static void put_all_bios(conf_t *conf,
}
}
-----------static inline void free_r1bio(r1bio_t *r1_bio)
+++++++++++static void free_r1bio(r1bio_t *r1_bio)
{
------ - unsigned long flags;
------ -
conf_t *conf = mddev_to_conf(r1_bio->mddev);
/*
@@@@@@@@@@@@@ -190,20 -190,20 -179,25 -179,25 -179,25 -179,25 -179,25 -179,25 -190,20 -179,25 -190,20 -190,20 +190,20 @@@@@@@@@@@@@
mempool_free(r1_bio, conf->r1bio_pool);
}
-----------static inline void put_buf(r1bio_t *r1_bio)
+++++++++++static void put_buf(r1bio_t *r1_bio)
{
conf_t *conf = mddev_to_conf(r1_bio->mddev);
------ - unsigned long flags;
++++++ + int i;
------ - mempool_free(r1_bio, conf->r1buf_pool);
++++++ + for (i=0; i<conf->raid_disks; i++) {
++++++ + struct bio *bio = r1_bio->bios[i];
++++++ + if (bio->bi_end_io)
++++++ + rdev_dec_pending(conf->mirrors[i].rdev, r1_bio->mddev);
++++++ + }
------ - spin_lock_irqsave(&conf->resync_lock, flags);
------ - if (!conf->barrier)
------ - BUG();
------ - --conf->barrier;
------ - wake_up(&conf->wait_resume);
------ - wake_up(&conf->wait_idle);
++++++ + mempool_free(r1_bio, conf->r1buf_pool);
------ - if (!--conf->nr_pending) {
------ - wake_up(&conf->wait_idle);
------ - wake_up(&conf->wait_resume);
------ - }
------ - spin_unlock_irqrestore(&conf->resync_lock, flags);
++++++ + lower_barrier(conf);
}
static void reschedule_retry(r1bio_t *r1_bio)
@@@@@@@@@@@@@ -379,9 -379,9 -376,9 -377,10 -376,9 -377,10 -377,10 -377,10 -379,9 -376,9 -379,9 -379,9 +379,9 @@@@@@@@@@@@@ static int raid1_end_write_request(stru
}
if (test_bit(R1BIO_BehindIO, &r1_bio->state)) {
/* free extra copy of the data pages */
- --- /* FIXME bio has been freed!!! */
int i = bio->bi_vcnt;
while (i--)
------ - __free_page(bio->bi_io_vec[i].bv_page);
++++++ + safe_put_page(bio->bi_io_vec[i].bv_page);
}
/* clear the bitmap if all writes complete successfully */
bitmap_endwrite(r1_bio->mddev->bitmap, r1_bio->sector,
@@@@@@@@@@@@@ -623,86 -623,86 -599,24 -598,24 -599,24 -598,24 -598,24 -598,24 -623,86 -599,24 -623,86 -623,86 +623,86 @@@@@@@@@@@@@ static int raid1_issue_flush(request_qu
*/
#define RESYNC_DEPTH 32
------ - static void device_barrier(conf_t *conf, sector_t sect)
++++++ + static void raise_barrier(conf_t *conf)
{
spin_lock_irq(&conf->resync_lock);
------ - wait_event_lock_irq(conf->wait_idle, !waitqueue_active(&conf->wait_resume),
------ - conf->resync_lock, raid1_unplug(conf->mddev->queue));
------ -
------ - if (!conf->barrier++) {
------ - wait_event_lock_irq(conf->wait_idle, !conf->nr_pending,
------ - conf->resync_lock, raid1_unplug(conf->mddev->queue));
------ - if (conf->nr_pending)
------ - BUG();
++++++ +
++++++ + /* Wait until no block IO is waiting */
++++++ + wait_event_lock_irq(conf->wait_barrier, !conf->nr_waiting,
++++++ + conf->resync_lock,
++++++ + raid1_unplug(conf->mddev->queue));
++++++ +
++++++ + /* block any new IO from starting */
++++++ + conf->barrier++;
++++++ +
++++++ + /* No wait for all pending IO to complete */
++++++ + wait_event_lock_irq(conf->wait_barrier,
++++++ + !conf->nr_pending && conf->barrier < RESYNC_DEPTH,
++++++ + conf->resync_lock,
++++++ + raid1_unplug(conf->mddev->queue));
++++++ +
++++++ + spin_unlock_irq(&conf->resync_lock);
++++++ + }
++++++ +
++++++ + static void lower_barrier(conf_t *conf)
++++++ + {
++++++ + unsigned long flags;
++++++ + spin_lock_irqsave(&conf->resync_lock, flags);
++++++ + conf->barrier--;
++++++ + spin_unlock_irqrestore(&conf->resync_lock, flags);
++++++ + wake_up(&conf->wait_barrier);
++++++ + }
++++++ +
++++++ + static void wait_barrier(conf_t *conf)
++++++ + {
++++++ + spin_lock_irq(&conf->resync_lock);
++++++ + if (conf->barrier) {
++++++ + conf->nr_waiting++;
++++++ + wait_event_lock_irq(conf->wait_barrier, !conf->barrier,
++++++ + conf->resync_lock,
++++++ + raid1_unplug(conf->mddev->queue));
++++++ + conf->nr_waiting--;
}
------ - wait_event_lock_irq(conf->wait_resume, conf->barrier < RESYNC_DEPTH,
------ - conf->resync_lock, raid1_unplug(conf->mddev->queue));
------ - conf->next_resync = sect;
++++++ + conf->nr_pending++;
+ + + spin_unlock_irq(&conf->resync_lock);
+ + + }
+ + +
++++++ + static void allow_barrier(conf_t *conf)
++++++ + {
++++++ + unsigned long flags;
++++++ + spin_lock_irqsave(&conf->resync_lock, flags);
++++++ + conf->nr_pending--;
++++++ + spin_unlock_irqrestore(&conf->resync_lock, flags);
++++++ + wake_up(&conf->wait_barrier);
++++++ + }
++++++ +
++++++ + static void freeze_array(conf_t *conf)
++++++ + {
++++++ + /* stop syncio and normal IO and wait for everything to
++++++ + * go quite.
++++++ + * We increment barrier and nr_waiting, and then
++++++ + * wait until barrier+nr_pending match nr_queued+2
++++++ + */
++++++ + spin_lock_irq(&conf->resync_lock);
++++++ + conf->barrier++;
++++++ + conf->nr_waiting++;
++++++ + wait_event_lock_irq(conf->wait_barrier,
++++++ + conf->barrier+conf->nr_pending == conf->nr_queued+2,
++++++ + conf->resync_lock,
++++++ + raid1_unplug(conf->mddev->queue));
++++++ + spin_unlock_irq(&conf->resync_lock);
++++++ + }
++++++ + static void unfreeze_array(conf_t *conf)
++++++ + {
++++++ + /* reverse the effect of the freeze */
++++++ + spin_lock_irq(&conf->resync_lock);
++++++ + conf->barrier--;
++++++ + conf->nr_waiting--;
++++++ + wake_up(&conf->wait_barrier);
+ +++ spin_unlock_irq(&conf->resync_lock);
+ +++ }
+ +++
++++++ +
/* duplicate the data pages for behind I/O */
static struct page **alloc_behind_pages(struct bio *bio)
{
diff --cc drivers/md/raid10.c
index 9130d05,9e658e5,713dc9c,713dc9c,713dc9c,713dc9c,713dc9c,713dc9c,9e658e5,713dc9c,9e658e5,9e658e5..9130d05
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@@@@@@@@@@@@ -176,8 -176,8 -173,10 -173,10 -173,10 -173,10 -173,10 -173,10 -176,8 -173,10 -176,8 -176,8 +176,8 @@@@@@@@@@@@@ static void put_all_bios(conf_t *conf,
}
}
-----------static inline void free_r10bio(r10bio_t *r10_bio)
+++++++++++static void free_r10bio(r10bio_t *r10_bio)
{
------ - unsigned long flags;
------ -
conf_t *conf = mddev_to_conf(r10_bio->mddev);
/*
@@@@@@@@@@@@@ -190,9 -190,9 -194,10 -194,10 -194,10 -194,10 -194,10 -194,10 -190,9 -194,10 -190,9 -190,9 +190,9 @@@@@@@@@@@@@
mempool_free(r10_bio, conf->r10bio_pool);
}
-----------static inline void put_buf(r10bio_t *r10_bio)
+++++++++++static void put_buf(r10bio_t *r10_bio)
{
conf_t *conf = mddev_to_conf(r10_bio->mddev);
------ - unsigned long flags;
mempool_free(r10_bio, conf->r10buf_pool);
diff --cc drivers/md/raid5.c
index 25976bf,54f4a98,fafc4bc,36d5f8a,fafc4bc,36d5f8a,36d5f8a,36d5f8a,54f4a98,fafc4bc,54f4a98,54f4a98..25976bf
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@@@@@@@@@@@@ -115,12 -115,12 -117,17 -117,17 -117,17 -117,17 -117,17 -117,17 -115,12 -117,17 -115,12 -115,12 +115,12 @@@@@@@@@@@@@ static inline void remove_hash(struct s
{
PRINTK("remove_hash(), stripe %llu\n", (unsigned long long)sh->sector);
------ - if (sh->hash_pprev) {
------ - if (sh->hash_next)
------ - sh->hash_next->hash_pprev = sh->hash_pprev;
------ - *sh->hash_pprev = sh->hash_next;
------ - sh->hash_pprev = NULL;
------ - }
++++++ + hlist_del_init(&sh->hash);
}
- - --static inline void insert_hash(raid5_conf_t *conf, struct stripe_head *sh)
------ - static __inline__ void insert_hash(raid5_conf_t *conf, struct stripe_head *sh)
+++++++++++static void insert_hash(raid5_conf_t *conf, struct stripe_head *sh)
{
------ - struct stripe_head **shp = &stripe_hash(conf, sh->sector);
++++++ + struct hlist_head *hp = stripe_hash(conf, sh->sector);
PRINTK("insert_hash(), stripe %llu\n", (unsigned long long)sh->sector);
diff --cc drivers/media/common/saa7146_fops.c
index f8cf73e,09ec964,09ec964,3788898,09ec964,3788898,3788898,3788898,09ec964,09ec964,09ec964,09ec964..f8cf73e
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@@@@@@@@@@@@ -245,7 -245,8 -245,8 -245,8 -245,8 -245,8 -245,8 -245,8 -245,8 -245,8 -245,8 -245,8 +245,7 @@@@@@@@@@@@@ static int fops_open(struct inode *inod
result = -ENOMEM;
goto out;
}
----------- memset(fh,0,sizeof(*fh));
- ---
+ +++
file->private_data = fh;
fh->dev = dev;
fh->type = type;
@@@@@@@@@@@@@ -494,9 -467,8 -467,8 -467,8 -467,8 -467,8 -467,8 -467,8 -467,8 -467,8 -467,8 -467,8 +494,9 @@@@@@@@@@@@@ int saa7146_vv_init(struct saa7146_dev
memset(vv->d_clipping.cpu_addr, 0x0, SAA7146_CLIPPING_MEM);
saa7146_video_uops.init(dev,vv);
----------- saa7146_vbi_uops.init(dev,vv);
- ---
+++++++++++ if (dev->ext_vv_data->capabilities & V4L2_CAP_VBI_CAPTURE)
+++++++++++ saa7146_vbi_uops.init(dev,vv);
+ +++
dev->vv_data = vv;
dev->vv_callback = &vv_callback;
diff --cc drivers/media/common/saa7146_video.c
index 7ebac79,1d96102,1d96102,8dd4d15,1d96102,8dd4d15,8dd4d15,8dd4d15,1d96102,1d96102,1d96102,1d96102..7ebac79
--- a/drivers/media/common/saa7146_video.c
+++ b/drivers/media/common/saa7146_video.c
@@@@@@@@@@@@@ -150,23 -150,23 -150,23 -150,23 -150,23 -150,23 -150,23 -150,23 -150,23 -150,23 -150,23 -150,23 +150,23 @@@@@@@@@@@@@ static int try_win(struct saa7146_dev *
maxh = vv->standard->v_max_out;
if (V4L2_FIELD_ANY == field) {
- --- field = (win->w.height > maxh/2)
- --- ? V4L2_FIELD_INTERLACED
- --- : V4L2_FIELD_TOP;
- --- }
- --- switch (field) {
- --- case V4L2_FIELD_TOP:
- --- case V4L2_FIELD_BOTTOM:
- --- case V4L2_FIELD_ALTERNATE:
- --- maxh = maxh / 2;
- --- break;
- --- case V4L2_FIELD_INTERLACED:
- --- break;
- --- default: {
+ +++ field = (win->w.height > maxh/2)
-- - ---- ? V4L2_FIELD_INTERLACED
-- - ---- : V4L2_FIELD_TOP;
+++++++++++ ? V4L2_FIELD_INTERLACED
+++++++++++ : V4L2_FIELD_TOP;
+ +++ }
+ +++ switch (field) {
+ +++ case V4L2_FIELD_TOP:
+ +++ case V4L2_FIELD_BOTTOM:
+ +++ case V4L2_FIELD_ALTERNATE:
+ +++ maxh = maxh / 2;
+ +++ break;
+ +++ case V4L2_FIELD_INTERLACED:
+ +++ break;
+ +++ default: {
DEB_D(("no known field mode '%d'.\n",field));
- --- return -EINVAL;
+ +++ return -EINVAL;
+ +++ }
}
- --- }
win->field = field;
if (win->w.width > maxw)
diff --cc drivers/media/dvb/b2c2/flexcop-fe-tuner.c
index 0b940e1,21a9045,21a9045,a353303,21a9045,a353303,a353303,a353303,21a9045,21a9045,21a9045,21a9045..0b940e1
--- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
@@@@@@@@@@@@@ -298,7 -298,7 -298,7 -298,7 -298,7 -298,7 -298,7 -298,7 -298,7 -298,7 -298,7 -298,7 +298,7 @@@@@@@@@@@@@ static int flexcop_fe_request_firmware(
}
static int lgdt3303_pll_set(struct dvb_frontend* fe,
-- - ---- struct dvb_frontend_parameters* params)
- --- struct dvb_frontend_parameters* params)
+++++++++++ struct dvb_frontend_parameters* params)
{
struct flexcop_device *fc = fe->dvb->priv;
u8 buf[4];
@@@@@@@@@@@@@ -485,16 -485,12 -485,12 -485,12 -485,12 -485,12 -485,12 -485,12 -485,12 -485,12 -485,12 -485,12 +485,16 @@@@@@@@@@@@@ static struct stv0297_config alps_tdee4
/* try to figure out the frontend, each card/box can have on of the following list */
int flexcop_frontend_init(struct flexcop_device *fc)
{
+++++++++++ struct dvb_frontend_ops *ops;
+++++++++++
/* try the sky v2.6 (stv0299/Samsung tbmu24112(sl1935)) */
if ((fc->fe = stv0299_attach(&samsung_tbmu24112_config, &fc->i2c_adap)) != NULL) {
----------- fc->fe->ops->set_voltage = flexcop_set_voltage;
+++++++++++ ops = fc->fe->ops;
++ + ++++
- --- fc->fe_sleep = fc->fe->ops->sleep;
- --- fc->fe->ops->sleep = flexcop_sleep;
+++++++++++ ops->set_voltage = flexcop_set_voltage;
+ +++
-- - ---- fc->fe_sleep = fc->fe->ops->sleep;
-- - ---- fc->fe->ops->sleep = flexcop_sleep;
+++++++++++ fc->fe_sleep = ops->sleep;
+++++++++++ ops->sleep = flexcop_sleep;
fc->dev_type = FC_SKY;
info("found the stv0299 at i2c address: 0x%02x",samsung_tbmu24112_config.demod_address);
diff --cc drivers/media/dvb/dvb-core/dvb_ca_en50221.c
index 00347a7,5956c35,5956c35,2aa767f,5956c35,2aa767f,2aa767f,2aa767f,5956c35,5956c35,5956c35,5956c35..00347a7
--- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
@@@@@@@@@@@@@ -1741,7 -1745,9 -1745,9 -1771,6 -1745,9 -1771,6 -1771,6 -1771,6 -1745,9 -1745,9 -1745,9 -1745,9 +1741,7 @@@@@@@@@@@@@ void dvb_ca_en50221_release(struct dvb_
for (i = 0; i < ca->slot_count; i++) {
dvb_ca_en50221_slot_shutdown(ca, i);
-- - ---- if (ca->slot_info[i].rx_buffer.data != NULL) {
-- - ---- vfree(ca->slot_info[i].rx_buffer.data);
-- - ---- }
+++++++++++ vfree(ca->slot_info[i].rx_buffer.data);
}
kfree(ca->slot_info);
dvb_unregister_device(ca->dvbdev);
diff --cc drivers/media/dvb/dvb-core/dvb_filter.c
index 772003f,c49fd0b,c49fd0b,bd51439,c49fd0b,bd51439,bd51439,bd51439,c49fd0b,c49fd0b,c49fd0b,c49fd0b..772003f
--- a/drivers/media/dvb/dvb-core/dvb_filter.c
+++ b/drivers/media/dvb/dvb-core/dvb_filter.c
@@@@@@@@@@@@@ -407,27 -407,27 -407,27 -407,27 -407,27 -407,27 -407,27 -407,27 -407,27 -407,27 -407,27 -407,27 +407,27 @@@@@@@@@@@@@ static u8 *skip_pes_header(u8 **bufp
};
- --- if ((inbuf[6] & 0xc0) == 0x80){ /* mpeg2 */
- --- if (buf[7] & PTS_ONLY)
- --- pts = buf+9;
- --- else pts = NULL;
- --- buf = inbuf + 9 + inbuf[8];
- --- } else { /* mpeg1 */
- --- for (buf = inbuf + 6; *buf == 0xff; buf++)
- --- if (buf == inbuf + 6 + 16) {
- --- break;
- --- }
- --- if ((*buf & 0xc0) == 0x40)
- --- buf += 2;
- --- skip = mpeg1_skip_table [*buf >> 4];
- --- if (skip == 5 || skip == 10) pts = buf;
- --- else pts = NULL;
- ---
- --- buf += mpeg1_skip_table [*buf >> 4];
- --- }
- ---
- --- *bufp = buf;
- --- return pts;
+ +++ if ((inbuf[6] & 0xc0) == 0x80){ /* mpeg2 */
+ +++ if (buf[7] & PTS_ONLY)
-- - ---- pts = buf+9;
+++++++++++ pts = buf+9;
+ +++ else pts = NULL;
+ +++ buf = inbuf + 9 + inbuf[8];
+ +++ } else { /* mpeg1 */
+ +++ for (buf = inbuf + 6; *buf == 0xff; buf++)
-- - ---- if (buf == inbuf + 6 + 16) {
-- - ---- break;
-- - ---- }
+++++++++++ if (buf == inbuf + 6 + 16) {
+++++++++++ break;
+++++++++++ }
+ +++ if ((*buf & 0xc0) == 0x40)
-- - ---- buf += 2;
+++++++++++ buf += 2;
+ +++ skip = mpeg1_skip_table [*buf >> 4];
+ +++ if (skip == 5 || skip == 10) pts = buf;
+ +++ else pts = NULL;
+ +++
+ +++ buf += mpeg1_skip_table [*buf >> 4];
+ +++ }
+ +++
+ +++ *bufp = buf;
+ +++ return pts;
}
#endif
@@@@@@@@@@@@@ -526,29 -526,29 -526,29 -526,29 -526,29 -526,29 -526,29 -526,29 -526,29 -526,29 -526,29 -526,29 +526,29 @@@@@@@@@@@@@ static void mpg_set_picture_parameter(
#if 0
static void init_mpg_picture( struct mpg_picture *pic, int chan, int32_t field_type)
{
- --- pic->picture_header = 0;
- --- pic->sequence_header_data
- --- = ( INIT_HORIZONTAL_SIZE << 20 )
- --- | ( INIT_VERTICAL_SIZE << 8 )
- --- | ( INIT_ASPECT_RATIO << 4 )
- --- | ( INIT_FRAME_RATE );
- --- pic->mpeg1_flag = 0;
- --- pic->vinfo.horizontal_size
- --- = INIT_DISP_HORIZONTAL_SIZE;
- --- pic->vinfo.vertical_size
- --- = INIT_DISP_VERTICAL_SIZE;
- --- pic->picture_display_extension_flag[field_type]
- --- = 0;
- --- pic->pts_flag[field_type] = 0;
- ---
- --- pic->sequence_gop_header = 0;
- --- pic->picture_header = 0;
- --- pic->sequence_header_flag = 0;
- --- pic->gop_flag = 0;
- --- pic->sequence_end_flag = 0;
- --- pic->sequence_display_extension_flag = 0;
- --- pic->last_frame_centre_horizontal_offset = 0;
- --- pic->last_frame_centre_vertical_offset = 0;
+ +++ pic->picture_header = 0;
+ +++ pic->sequence_header_data
+ +++ = ( INIT_HORIZONTAL_SIZE << 20 )
-- - ---- | ( INIT_VERTICAL_SIZE << 8 )
-- - ---- | ( INIT_ASPECT_RATIO << 4 )
-- - ---- | ( INIT_FRAME_RATE );
+++++++++++ | ( INIT_VERTICAL_SIZE << 8 )
+++++++++++ | ( INIT_ASPECT_RATIO << 4 )
+++++++++++ | ( INIT_FRAME_RATE );
+ +++ pic->mpeg1_flag = 0;
+ +++ pic->vinfo.horizontal_size
+ +++ = INIT_DISP_HORIZONTAL_SIZE;
+ +++ pic->vinfo.vertical_size
+ +++ = INIT_DISP_VERTICAL_SIZE;
+ +++ pic->picture_display_extension_flag[field_type]
+ +++ = 0;
+ +++ pic->pts_flag[field_type] = 0;
+ +++
+ +++ pic->sequence_gop_header = 0;
+ +++ pic->picture_header = 0;
+ +++ pic->sequence_header_flag = 0;
+ +++ pic->gop_flag = 0;
+ +++ pic->sequence_end_flag = 0;
+ +++ pic->sequence_display_extension_flag = 0;
+ +++ pic->last_frame_centre_horizontal_offset = 0;
+ +++ pic->last_frame_centre_vertical_offset = 0;
pic->channel = chan;
}
#endif
diff --cc drivers/media/dvb/dvb-core/dvb_frontend.c
index 771f32d,95ea509,95ea509,6ffa6b2,95ea509,6ffa6b2,6ffa6b2,6ffa6b2,95ea509,95ea509,95ea509,95ea509..771f32d
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@@@@@@@@@@@@ -497,14 -372,11 -372,11 -372,11 -372,11 -372,11 -372,11 -372,11 -372,11 -372,11 -372,11 -372,11 +497,14 @@@@@@@@@@@@@ static int dvb_frontend_thread(void *da
snprintf (name, sizeof(name), "kdvb-fe-%i", fe->dvb->num);
- --- lock_kernel();
- --- daemonize(name);
- --- sigfillset(&current->blocked);
- --- unlock_kernel();
+ +++ lock_kernel();
+ +++ daemonize(name);
+ +++ sigfillset(&current->blocked);
+ +++ unlock_kernel();
+++++++++++ fepriv->check_wrapped = 0;
+++++++++++ fepriv->quality = 0;
+++++++++++ fepriv->delay = 3*HZ;
fepriv->status = 0;
dvb_frontend_init(fe);
fepriv->wakeup = 0;
diff --cc drivers/media/dvb/dvb-core/dvb_ringbuffer.c
index 77ad241,283c6e9,283c6e9,fb6d94a,283c6e9,fb6d94a,fb6d94a,fb6d94a,283c6e9,283c6e9,283c6e9,283c6e9..77ad241
--- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
+++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.c
@@@@@@@@@@@@@ -106,29 -106,29 -106,29 -106,29 -106,29 -106,29 -106,29 -106,29 -106,29 -106,29 -106,29 -106,29 +106,29 @@@@@@@@@@@@@ void dvb_ringbuffer_flush_spinlock_wake
ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf, size_t len, int usermem)
{
- --- size_t todo = len;
- --- size_t split;
- ---
- --- split = (rbuf->pread + len > rbuf->size) ? rbuf->size - rbuf->pread : 0;
- --- if (split > 0) {
- --- if (!usermem)
- --- memcpy(buf, rbuf->data+rbuf->pread, split);
- --- else
- --- if (copy_to_user(buf, rbuf->data+rbuf->pread, split))
- --- return -EFAULT;
- --- buf += split;
- --- todo -= split;
- --- rbuf->pread = 0;
- --- }
- --- if (!usermem)
- --- memcpy(buf, rbuf->data+rbuf->pread, todo);
- --- else
- --- if (copy_to_user(buf, rbuf->data+rbuf->pread, todo))
- --- return -EFAULT;
- ---
- --- rbuf->pread = (rbuf->pread + todo) % rbuf->size;
- ---
- --- return len;
+ +++ size_t todo = len;
+ +++ size_t split;
+ +++
+ +++ split = (rbuf->pread + len > rbuf->size) ? rbuf->size - rbuf->pread : 0;
+ +++ if (split > 0) {
+ +++ if (!usermem)
-- - ---- memcpy(buf, rbuf->data+rbuf->pread, split);
+++++++++++ memcpy(buf, rbuf->data+rbuf->pread, split);
+ +++ else
-- - ---- if (copy_to_user(buf, rbuf->data+rbuf->pread, split))
-- - ---- return -EFAULT;
+++++++++++ if (copy_to_user(buf, rbuf->data+rbuf->pread, split))
+++++++++++ return -EFAULT;
+ +++ buf += split;
+ +++ todo -= split;
+ +++ rbuf->pread = 0;
+ +++ }
+ +++ if (!usermem)
+ +++ memcpy(buf, rbuf->data+rbuf->pread, todo);
+ +++ else
+ +++ if (copy_to_user(buf, rbuf->data+rbuf->pread, todo))
-- - ---- return -EFAULT;
+++++++++++ return -EFAULT;
+ +++
+ +++ rbuf->pread = (rbuf->pread + todo) % rbuf->size;
+ +++
+ +++ return len;
}
@@@@@@@@@@@@@ -167,91 -167,91 -167,91 -167,91 -167,91 -167,91 -167,91 -167,91 -167,91 -167,91 -167,91 -167,91 +167,91 @@@@@@@@@@@@@ ssize_t dvb_ringbuffer_pkt_write(struc
}
ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,
-- - ---- int offset, u8* buf, size_t len, int usermem)
- --- int offset, u8* buf, size_t len, int usermem)
+++++++++++ int offset, u8* buf, size_t len, int usermem)
{
- --- size_t todo;
- --- size_t split;
- --- size_t pktlen;
- ---
- --- pktlen = rbuf->data[idx] << 8;
- --- pktlen |= rbuf->data[(idx + 1) % rbuf->size];
- --- if (offset > pktlen) return -EINVAL;
- --- if ((offset + len) > pktlen) len = pktlen - offset;
- ---
- --- idx = (idx + DVB_RINGBUFFER_PKTHDRSIZE + offset) % rbuf->size;
- --- todo = len;
- --- split = ((idx + len) > rbuf->size) ? rbuf->size - idx : 0;
- --- if (split > 0) {
- --- if (!usermem)
- --- memcpy(buf, rbuf->data+idx, split);
- --- else
- --- if (copy_to_user(buf, rbuf->data+idx, split))
- --- return -EFAULT;
- --- buf += split;
- --- todo -= split;
- --- idx = 0;
- --- }
- --- if (!usermem)
- --- memcpy(buf, rbuf->data+idx, todo);
- --- else
- --- if (copy_to_user(buf, rbuf->data+idx, todo))
- --- return -EFAULT;
- ---
- --- return len;
+ +++ size_t todo;
+ +++ size_t split;
+ +++ size_t pktlen;
+ +++
+ +++ pktlen = rbuf->data[idx] << 8;
+ +++ pktlen |= rbuf->data[(idx + 1) % rbuf->size];
+ +++ if (offset > pktlen) return -EINVAL;
+ +++ if ((offset + len) > pktlen) len = pktlen - offset;
+ +++
+ +++ idx = (idx + DVB_RINGBUFFER_PKTHDRSIZE + offset) % rbuf->size;
+ +++ todo = len;
+ +++ split = ((idx + len) > rbuf->size) ? rbuf->size - idx : 0;
+ +++ if (split > 0) {
+ +++ if (!usermem)
-- - ---- memcpy(buf, rbuf->data+idx, split);
+++++++++++ memcpy(buf, rbuf->data+idx, split);
+ +++ else
-- - ---- if (copy_to_user(buf, rbuf->data+idx, split))
-- - ---- return -EFAULT;
+++++++++++ if (copy_to_user(buf, rbuf->data+idx, split))
+++++++++++ return -EFAULT;
+ +++ buf += split;
+ +++ todo -= split;
+ +++ idx = 0;
+ +++ }
+ +++ if (!usermem)
+ +++ memcpy(buf, rbuf->data+idx, todo);
+ +++ else
+ +++ if (copy_to_user(buf, rbuf->data+idx, todo))
-- - ---- return -EFAULT;
+++++++++++ return -EFAULT;
+ +++
+ +++ return len;
}
void dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx)
{
- --- size_t pktlen;
- ---
- --- rbuf->data[(idx + 2) % rbuf->size] = PKT_DISPOSED;
- ---
- --- // clean up disposed packets
- --- while(dvb_ringbuffer_avail(rbuf) > DVB_RINGBUFFER_PKTHDRSIZE) {
- --- if (DVB_RINGBUFFER_PEEK(rbuf, 2) == PKT_DISPOSED) {
- --- pktlen = DVB_RINGBUFFER_PEEK(rbuf, 0) << 8;
- --- pktlen |= DVB_RINGBUFFER_PEEK(rbuf, 1);
- --- DVB_RINGBUFFER_SKIP(rbuf, pktlen + DVB_RINGBUFFER_PKTHDRSIZE);
- --- } else {
- --- // first packet is not disposed, so we stop cleaning now
- --- break;
- --- }
- --- }
+ +++ size_t pktlen;
+ +++
+ +++ rbuf->data[(idx + 2) % rbuf->size] = PKT_DISPOSED;
+ +++
+ +++ // clean up disposed packets
+ +++ while(dvb_ringbuffer_avail(rbuf) > DVB_RINGBUFFER_PKTHDRSIZE) {
+ +++ if (DVB_RINGBUFFER_PEEK(rbuf, 2) == PKT_DISPOSED) {
-- - ---- pktlen = DVB_RINGBUFFER_PEEK(rbuf, 0) << 8;
-- - ---- pktlen |= DVB_RINGBUFFER_PEEK(rbuf, 1);
-- - ---- DVB_RINGBUFFER_SKIP(rbuf, pktlen + DVB_RINGBUFFER_PKTHDRSIZE);
+++++++++++ pktlen = DVB_RINGBUFFER_PEEK(rbuf, 0) << 8;
+++++++++++ pktlen |= DVB_RINGBUFFER_PEEK(rbuf, 1);
+++++++++++ DVB_RINGBUFFER_SKIP(rbuf, pktlen + DVB_RINGBUFFER_PKTHDRSIZE);
+ +++ } else {
-- - ---- // first packet is not disposed, so we stop cleaning now
-- - ---- break;
+++++++++++ // first packet is not disposed, so we stop cleaning now
+++++++++++ break;
+ +++ }
+ +++ }
}
ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t* pktlen)
{
- --- int consumed;
- --- int curpktlen;
- --- int curpktstatus;
+ +++ int consumed;
+ +++ int curpktlen;
+ +++ int curpktstatus;
- --- if (idx == -1) {
+ +++ if (idx == -1) {
idx = rbuf->pread;
} else {
- --- curpktlen = rbuf->data[idx] << 8;
- --- curpktlen |= rbuf->data[(idx + 1) % rbuf->size];
- --- idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size;
+ +++ curpktlen = rbuf->data[idx] << 8;
+ +++ curpktlen |= rbuf->data[(idx + 1) % rbuf->size];
+ +++ idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size;
}
- --- consumed = (idx - rbuf->pread) % rbuf->size;
+ +++ consumed = (idx - rbuf->pread) % rbuf->size;
- --- while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) {
+ +++ while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) {
- --- curpktlen = rbuf->data[idx] << 8;
- --- curpktlen |= rbuf->data[(idx + 1) % rbuf->size];
- --- curpktstatus = rbuf->data[(idx + 2) % rbuf->size];
+ +++ curpktlen = rbuf->data[idx] << 8;
+ +++ curpktlen |= rbuf->data[(idx + 1) % rbuf->size];
+ +++ curpktstatus = rbuf->data[(idx + 2) % rbuf->size];
- --- if (curpktstatus == PKT_READY) {
- --- *pktlen = curpktlen;
- --- return idx;
- --- }
+ +++ if (curpktstatus == PKT_READY) {
-- - ---- *pktlen = curpktlen;
-- - ---- return idx;
+++++++++++ *pktlen = curpktlen;
+++++++++++ return idx;
+ +++ }
- --- consumed += curpktlen + DVB_RINGBUFFER_PKTHDRSIZE;
- --- idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size;
- --- }
+ +++ consumed += curpktlen + DVB_RINGBUFFER_PKTHDRSIZE;
+ +++ idx = (idx + curpktlen + DVB_RINGBUFFER_PKTHDRSIZE) % rbuf->size;
+ +++ }
- --- // no packets available
- --- return -1;
+ +++ // no packets available
+ +++ return -1;
}
diff --cc drivers/media/dvb/dvb-core/dvb_ringbuffer.h
index 6d25609,fa476f6,fa476f6,d18e9c4,fa476f6,d18e9c4,d18e9c4,d18e9c4,fa476f6,fa476f6,fa476f6,fa476f6..6d25609
--- a/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
+++ b/drivers/media/dvb/dvb-core/dvb_ringbuffer.h
@@@@@@@@@@@@@ -106,7 -106,7 -106,7 -106,7 -106,7 -106,7 -106,7 -106,7 -106,7 -106,7 -106,7 -106,7 +106,7 @@@@@@@@@@@@@ extern void dvb_ringbuffer_flush_spinlo
** returns number of bytes transferred or -EFAULT
*/
extern ssize_t dvb_ringbuffer_read(struct dvb_ringbuffer *rbuf, u8 *buf,
-- - ---- size_t len, int usermem);
- --- size_t len, int usermem);
+++++++++++ size_t len, int usermem);
/* write routines & macros */
@@@@@@@@@@@@@ -121,7 -121,7 -121,7 -121,7 -121,7 -121,7 -121,7 -121,7 -121,7 -121,7 -121,7 -121,7 +121,7 @@@@@@@@@@@@@
** returns number of bytes transferred or -EFAULT
*/
extern ssize_t dvb_ringbuffer_write(struct dvb_ringbuffer *rbuf, const u8 *buf,
-- - ---- size_t len);
- --- size_t len);
+++++++++++ size_t len);
/**
@@@@@@@@@@@@@ -133,7 -133,7 -133,7 -133,7 -133,7 -133,7 -133,7 -133,7 -133,7 -133,7 -133,7 -133,7 +133,7 @@@@@@@@@@@@@
* returns Number of bytes written, or -EFAULT, -ENOMEM, -EVINAL.
*/
extern ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf,
-- - ---- size_t len);
- --- size_t len);
+++++++++++ size_t len);
/**
* Read from a packet in the ringbuffer. Note: unlike dvb_ringbuffer_read(), this
@@@@@@@@@@@@@ -149,7 -149,7 -149,7 -149,7 -149,7 -149,7 -149,7 -149,7 -149,7 -149,7 -149,7 -149,7 +149,7 @@@@@@@@@@@@@
* returns Number of bytes read, or -EFAULT.
*/
extern ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,
-- - ---- int offset, u8* buf, size_t len, int usermem);
- --- int offset, u8* buf, size_t len, int usermem);
+++++++++++ int offset, u8* buf, size_t len, int usermem);
/**
* Dispose of a packet in the ring buffer.
diff --cc drivers/media/dvb/dvb-core/dvbdev.c
index 54f8b95,a4aee86,a4aee86,477b4fa,a4aee86,477b4fa,477b4fa,477b4fa,a4aee86,a4aee86,a4aee86,a4aee86..54f8b95
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@@@@@@@@@@@@ -44,10 -44,10 -44,10 -44,10 -44,10 -44,10 -44,10 -44,10 -44,10 -44,10 -44,10 -44,10 +44,10 @@@@@@@@@@@@@ MODULE_PARM_DESC(dvbdev_debug, "Turn on
#define dprintk if (dvbdev_debug) printk
static LIST_HEAD(dvb_adapter_list);
-----------static DECLARE_MUTEX(dvbdev_register_lock);
+++++++++++static DEFINE_MUTEX(dvbdev_register_lock);
static const char * const dnames[] = {
- --- "video", "audio", "sec", "frontend", "demux", "dvr", "ca",
+ +++ "video", "audio", "sec", "frontend", "demux", "dvr", "ca",
"net", "osd"
};
@@@@@@@@@@@@@ -90,15 -90,15 -90,15 -90,15 -90,15 -90,15 -90,15 -90,15 -90,15 -90,15 -90,15 -90,15 +90,15 @@@@@@@@@@@@@ static int dvb_device_open(struct inod
file->private_data = dvbdev;
old_fops = file->f_op;
- --- file->f_op = fops_get(dvbdev->fops);
- --- if(file->f_op->open)
- --- err = file->f_op->open(inode,file);
- --- if (err) {
- --- fops_put(file->f_op);
- --- file->f_op = fops_get(old_fops);
- --- }
- --- fops_put(old_fops);
- --- return err;
+ +++ file->f_op = fops_get(dvbdev->fops);
+ +++ if(file->f_op->open)
-- - ---- err = file->f_op->open(inode,file);
+++++++++++ err = file->f_op->open(inode,file);
+ +++ if (err) {
-- - ---- fops_put(file->f_op);
-- - ---- file->f_op = fops_get(old_fops);
+++++++++++ fops_put(file->f_op);
+++++++++++ file->f_op = fops_get(old_fops);
+ +++ }
+ +++ fops_put(old_fops);
+ +++ return err;
}
return -ENODEV;
}
@@@@@@@@@@@@@ -352,45 -352,45 -352,45 -352,45 -352,45 -352,45 -352,45 -352,45 -352,45 -352,45 -352,45 -352,45 +352,45 @@@@@@@@@@@@@ int dvb_usercopy(struct inode *inode, s
*/
parg = (void *) arg;
break;
- --- case _IOC_READ: /* some v4l ioctls are marked wrong ... */
- --- case _IOC_WRITE:
- --- case (_IOC_WRITE | _IOC_READ):
- --- if (_IOC_SIZE(cmd) <= sizeof(sbuf)) {
- --- parg = sbuf;
- --- } else {
- --- /* too big to allocate from stack */
- --- mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL);
- --- if (NULL == mbuf)
- --- return -ENOMEM;
- --- parg = mbuf;
- --- }
- ---
- --- err = -EFAULT;
- --- if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))
- --- goto out;
- --- break;
- --- }
- ---
- --- /* call driver */
- --- if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD)
- --- err = -EINVAL;
- ---
- --- if (err < 0)
- --- goto out;
- ---
- --- /* Copy results into user buffer */
- --- switch (_IOC_DIR(cmd))
- --- {
- --- case _IOC_READ:
- --- case (_IOC_WRITE | _IOC_READ):
- --- if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd)))
- --- err = -EFAULT;
- --- break;
- --- }
+ +++ case _IOC_READ: /* some v4l ioctls are marked wrong ... */
+ +++ case _IOC_WRITE:
+ +++ case (_IOC_WRITE | _IOC_READ):
+ +++ if (_IOC_SIZE(cmd) <= sizeof(sbuf)) {
-- - ---- parg = sbuf;
+++++++++++ parg = sbuf;
+ +++ } else {
-- - ---- /* too big to allocate from stack */
-- - ---- mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL);
-- - ---- if (NULL == mbuf)
-- - ---- return -ENOMEM;
-- - ---- parg = mbuf;
+++++++++++ /* too big to allocate from stack */
+++++++++++ mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL);
+++++++++++ if (NULL == mbuf)
+++++++++++ return -ENOMEM;
+++++++++++ parg = mbuf;
+ +++ }
+ +++
+ +++ err = -EFAULT;
+ +++ if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd)))
-- - ---- goto out;
+++++++++++ goto out;
+ +++ break;
+ +++ }
+ +++
+ +++ /* call driver */
+ +++ if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD)
+ +++ err = -EINVAL;
+ +++
+ +++ if (err < 0)
+ +++ goto out;
+ +++
+ +++ /* Copy results into user buffer */
+ +++ switch (_IOC_DIR(cmd))
+ +++ {
+ +++ case _IOC_READ:
+ +++ case (_IOC_WRITE | _IOC_READ):
+ +++ if (copy_to_user((void __user *)arg, parg, _IOC_SIZE(cmd)))
-- - ---- err = -EFAULT;
+++++++++++ err = -EFAULT;
+ +++ break;
+ +++ }
out:
- --- kfree(mbuf);
- --- return err;
+ +++ kfree(mbuf);
+ +++ return err;
}
static int __init init_dvbdev(void)
diff --cc drivers/media/dvb/dvb-core/dvbdev.h
index 74ed585,0cc6e4a,0cc6e4a,a251867,0cc6e4a,a251867,a251867,a251867,0cc6e4a,0cc6e4a,0cc6e4a,0cc6e4a..74ed585
--- a/drivers/media/dvb/dvb-core/dvbdev.h
+++ b/drivers/media/dvb/dvb-core/dvbdev.h
@@@@@@@@@@@@@ -97,7 -97,7 -97,7 -97,7 -97,7 -97,7 -97,7 -97,7 -97,7 -97,7 -97,7 -97,7 +97,7 @@@@@@@@@@@@@ we simply define out own dvb_usercopy()
generic_usercopy() someday... */
extern int dvb_usercopy(struct inode *inode, struct file *file,
-- - ---- unsigned int cmd, unsigned long arg,
- --- unsigned int cmd, unsigned long arg,
+++++++++++ unsigned int cmd, unsigned long arg,
int (*func)(struct inode *inode, struct file *file,
unsigned int cmd, void *arg));
diff --cc drivers/media/dvb/dvb-usb/cxusb.c
index a7fb06f,d05fab0,3fe383f,3fe383f,3fe383f,3fe383f,3fe383f,3fe383f,d05fab0,3fe383f,d05fab0,d05fab0..a7fb06f
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@@@@@@@@@@@@ -493,176 -240,7 -240,8 -240,8 -240,8 -240,8 -240,8 -240,8 -240,7 -240,8 -240,7 -240,7 +493,176 @@@@@@@@@@@@@ static struct dvb_usb_properties cxusb_
}
};
+++++++++++static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = {
+++++++++++ .caps = DVB_USB_IS_AN_I2C_ADAPTER,
+++++++++++
+++++++++++ .usb_ctrl = DEVICE_SPECIFIC,
+++++++++++ .firmware = "dvb-usb-bluebird-01.fw",
+++++++++++ .download_firmware = bluebird_patch_dvico_firmware_download,
+++++++++++ /* use usb alt setting 0 for EP4 transfer (dvb-t),
+++++++++++ use usb alt setting 7 for EP2 transfer (atsc) */
+++++++++++
+++++++++++ .size_of_priv = sizeof(struct cxusb_state),
+++++++++++
+++++++++++ .streaming_ctrl = cxusb_streaming_ctrl,
+++++++++++ .power_ctrl = cxusb_power_ctrl,
+++++++++++ .frontend_attach = cxusb_lgdt330x_frontend_attach,
+++++++++++ .tuner_attach = cxusb_lgh064f_tuner_attach,
+++++++++++
+++++++++++ .i2c_algo = &cxusb_i2c_algo,
+++++++++++
+++++++++++ .generic_bulk_ctrl_endpoint = 0x01,
+++++++++++ /* parameter for the MPEG2-data transfer */
+++++++++++ .urb = {
+++++++++++ .type = DVB_USB_BULK,
+++++++++++ .count = 5,
+++++++++++ .endpoint = 0x02,
+++++++++++ .u = {
+++++++++++ .bulk = {
+++++++++++ .buffersize = 8192,
+++++++++++ }
+++++++++++ }
+++++++++++ },
+++++++++++
+++++++++++ .num_device_descs = 1,
+++++++++++ .devices = {
+++++++++++ { "DViCO FusionHDTV5 USB Gold",
+++++++++++ { &cxusb_table[1], NULL },
+++++++++++ { &cxusb_table[2], NULL },
+++++++++++ },
+++++++++++ }
+++++++++++};
+++++++++++
+++++++++++static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
+++++++++++ .caps = DVB_USB_IS_AN_I2C_ADAPTER,
+++++++++++
+++++++++++ .usb_ctrl = DEVICE_SPECIFIC,
+++++++++++ .firmware = "dvb-usb-bluebird-01.fw",
+++++++++++ .download_firmware = bluebird_patch_dvico_firmware_download,
+++++++++++ /* use usb alt setting 0 for EP4 transfer (dvb-t),
+++++++++++ use usb alt setting 7 for EP2 transfer (atsc) */
+++++++++++
+++++++++++ .size_of_priv = sizeof(struct cxusb_state),
+++++++++++
+++++++++++ .streaming_ctrl = cxusb_streaming_ctrl,
+++++++++++ .power_ctrl = cxusb_power_ctrl,
+++++++++++ .frontend_attach = cxusb_dee1601_frontend_attach,
+++++++++++ .tuner_attach = cxusb_dee1601_tuner_attach,
+++++++++++
+++++++++++ .i2c_algo = &cxusb_i2c_algo,
+++++++++++
+++++++++++ .rc_interval = 150,
+++++++++++ .rc_key_map = dvico_mce_rc_keys,
+++++++++++ .rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys),
+++++++++++ .rc_query = cxusb_rc_query,
+++++++++++
+++++++++++ .generic_bulk_ctrl_endpoint = 0x01,
+++++++++++ /* parameter for the MPEG2-data transfer */
+++++++++++ .urb = {
+++++++++++ .type = DVB_USB_BULK,
+++++++++++ .count = 5,
+++++++++++ .endpoint = 0x04,
+++++++++++ .u = {
+++++++++++ .bulk = {
+++++++++++ .buffersize = 8192,
+++++++++++ }
+++++++++++ }
+++++++++++ },
+++++++++++
+++++++++++ .num_device_descs = 2,
+++++++++++ .devices = {
+++++++++++ { "DViCO FusionHDTV DVB-T Dual USB",
+++++++++++ { &cxusb_table[3], NULL },
+++++++++++ { &cxusb_table[4], NULL },
+++++++++++ },
+++++++++++ { "DigitalNow DVB-T Dual USB",
+++++++++++ { &cxusb_table[9], NULL },
+++++++++++ { &cxusb_table[10], NULL },
+++++++++++ },
+++++++++++ }
+++++++++++};
+++++++++++
+++++++++++static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = {
+++++++++++ .caps = DVB_USB_IS_AN_I2C_ADAPTER,
+++++++++++
+++++++++++ .usb_ctrl = DEVICE_SPECIFIC,
+++++++++++ .firmware = "dvb-usb-bluebird-01.fw",
+++++++++++ .download_firmware = bluebird_patch_dvico_firmware_download,
+++++++++++ /* use usb alt setting 0 for EP4 transfer (dvb-t),
+++++++++++ use usb alt setting 7 for EP2 transfer (atsc) */
+++++++++++
+++++++++++ .size_of_priv = sizeof(struct cxusb_state),
+++++++++++
+++++++++++ .streaming_ctrl = cxusb_streaming_ctrl,
+++++++++++ .power_ctrl = cxusb_power_ctrl,
+++++++++++ .frontend_attach = cxusb_mt352_frontend_attach,
+++++++++++ .tuner_attach = cxusb_lgz201_tuner_attach,
+++++++++++
+++++++++++ .i2c_algo = &cxusb_i2c_algo,
+++++++++++
+++++++++++ .generic_bulk_ctrl_endpoint = 0x01,
+++++++++++ /* parameter for the MPEG2-data transfer */
+++++++++++ .urb = {
+++++++++++ .type = DVB_USB_BULK,
+++++++++++ .count = 5,
+++++++++++ .endpoint = 0x04,
+++++++++++ .u = {
+++++++++++ .bulk = {
+++++++++++ .buffersize = 8192,
+++++++++++ }
+++++++++++ }
+++++++++++ },
+++++++++++
+++++++++++ .num_device_descs = 1,
+++++++++++ .devices = {
+++++++++++ { "DViCO FusionHDTV DVB-T USB (LGZ201)",
+++++++++++ { &cxusb_table[5], NULL },
+++++++++++ { &cxusb_table[6], NULL },
+++++++++++ },
+++++++++++ }
+++++++++++};
+++++++++++
+++++++++++static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = {
+++++++++++ .caps = DVB_USB_IS_AN_I2C_ADAPTER,
+++++++++++
+++++++++++ .usb_ctrl = DEVICE_SPECIFIC,
+++++++++++ .firmware = "dvb-usb-bluebird-01.fw",
+++++++++++ .download_firmware = bluebird_patch_dvico_firmware_download,
+++++++++++ /* use usb alt setting 0 for EP4 transfer (dvb-t),
+++++++++++ use usb alt setting 7 for EP2 transfer (atsc) */
+++++++++++
+++++++++++ .size_of_priv = sizeof(struct cxusb_state),
+++++++++++
+++++++++++ .streaming_ctrl = cxusb_streaming_ctrl,
+++++++++++ .power_ctrl = cxusb_power_ctrl,
+++++++++++ .frontend_attach = cxusb_mt352_frontend_attach,
+++++++++++ .tuner_attach = cxusb_dtt7579_tuner_attach,
+++++++++++
+++++++++++ .i2c_algo = &cxusb_i2c_algo,
+++++++++++
+++++++++++ .generic_bulk_ctrl_endpoint = 0x01,
+++++++++++ /* parameter for the MPEG2-data transfer */
+++++++++++ .urb = {
+++++++++++ .type = DVB_USB_BULK,
+++++++++++ .count = 5,
+++++++++++ .endpoint = 0x04,
+++++++++++ .u = {
+++++++++++ .bulk = {
+++++++++++ .buffersize = 8192,
+++++++++++ }
+++++++++++ }
+++++++++++ },
+++++++++++
+++++++++++ .num_device_descs = 1,
+++++++++++ .devices = {
+++++++++++ { "DViCO FusionHDTV DVB-T USB (TH7579)",
+++++++++++ { &cxusb_table[7], NULL },
+++++++++++ { &cxusb_table[8], NULL },
+++++++++++ },
+++++++++++ }
+++++++++++};
+++++++++++
static struct usb_driver cxusb_driver = {
------ - .owner = THIS_MODULE,
.name = "dvb_usb_cxusb",
.probe = cxusb_probe,
.disconnect = dvb_usb_device_exit,
diff --cc drivers/media/dvb/dvb-usb/vp702x-fe.c
index b6d95e1,104b5d0,104b5d0,f20d8db,104b5d0,f20d8db,f20d8db,f20d8db,104b5d0,104b5d0,104b5d0,104b5d0..b6d95e1
--- a/drivers/media/dvb/dvb-usb/vp702x-fe.c
+++ b/drivers/media/dvb/dvb-usb/vp702x-fe.c
@@@@@@@@@@@@@ -190,7 -190,7 -190,7 -190,7 -190,7 -190,7 -190,7 -190,7 -190,7 -190,7 -190,7 -190,7 +190,7 @@@@@@@@@@@@@ static int vp702x_fe_get_frontend(struc
}
static int vp702x_fe_send_diseqc_msg (struct dvb_frontend* fe,
-- - ---- struct dvb_diseqc_master_cmd *m)
- --- struct dvb_diseqc_master_cmd *m)
+++++++++++ struct dvb_diseqc_master_cmd *m)
{
struct vp702x_fe_state *st = fe->demodulator_priv;
u8 cmd[8],ibuf[10];
diff --cc drivers/media/dvb/frontends/cx24110.c
index d15d32c,0c4db80,0c4db80,654d7dc,0c4db80,654d7dc,654d7dc,654d7dc,0c4db80,0c4db80,0c4db80,0c4db80..d15d32c
--- a/drivers/media/dvb/frontends/cx24110.c
+++ b/drivers/media/dvb/frontends/cx24110.c
@@@@@@@@@@@@@ -54,65 -55,65 -55,65 -55,65 -55,65 -55,65 -55,65 -55,65 -55,65 -55,65 -55,65 -55,65 +54,65 @@@@@@@@@@@@@ static int debug
} while (0)
static struct {u8 reg; u8 data;} cx24110_regdata[]=
- --- /* Comments beginning with @ denote this value should
- --- be the default */
- --- {{0x09,0x01}, /* SoftResetAll */
- --- {0x09,0x00}, /* release reset */
- --- {0x01,0xe8}, /* MSB of code rate 27.5MS/s */
- --- {0x02,0x17}, /* middle byte " */
- --- {0x03,0x29}, /* LSB " */
- --- {0x05,0x03}, /* @ DVB mode, standard code rate 3/4 */
- --- {0x06,0xa5}, /* @ PLL 60MHz */
- --- {0x07,0x01}, /* @ Fclk, i.e. sampling clock, 60MHz */
- --- {0x0a,0x00}, /* @ partial chip disables, do not set */
- --- {0x0b,0x01}, /* set output clock in gapped mode, start signal low
- --- active for first byte */
- --- {0x0c,0x11}, /* no parity bytes, large hold time, serial data out */
- --- {0x0d,0x6f}, /* @ RS Sync/Unsync thresholds */
- --- {0x10,0x40}, /* chip doc is misleading here: write bit 6 as 1
- --- to avoid starting the BER counter. Reset the
- --- CRC test bit. Finite counting selected */
- --- {0x15,0xff}, /* @ size of the limited time window for RS BER
- --- estimation. It is <value>*256 RS blocks, this
- --- gives approx. 2.6 sec at 27.5MS/s, rate 3/4 */
- --- {0x16,0x00}, /* @ enable all RS output ports */
- --- {0x17,0x04}, /* @ time window allowed for the RS to sync */
- --- {0x18,0xae}, /* @ allow all standard DVB code rates to be scanned
- --- for automatically */
- --- /* leave the current code rate and normalization
- --- registers as they are after reset... */
- --- {0x21,0x10}, /* @ during AutoAcq, search each viterbi setting
- --- only once */
- --- {0x23,0x18}, /* @ size of the limited time window for Viterbi BER
- --- estimation. It is <value>*65536 channel bits, i.e.
- --- approx. 38ms at 27.5MS/s, rate 3/4 */
- --- {0x24,0x24}, /* do not trigger Viterbi CRC test. Finite count window */
- --- /* leave front-end AGC parameters at default values */
- --- /* leave decimation AGC parameters at default values */
- --- {0x35,0x40}, /* disable all interrupts. They are not connected anyway */
- --- {0x36,0xff}, /* clear all interrupt pending flags */
- --- {0x37,0x00}, /* @ fully enable AutoAcqq state machine */
- --- {0x38,0x07}, /* @ enable fade recovery, but not autostart AutoAcq */
- --- /* leave the equalizer parameters on their default values */
- --- /* leave the final AGC parameters on their default values */
- --- {0x41,0x00}, /* @ MSB of front-end derotator frequency */
- --- {0x42,0x00}, /* @ middle bytes " */
- --- {0x43,0x00}, /* @ LSB " */
- --- /* leave the carrier tracking loop parameters on default */
- --- /* leave the bit timing loop parameters at gefault */
- --- {0x56,0x4d}, /* set the filtune voltage to 2.7V, as recommended by */
- --- /* the cx24108 data sheet for symbol rates above 15MS/s */
- --- {0x57,0x00}, /* @ Filter sigma delta enabled, positive */
- --- {0x61,0x95}, /* GPIO pins 1-4 have special function */
- --- {0x62,0x05}, /* GPIO pin 5 has special function, pin 6 is GPIO */
- --- {0x63,0x00}, /* All GPIO pins use CMOS output characteristics */
- --- {0x64,0x20}, /* GPIO 6 is input, all others are outputs */
- --- {0x6d,0x30}, /* tuner auto mode clock freq 62kHz */
- --- {0x70,0x15}, /* use auto mode, tuner word is 21 bits long */
- --- {0x73,0x00}, /* @ disable several demod bypasses */
- --- {0x74,0x00}, /* @ " */
- --- {0x75,0x00} /* @ " */
- --- /* the remaining registers are for SEC */
+ +++ /* Comments beginning with @ denote this value should
-- - ---- be the default */
+++++++++++ be the default */
+ +++ {{0x09,0x01}, /* SoftResetAll */
+ +++ {0x09,0x00}, /* release reset */
+ +++ {0x01,0xe8}, /* MSB of code rate 27.5MS/s */
+ +++ {0x02,0x17}, /* middle byte " */
+ +++ {0x03,0x29}, /* LSB " */
+ +++ {0x05,0x03}, /* @ DVB mode, standard code rate 3/4 */
+ +++ {0x06,0xa5}, /* @ PLL 60MHz */
+ +++ {0x07,0x01}, /* @ Fclk, i.e. sampling clock, 60MHz */
+ +++ {0x0a,0x00}, /* @ partial chip disables, do not set */
+ +++ {0x0b,0x01}, /* set output clock in gapped mode, start signal low
-- - ---- active for first byte */
+++++++++++ active for first byte */
+ +++ {0x0c,0x11}, /* no parity bytes, large hold time, serial data out */
+ +++ {0x0d,0x6f}, /* @ RS Sync/Unsync thresholds */
+ +++ {0x10,0x40}, /* chip doc is misleading here: write bit 6 as 1
-- - ---- to avoid starting the BER counter. Reset the
-- - ---- CRC test bit. Finite counting selected */
+++++++++++ to avoid starting the BER counter. Reset the
+++++++++++ CRC test bit. Finite counting selected */
+ +++ {0x15,0xff}, /* @ size of the limited time window for RS BER
-- - ---- estimation. It is <value>*256 RS blocks, this
-- - ---- gives approx. 2.6 sec at 27.5MS/s, rate 3/4 */
+++++++++++ estimation. It is <value>*256 RS blocks, this
+++++++++++ gives approx. 2.6 sec at 27.5MS/s, rate 3/4 */
+ +++ {0x16,0x00}, /* @ enable all RS output ports */
+ +++ {0x17,0x04}, /* @ time window allowed for the RS to sync */
+ +++ {0x18,0xae}, /* @ allow all standard DVB code rates to be scanned
-- - ---- for automatically */
+++++++++++ for automatically */
+ +++ /* leave the current code rate and normalization
-- - ---- registers as they are after reset... */
+++++++++++ registers as they are after reset... */
+ +++ {0x21,0x10}, /* @ during AutoAcq, search each viterbi setting
-- - ---- only once */
+++++++++++ only once */
+ +++ {0x23,0x18}, /* @ size of the limited time window for Viterbi BER
-- - ---- estimation. It is <value>*65536 channel bits, i.e.
-- - ---- approx. 38ms at 27.5MS/s, rate 3/4 */
+++++++++++ estimation. It is <value>*65536 channel bits, i.e.
+++++++++++ approx. 38ms at 27.5MS/s, rate 3/4 */
+ +++ {0x24,0x24}, /* do not trigger Viterbi CRC test. Finite count window */
+ +++ /* leave front-end AGC parameters at default values */
+ +++ /* leave decimation AGC parameters at default values */
+ +++ {0x35,0x40}, /* disable all interrupts. They are not connected anyway */
+ +++ {0x36,0xff}, /* clear all interrupt pending flags */
+ +++ {0x37,0x00}, /* @ fully enable AutoAcqq state machine */
+ +++ {0x38,0x07}, /* @ enable fade recovery, but not autostart AutoAcq */
+ +++ /* leave the equalizer parameters on their default values */
+ +++ /* leave the final AGC parameters on their default values */
+ +++ {0x41,0x00}, /* @ MSB of front-end derotator frequency */
+ +++ {0x42,0x00}, /* @ middle bytes " */
+ +++ {0x43,0x00}, /* @ LSB " */
+ +++ /* leave the carrier tracking loop parameters on default */
+ +++ /* leave the bit timing loop parameters at gefault */
+ +++ {0x56,0x4d}, /* set the filtune voltage to 2.7V, as recommended by */
+ +++ /* the cx24108 data sheet for symbol rates above 15MS/s */
+ +++ {0x57,0x00}, /* @ Filter sigma delta enabled, positive */
+ +++ {0x61,0x95}, /* GPIO pins 1-4 have special function */
+ +++ {0x62,0x05}, /* GPIO pin 5 has special function, pin 6 is GPIO */
+ +++ {0x63,0x00}, /* All GPIO pins use CMOS output characteristics */
+ +++ {0x64,0x20}, /* GPIO 6 is input, all others are outputs */
+ +++ {0x6d,0x30}, /* tuner auto mode clock freq 62kHz */
+ +++ {0x70,0x15}, /* use auto mode, tuner word is 21 bits long */
+ +++ {0x73,0x00}, /* @ disable several demod bypasses */
+ +++ {0x74,0x00}, /* @ " */
+ +++ {0x75,0x00} /* @ " */
+ +++ /* the remaining registers are for SEC */
};
diff --cc drivers/media/dvb/frontends/cx24123.c
index d661c6f,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..d661c6f
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/media/dvb/frontends/cx24123.c
+++ b/drivers/media/dvb/frontends/cx24123.c
diff --cc drivers/media/dvb/frontends/cx24123.h
index 0c922b5,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..0c922b5
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/media/dvb/frontends/cx24123.h
+++ b/drivers/media/dvb/frontends/cx24123.h
diff --cc drivers/media/dvb/frontends/nxt6000.c
index a16eeba,a458a3b,a458a3b,88a57b7,a458a3b,88a57b7,88a57b7,88a57b7,a458a3b,a458a3b,a458a3b,a458a3b..a16eeba
--- a/drivers/media/dvb/frontends/nxt6000.c
+++ b/drivers/media/dvb/frontends/nxt6000.c
@@@@@@@@@@@@@ -574,11 -574,11 -574,11 -574,11 -574,11 -574,11 -574,11 -574,11 -574,11 -574,11 -574,11 -574,11 +574,11 @@@@@@@@@@@@@ static struct dvb_frontend_ops nxt6000_
.symbol_rate_max = 9360000, /* FIXME */
.symbol_rate_tolerance = 4000,
.caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
-- - ---- FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |
-- - ---- FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO |
-- - ---- FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
-- - ---- FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO |
-- - ---- FE_CAN_HIERARCHY_AUTO,
- --- FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |
- --- FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO |
- --- FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
- --- FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO |
- --- FE_CAN_HIERARCHY_AUTO,
+++++++++++ FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 |
+++++++++++ FE_CAN_FEC_7_8 | FE_CAN_FEC_8_9 | FE_CAN_FEC_AUTO |
+++++++++++ FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
+++++++++++ FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO |
+++++++++++ FE_CAN_HIERARCHY_AUTO,
},
.release = nxt6000_release,
diff --cc drivers/media/dvb/frontends/s5h1420.c
index d694775,1871509,1871509,f265418,1871509,f265418,f265418,f265418,1871509,1871509,1871509,1871509..d694775
--- a/drivers/media/dvb/frontends/s5h1420.c
+++ b/drivers/media/dvb/frontends/s5h1420.c
@@@@@@@@@@@@@ -521,8 -521,8 -521,8 -521,8 -521,8 -521,8 -521,8 -521,8 -521,8 -521,8 -521,8 -521,8 +521,8 @@@@@@@@@@@@@ static void s5h1420_setfec_inversion(st
case FEC_3_4:
s5h1420_writereg(state, 0x30, 0x04);
-- - ---- s5h1420_writereg(state, 0x31, 0x12 | inversion);
-- - ---- break;
- --- s5h1420_writereg(state, 0x31, 0x12 | inversion);
- --- break;
+++++++++++ s5h1420_writereg(state, 0x31, 0x12 | inversion);
+++++++++++ break;
case FEC_5_6:
s5h1420_writereg(state, 0x30, 0x08);
diff --cc drivers/media/dvb/frontends/sp887x.c
index eb8a602,e3b6657,e3b6657,73384e7,e3b6657,73384e7,73384e7,73384e7,e3b6657,e3b6657,e3b6657,e3b6657..eb8a602
--- a/drivers/media/dvb/frontends/sp887x.c
+++ b/drivers/media/dvb/frontends/sp887x.c
@@@@@@@@@@@@@ -582,7 -581,7 -581,7 -581,7 -581,7 -581,7 -581,7 -581,7 -581,7 -581,7 -581,7 -581,7 +582,7 @@@@@@@@@@@@@ static struct dvb_frontend_ops sp887x_o
.caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 |
-- - ---- FE_CAN_RECOVER
- --- FE_CAN_RECOVER
+++++++++++ FE_CAN_RECOVER
},
.release = sp887x_release,
diff --cc drivers/media/dvb/frontends/stv0299.c
index 5bcd00f,177d71d,177d71d,29c4866,177d71d,29c4866,29c4866,29c4866,177d71d,177d71d,177d71d,177d71d..5bcd00f
--- a/drivers/media/dvb/frontends/stv0299.c
+++ b/drivers/media/dvb/frontends/stv0299.c
@@@@@@@@@@@@@ -721,9 -714,8 -714,8 -714,8 -714,8 -714,8 -714,8 -714,8 -714,8 -714,8 -714,8 -714,8 +721,9 @@@@@@@@@@@@@ MODULE_PARM_DESC(debug, "Turn on/off fr
MODULE_DESCRIPTION("ST STV0299 DVB Demodulator driver");
MODULE_AUTHOR("Ralph Metzler, Holger Waechtler, Peter Schildmann, Felix Domke, "
- --- "Andreas Oberritter, Andrew de Quincey, Kenneth Aafløy");
+ +++ "Andreas Oberritter, Andrew de Quincey, Kenneth Aafløy");
MODULE_LICENSE("GPL");
+++++++++++EXPORT_SYMBOL(stv0299_enable_plli2c);
EXPORT_SYMBOL(stv0299_writereg);
EXPORT_SYMBOL(stv0299_attach);
diff --cc drivers/media/dvb/frontends/tda10021.c
index 21255ca,425cd19,425cd19,eaf130e,425cd19,eaf130e,eaf130e,eaf130e,425cd19,425cd19,425cd19,425cd19..21255ca
--- a/drivers/media/dvb/frontends/tda10021.c
+++ b/drivers/media/dvb/frontends/tda10021.c
@@@@@@@@@@@@@ -95,7 -95,7 -95,7 -95,7 -95,7 -95,7 -95,7 -95,7 -95,7 -95,7 -95,7 -95,7 +95,7 @@@@@@@@@@@@@ static u8 tda10021_readreg (struct tda1
u8 b0 [] = { reg };
u8 b1 [] = { 0 };
struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = b0, .len = 1 },
-- - ---- { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } };
- --- { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } };
+++++++++++ { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } };
int ret;
ret = i2c_transfer (state->i2c, msg, 2);
diff --cc drivers/media/dvb/ttpci/av7110.c
index 2749490,7dae91e,992be0b,87ea527,7dae91e,87ea527,87ea527,87ea527,7dae91e,7dae91e,7dae91e,7dae91e..2749490
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@@@@@@@@@@@@ -2294,7 -2248,7 -2245,7 -2245,7 -2248,7 -2245,7 -2245,7 -2245,7 -2248,7 -2248,7 -2248,7 -2248,7 +2294,7 @@@@@@@@@@@@@ static int frontend_init(struct av7110
}
// Try the grundig 29504-451
-- - ---- av7110->fe = tda8083_attach(&grundig_29504_451_config, &av7110->i2c_adap);
- --- av7110->fe = tda8083_attach(&grundig_29504_451_config, &av7110->i2c_adap);
+++++++++++ av7110->fe = tda8083_attach(&grundig_29504_451_config, &av7110->i2c_adap);
if (av7110->fe) {
av7110->fe->ops->diseqc_send_master_cmd = av7110_diseqc_send_master_cmd;
av7110->fe->ops->diseqc_send_burst = av7110_diseqc_send_burst;
@@@@@@@@@@@@@ -2321,12 -2274,12 -2271,12 -2271,12 -2274,12 -2271,12 -2271,12 -2271,12 -2274,12 -2274,12 -2274,12 -2274,12 +2321,12 @@@@@@@@@@@@@
case 0x0001: // Hauppauge/TT Nexus-T premium rev1.X
// ALPS TDLB7
-- - ---- av7110->fe = sp8870_attach(&alps_tdlb7_config, &av7110->i2c_adap);
- --- av7110->fe = sp8870_attach(&alps_tdlb7_config, &av7110->i2c_adap);
+++++++++++ av7110->fe = sp8870_attach(&alps_tdlb7_config, &av7110->i2c_adap);
break;
case 0x0002: // Hauppauge/TT DVB-C premium rev2.X
-- - ---- av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110));
- --- av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110));
+++++++++++ av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110));
break;
case 0x0006: /* Fujitsu-Siemens DVB-S rev 1.6 */
diff --cc drivers/media/dvb/ttpci/av7110_hw.c
index b2e63e9,87106e8,87106e8,7442f56,87106e8,7442f56,7442f56,7442f56,87106e8,87106e8,87106e8,87106e8..b2e63e9
--- a/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/drivers/media/dvb/ttpci/av7110_hw.c
@@@@@@@@@@@@@ -1206,15 -1203,15 -1203,15 -1203,15 -1203,15 -1203,15 -1203,15 -1203,15 -1203,15 -1203,15 -1203,15 -1203,15 +1206,15 @@@@@@@@@@@@@ int av7110_osd_cmd(struct av7110 *av711
int av7110_osd_capability(struct av7110 *av7110, osd_cap_t *cap)
{
- --- switch (cap->cmd) {
- --- case OSD_CAP_MEMSIZE:
- --- if (FW_4M_SDRAM(av7110->arm_app))
- --- cap->val = 1000000;
- --- else
- --- cap->val = 92000;
- --- return 0;
- --- default:
- --- return -EINVAL;
- --- }
+ +++ switch (cap->cmd) {
+ +++ case OSD_CAP_MEMSIZE:
+ +++ if (FW_4M_SDRAM(av7110->arm_app))
-- - ---- cap->val = 1000000;
+++++++++++ cap->val = 1000000;
+ +++ else
-- - ---- cap->val = 92000;
+++++++++++ cap->val = 92000;
+ +++ return 0;
+ +++ default:
+ +++ return -EINVAL;
+ +++ }
}
#endif /* CONFIG_DVB_AV7110_OSD */
diff --cc drivers/media/dvb/ttpci/budget.h
index c7bb63c,c8d48cf,fdaa331,c6ef496,fdaa331,c6ef496,c6ef496,c6ef496,c8d48cf,fdaa331,c8d48cf,c8d48cf..c7bb63c
--- a/drivers/media/dvb/ttpci/budget.h
+++ b/drivers/media/dvb/ttpci/budget.h
@@@@@@@@@@@@@ -19,7 -19,7 -19,7 -19,7 -19,7 -19,7 -19,7 -19,7 -19,7 -19,7 -19,7 -19,7 +19,7 @@@@@@@@@@@@@ extern int budget_debug
#endif
#define dprintk(level,args...) \
- - - do { if ((budget_debug & level)) { printk("%s: %s(): ",__stringify(KBUILD_MODNAME), __FUNCTION__); printk(args); } } while (0)
- --- do { if ((budget_debug & level)) { printk("%s: %s(): ",__stringify(KBUILD_MODNAME), __FUNCTION__); printk(args); } } while (0)
++++++ + do { if ((budget_debug & level)) { printk("%s: %s(): ", KBUILD_MODNAME, __FUNCTION__); printk(args); } } while (0)
struct budget_info {
char *name;
diff --cc drivers/media/dvb/ttpci/ttpci-eeprom.c
index 1f31e91,18aa22b,18aa22b,e9a8457,18aa22b,e9a8457,e9a8457,e9a8457,18aa22b,18aa22b,18aa22b,18aa22b..1f31e91
--- a/drivers/media/dvb/ttpci/ttpci-eeprom.c
+++ b/drivers/media/dvb/ttpci/ttpci-eeprom.c
@@@@@@@@@@@@@ -13,7 -13,7 -13,7 -13,7 -13,7 -13,7 -13,7 -13,7 -13,7 -13,7 -13,7 -13,7 +13,7 @@@@@@@@@@@@@
Holger Waechtler Convergence
Copyright (C) 2002-2003 Ralph Metzler <rjkm@metzlerbros.de>
-- - ---- Metzler Brothers Systementwicklung GbR
- --- Metzler Brothers Systementwicklung GbR
+++++++++++ Metzler Brothers Systementwicklung GbR
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --cc drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 5a13c47,104df61,104df61,fd53d60,104df61,fd53d60,fd53d60,fd53d60,104df61,104df61,104df61,104df61..5a13c47
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@@@@@@@@@@@@ -1487,11 -1487,13 -1487,13 -1487,13 -1487,13 -1487,13 -1487,13 -1487,13 -1487,13 -1487,13 -1487,13 -1487,13 +1487,11 @@@@@@@@@@@@@ static int ttusb_probe(struct usb_inter
udev = interface_to_usbdev(intf);
- --- if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV;
+ +++ if (intf->altsetting->desc.bInterfaceNumber != 1) return -ENODEV;
----------- if (!(ttusb = kmalloc(sizeof(struct ttusb), GFP_KERNEL)))
+++++++++++ if (!(ttusb = kzalloc(sizeof(struct ttusb), GFP_KERNEL)))
return -ENOMEM;
----------- memset(ttusb, 0, sizeof(struct ttusb));
-----------
ttusb->dev = udev;
ttusb->c = 0;
ttusb->mux_state = 0;
diff --cc drivers/media/dvb/ttusb-dec/ttusb_dec.c
index df83117,8abc218,8abc218,832d179,8abc218,832d179,832d179,832d179,8abc218,8abc218,8abc218,8abc218..df83117
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@@@@@@@@@@@@ -1203,7 -1203,7 -1203,7 -1203,7 -1203,7 -1203,7 -1203,7 -1203,7 -1203,7 -1203,7 -1203,7 -1203,7 +1203,7 @@@@@@@@@@@@@ static int ttusb_init_rc( struct ttusb_
input_dev->keycode = rc_keys;
for (i = 0; i < ARRAY_SIZE(rc_keys); i++)
-- - ---- set_bit(rc_keys[i], input_dev->keybit);
- --- set_bit(rc_keys[i], input_dev->keybit);
+++++++++++ set_bit(rc_keys[i], input_dev->keybit);
input_register_device(input_dev);
diff --cc drivers/media/video/bt819.c
index d644779,560b998,3ee0afc,3ee0afc,3ee0afc,3ee0afc,3ee0afc,3ee0afc,560b998,3ee0afc,560b998,560b998..d644779
--- a/drivers/media/video/bt819.c
+++ b/drivers/media/video/bt819.c
@@@@@@@@@@@@@ -534,8 -534,9 -534,10 -534,10 -534,10 -534,10 -534,10 -534,10 -534,9 -534,10 -534,9 -534,9 +534,8 @@@@@@@@@@@@@ bt819_detect_client (struct i2c_adapte
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver_bt819;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
----------- decoder = kmalloc(sizeof(struct bt819), GFP_KERNEL);
+++++++++++ decoder = kzalloc(sizeof(struct bt819), GFP_KERNEL);
if (decoder == NULL) {
kfree(client);
return -ENOMEM;
diff --cc drivers/media/video/bt832.c
index cc54b62,1c3ff5f,3ca1d76,e406395,3ca1d76,e406395,e406395,e406395,1c3ff5f,3ca1d76,1c3ff5f,1c3ff5f..cc54b62
--- a/drivers/media/video/bt832.c
+++ b/drivers/media/video/bt832.c
@@@@@@@@@@@@@ -229,18 -230,18 -230,19 -230,19 -230,19 -230,19 -230,19 -230,19 -230,18 -230,19 -230,18 -230,18 +229,18 @@@@@@@@@@@@@ bt832_command(struct i2c_client *client
/* ----------------------------------------------------------------------- */
static struct i2c_driver driver = {
------ - .owner = THIS_MODULE,
- - - .name = "i2c bt832 driver",
- - - .id = -1, /* FIXME */
- - - .flags = I2C_DF_NOTIFY,
- --- .name = "i2c bt832 driver",
- --- .id = -1, /* FIXME */
- --- .flags = I2C_DF_NOTIFY,
- --- .attach_adapter = bt832_probe,
- --- .detach_client = bt832_detach,
- --- .command = bt832_command,
++++++ + .driver = {
- - -- .name = "i2c bt832 driver",
+++++++++++ .name = "bt832",
++++++ + },
- - -- .id = -1, /* FIXME */
+++++++++++ .id = 0, /* FIXME */
+ +++ .attach_adapter = bt832_probe,
+ +++ .detach_client = bt832_detach,
+ +++ .command = bt832_command,
};
static struct i2c_client client_template =
{
.name = "bt832",
------ - .flags = I2C_CLIENT_ALLOW_USE,
- --- .driver = &driver,
+ +++ .driver = &driver,
};
diff --cc drivers/media/video/bt856.c
index 909b593,6050806,8eb871d,8eb871d,8eb871d,8eb871d,8eb871d,8eb871d,6050806,8eb871d,6050806,6050806..909b593
--- a/drivers/media/video/bt856.c
+++ b/drivers/media/video/bt856.c
@@@@@@@@@@@@@ -322,9 -322,10 -322,11 -322,11 -322,11 -322,11 -322,11 -322,11 -322,10 -322,11 -322,10 -322,10 +322,9 @@@@@@@@@@@@@ bt856_detect_client (struct i2c_adapte
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver_bt856;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
strlcpy(I2C_NAME(client), "bt856", sizeof(I2C_NAME(client)));
----------- encoder = kmalloc(sizeof(struct bt856), GFP_KERNEL);
+++++++++++ encoder = kzalloc(sizeof(struct bt856), GFP_KERNEL);
if (encoder == NULL) {
kfree(client);
return -ENOMEM;
diff --cc drivers/media/video/bttv-input.c
index 221b36e,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..221b36e
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/media/video/bttv-input.c
+++ b/drivers/media/video/bttv-input.c
diff --cc drivers/media/video/compat_ioctl32.c
index 297c32a,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..297c32a
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/media/video/compat_ioctl32.c
+++ b/drivers/media/video/compat_ioctl32.c
diff --cc drivers/media/video/cs53l32a.c
index 8739c64,643ead1,780b352,780b352,780b352,780b352,780b352,780b352,643ead1,780b352,643ead1,643ead1..8739c64
--- a/drivers/media/video/cs53l32a.c
+++ b/drivers/media/video/cs53l32a.c
@@@@@@@@@@@@@ -39,6 -39,21 -39,20 -39,20 -39,20 -39,20 -39,20 -39,20 -39,21 -39,20 -39,21 -39,21 +39,6 @@@@@@@@@@@@@ module_param(debug, bool, 0644)
MODULE_PARM_DESC(debug, "Debugging messages\n\t\t\t0=Off (default), 1=On");
-----------#define cs53l32a_dbg(fmt, arg...) \
----------- do { \
----------- if (debug) \
- - -- printk(KERN_INFO "%s debug %d-%04x: " fmt, \
- - -- client->driver->driver.name, \
------ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); \
----------- } while (0)
-----------
-----------#define cs53l32a_err(fmt, arg...) do { \
- - -- printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------#define cs53l32a_info(fmt, arg...) do { \
- - -- printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------
static unsigned short normal_i2c[] = { 0x22 >> 1, I2C_CLIENT_END };
@@@@@@@@@@@@@ -148,9 -154,10 -153,11 -153,11 -153,11 -153,11 -153,11 -153,11 -154,10 -153,11 -154,10 -154,10 +148,9 @@@@@@@@@@@@@ static int cs53l32a_attach(struct i2c_a
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
snprintf(client->name, sizeof(client->name) - 1, "cs53l32a");
----------- cs53l32a_info("chip found @ 0x%x (%s)\n", address << 1, adapter->name);
+++++++++++ v4l_info(client, "chip found @ 0x%x (%s)\n", address << 1, adapter->name);
for (i = 1; i <= 7; i++) {
u8 v = cs53l32a_read(client, i);
diff --cc drivers/media/video/cx25840/cx25840-core.c
index c66c2c1,3b09f46,aea3f03,f6afeec,5b93723,f6afeec,f6afeec,f6afeec,3b09f46,5b93723,3b09f46,3b09f46..c66c2c1
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@@@@@@@@@@@@ -221,32 -223,32 -223,32 -220,7 -223,32 -220,7 -220,7 -220,7 -223,32 -223,32 -223,32 -223,32 +221,32 @@@@@@@@@@@@@ static void input_change(struct i2c_cli
cx25840_write(client, 0x80b, 0x10);
} else if (std & V4L2_STD_NTSC) {
/* NTSC */
-- - ---- if (state->cardtype == CARDTYPE_PVR150_WORKAROUND) {
- --- cx25840_write(client, 0x808, 0xf6);
+++++++++++ if (state->pvr150_workaround) {
+ +++ /* Certain Hauppauge PVR150 models have a hardware bug
+ +++ that causes audio to drop out. For these models the
+ +++ audio standard must be set explicitly.
+ +++ To be precise: it affects cards with tuner models
+ +++ 85, 99 and 112 (model numbers from tveeprom). */
+ +++ if (std == V4L2_STD_NTSC_M_JP) {
+ +++ /* Japan uses EIAJ audio standard */
+ +++ cx25840_write(client, 0x808, 0x2f);
+ +++ } else {
+ +++ /* Others use the BTSC audio standard */
+ +++ cx25840_write(client, 0x808, 0x1f);
+ +++ }
+ +++ /* South Korea uses the A2-M (aka Zweiton M) audio
+ +++ standard, and should set 0x808 to 0x3f, but I don't
+ +++ know how to detect this. */
+ +++ } else if (std == V4L2_STD_NTSC_M_JP) {
+ +++ /* Japan uses EIAJ audio standard */
+ +++ cx25840_write(client, 0x808, 0xf7);
+ +++ } else {
+ +++ /* Others use the BTSC audio standard */
+ +++ cx25840_write(client, 0x808, 0xf6);
+ +++ }
+ +++ /* South Korea uses the A2-M (aka Zweiton M) audio standard,
+ +++ and should set 0x808 to 0xf8, but I don't know how to
+ +++ detect this. */
cx25840_write(client, 0x80b, 0x00);
}
@@@@@@@@@@@@@ -257,51 -259,68 -259,68 -231,67 -259,68 -231,67 -231,67 -231,67 -259,68 -259,68 -259,68 -259,68 +257,51 @@@@@@@@@@@@@
}
}
-----------static int set_input(struct i2c_client *client, enum cx25840_input input)
+++++++++++static int set_input(struct i2c_client *client, enum cx25840_video_input vid_input,
+++++++++++ enum cx25840_audio_input aud_input)
{
struct cx25840_state *state = i2c_get_clientdata(client);
+++++++++++ u8 is_composite = (vid_input >= CX25840_COMPOSITE1 &&
+++++++++++ vid_input <= CX25840_COMPOSITE8);
+++++++++++ u8 reg;
----------- cx25840_dbg("decoder set input (%d)\n", input);
+++++++++++ v4l_dbg(1, cx25840_debug, client, "decoder set video input %d, audio input %d\n",
+++++++++++ vid_input, aud_input);
----------- switch (input) {
----------- case CX25840_TUNER:
----------- cx25840_dbg("now setting Tuner input\n");
-- - ----
-- - ---- if (state->cardtype == CARDTYPE_PVR150 ||
-- - ---- state->cardtype == CARDTYPE_PVR150_WORKAROUND) {
-- - ---- /* CH_SEL_ADC2=1 */
-- - ---- cx25840_and_or(client, 0x102, ~0x2, 0x02);
-- - ---- }
-- - ----
-- - ---- /* Video Input Control */
-- - ---- if (state->cardtype == CARDTYPE_PG600) {
-- - ---- cx25840_write(client, 0x103, 0x11);
-- - ---- } else {
-- - ---- cx25840_write(client, 0x103, 0x46);
-- - ---- }
-- - ----
-- - ---- /* INPUT_MODE=0 */
-- - ---- cx25840_and_or(client, 0x401, ~0x6, 0x00);
-- - ---- break;
-- - ----
-- - ---- case CX25840_COMPOSITE0:
-- - ---- case CX25840_COMPOSITE1:
-- - ---- cx25840_dbg("now setting Composite input\n");
+++++++++++ if (is_composite) {
+++++++++++ reg = 0xf0 + (vid_input - CX25840_COMPOSITE1);
+++++++++++ } else {
+++++++++++ int luma = vid_input & 0xf0;
+++++++++++ int chroma = vid_input & 0xf00;
-- - ---- /* Video Input Control */
-- - ---- if (state->cardtype == CARDTYPE_PG600) {
-- - ---- cx25840_write(client, 0x103, 0x00);
-- - ---- } else {
-- - ---- cx25840_write(client, 0x103, 0x02);
- --- if (state->cardtype == CARDTYPE_PVR150) {
- --- /* CH_SEL_ADC2=1 */
- --- cx25840_and_or(client, 0x102, ~0x2, 0x02);
+++++++++++ if ((vid_input & ~0xff0) ||
+++++++++++ luma < CX25840_SVIDEO_LUMA1 || luma > CX25840_SVIDEO_LUMA4 ||
+++++++++++ chroma < CX25840_SVIDEO_CHROMA4 || chroma > CX25840_SVIDEO_CHROMA8) {
+++++++++++ v4l_err(client, "0x%04x is not a valid video input!\n", vid_input);
+++++++++++ return -EINVAL;
}
-- - ----
-- - ---- /* INPUT_MODE=0 */
-- - ---- cx25840_and_or(client, 0x401, ~0x6, 0x00);
-- - ---- break;
-- - ----
-- - ---- case CX25840_SVIDEO0:
-- - ---- case CX25840_SVIDEO1:
-- - ---- cx25840_dbg("now setting S-Video input\n");
-- - ----
-- - ---- /* CH_SEL_ADC2=0 */
-- - ---- cx25840_and_or(client, 0x102, ~0x2, 0x00);
-----------
----------- /* Video Input Control */
----------- if (state->cardtype == CARDTYPE_PG600) {
-- - ---- cx25840_write(client, 0x103, 0x02);
- --- cx25840_write(client, 0x103, 0x11);
+++++++++++ reg = 0xf0 + ((luma - CX25840_SVIDEO_LUMA1) >> 4);
+++++++++++ if (chroma >= CX25840_SVIDEO_CHROMA7) {
+++++++++++ reg &= 0x3f;
+++++++++++ reg |= (chroma - CX25840_SVIDEO_CHROMA7) >> 2;
} else {
- --- cx25840_write(client, 0x103, 0x46);
- --- }
- ---
- --- /* INPUT_MODE=0 */
- --- cx25840_and_or(client, 0x401, ~0x6, 0x00);
- --- break;
- ---
- --- case CX25840_COMPOSITE0:
- --- case CX25840_COMPOSITE1:
- --- cx25840_dbg("now setting Composite input\n");
- ---
- --- /* Video Input Control */
- --- if (state->cardtype == CARDTYPE_PG600) {
- --- cx25840_write(client, 0x103, 0x00);
- --- } else {
- --- cx25840_write(client, 0x103, 0x02);
- --- }
- ---
- --- /* INPUT_MODE=0 */
- --- cx25840_and_or(client, 0x401, ~0x6, 0x00);
- --- break;
- ---
- --- case CX25840_SVIDEO0:
- --- case CX25840_SVIDEO1:
- --- cx25840_dbg("now setting S-Video input\n");
- ---
- --- /* CH_SEL_ADC2=0 */
- --- cx25840_and_or(client, 0x102, ~0x2, 0x00);
- ---
- --- /* Video Input Control */
- --- if (state->cardtype == CARDTYPE_PG600) {
- --- cx25840_write(client, 0x103, 0x02);
- --- } else {
----------- cx25840_write(client, 0x103, 0x10);
+++++++++++ reg &= 0xcf;
+++++++++++ reg |= (chroma - CX25840_SVIDEO_CHROMA4) >> 4;
}
+++++++++++ }
----------- /* INPUT_MODE=1 */
----------- cx25840_and_or(client, 0x401, ~0x6, 0x02);
+++++++++++ switch (aud_input) {
+++++++++++ case CX25840_AUDIO_SERIAL:
+++++++++++ /* do nothing, use serial audio input */
break;
+++++++++++ case CX25840_AUDIO4: reg &= ~0x30; break;
+++++++++++ case CX25840_AUDIO5: reg &= ~0x30; reg |= 0x10; break;
+++++++++++ case CX25840_AUDIO6: reg &= ~0x30; reg |= 0x20; break;
+++++++++++ case CX25840_AUDIO7: reg &= ~0xc0; break;
+++++++++++ case CX25840_AUDIO8: reg &= ~0xc0; reg |= 0x40; break;
default:
----------- cx25840_err("%d is not a valid input!\n", input);
+++++++++++ v4l_err(client, "0x%04x is not a valid audio input!\n", aud_input);
return -EINVAL;
}
@@@@@@@@@@@@@ -389,9 -395,18 -389,18 -360,17 -395,18 -360,17 -360,17 -360,17 -395,18 -395,18 -395,18 -395,18 +389,9 @@@@@@@@@@@@@ static int set_v4lctrl(struct i2c_clien
struct cx25840_state *state = i2c_get_clientdata(client);
switch (ctrl->id) {
----------- case CX25840_CID_CARDTYPE:
----------- switch (ctrl->value) {
----------- case CARDTYPE_PVR150:
-- - ---- case CARDTYPE_PVR150_WORKAROUND:
----------- case CARDTYPE_PG600:
----------- state->cardtype = ctrl->value;
----------- break;
----------- default:
----------- return -ERANGE;
----------- }
-----------
----------- set_input(client, state->input);
+++++++++++ case CX25840_CID_ENABLE_PVR150_WORKAROUND:
+++++++++++ state->pvr150_workaround = ctrl->value;
+++++++++++ set_input(client, state->vid_input, state->aud_input);
break;
case V4L2_CID_BRIGHTNESS:
@@@@@@@@@@@@@ -869,9 -772,10 -766,11 -736,11 -772,11 -736,11 -736,11 -736,11 -772,10 -772,11 -772,10 -772,10 +869,9 @@@@@@@@@@@@@ static int cx25840_detect_client(struc
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver_cx25840;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
snprintf(client->name, sizeof(client->name) - 1, "cx25840");
----------- cx25840_dbg("detecting cx25840 client on address 0x%x\n", address << 1);
+++++++++++ v4l_dbg(1, cx25840_debug, client, "detecting cx25840 client on address 0x%x\n", address << 1);
device_id = cx25840_read(client, 0x101) << 8;
device_id |= cx25840_read(client, 0x100);
@@@@@@@@@@@@@ -934,11 -842,13 -837,12 -807,12 -843,12 -807,12 -807,12 -807,12 -842,13 -843,12 -842,13 -842,13 +934,11 @@@@@@@@@@@@@ static int cx25840_detach_client(struc
/* ----------------------------------------------------------------------- */
- --- struct i2c_driver i2c_driver_cx25840 = {
- --- .name = "cx25840",
- ---
+ +++ static struct i2c_driver i2c_driver_cx25840 = {
- - - .name = "cx25840",
- - -
++++++ + .driver = {
++++++ + .name = "cx25840",
++++++ + },
- - --
.id = I2C_DRIVERID_CX25840,
------ - .flags = I2C_DF_NOTIFY,
-----------
.attach_adapter = cx25840_attach_adapter,
.detach_client = cx25840_detach_client,
.command = cx25840_command,
diff --cc drivers/media/video/cx25840/cx25840.h
index fd22f30,40aa59f,4932ed1,5c3f063,4932ed1,5c3f063,5c3f063,5c3f063,40aa59f,4932ed1,40aa59f,40aa59f..fd22f30
--- a/drivers/media/video/cx25840/cx25840.h
+++ b/drivers/media/video/cx25840/cx25840.h
@@@@@@@@@@@@@ -24,52 -24,41 -24,40 -24,33 -24,40 -24,33 -24,33 -24,33 -24,41 -24,40 -24,41 -24,41 +24,52 @@@@@@@@@@@@@
#include <linux/videodev2.h>
#include <linux/i2c.h>
-----------extern int cx25840_debug;
-----------
-----------#define cx25840_dbg(fmt, arg...) do { if (cx25840_debug) \
- - -- printk(KERN_INFO "%s debug %d-%04x: " fmt, \
- - -- client->driver->driver.name, \
------ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------
-----------#define cx25840_err(fmt, arg...) do { \
- - -- printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------
-----------#define cx25840_info(fmt, arg...) do { \
- - -- printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------
-----------#define CX25840_CID_CARDTYPE (V4L2_CID_PRIVATE_BASE+0)
-----------
-- - ----/* The CARDTYPE_PVR150_WORKAROUND cardtype activates a workaround for a
-- - ---- hardware bug that is present in PVR150 (and possible PVR500) cards that
-- - ---- have certain NTSC tuners (tveeprom model numbers 85, 99 and 112). The
- --- enum cx25840_cardtype {
- --- CARDTYPE_PVR150,
- --- CARDTYPE_PG600
+++++++++++/* ENABLE_PVR150_WORKAROUND activates a workaround for a hardware bug that is
+++++++++++ present in Hauppauge PVR-150 (and possibly PVR-500) cards that have
+++++++++++ certain NTSC tuners (tveeprom tuner model numbers 85, 99 and 112). The
+ +++ audio autodetect fails on some channels for these models and the workaround
+ +++ is to select the audio standard explicitly. Many thanks to Hauppauge for
+ +++ providing this information. */
-- - ----enum cx25840_cardtype {
-- - ---- CARDTYPE_PVR150,
-- - ---- CARDTYPE_PG600,
-- - ---- CARDTYPE_PVR150_WORKAROUND,
+++++++++++#define CX25840_CID_ENABLE_PVR150_WORKAROUND (V4L2_CID_PRIVATE_BASE+0)
+++++++++++
+++++++++++enum cx25840_video_input {
+++++++++++ /* Composite video inputs In1-In8 */
+++++++++++ CX25840_COMPOSITE1 = 1,
+++++++++++ CX25840_COMPOSITE2,
+++++++++++ CX25840_COMPOSITE3,
+++++++++++ CX25840_COMPOSITE4,
+++++++++++ CX25840_COMPOSITE5,
+++++++++++ CX25840_COMPOSITE6,
+++++++++++ CX25840_COMPOSITE7,
+++++++++++ CX25840_COMPOSITE8,
+++++++++++
+++++++++++ /* S-Video inputs consist of one luma input (In1-In4) ORed with one
+++++++++++ chroma input (In5-In8) */
+++++++++++ CX25840_SVIDEO_LUMA1 = 0x10,
+++++++++++ CX25840_SVIDEO_LUMA2 = 0x20,
+++++++++++ CX25840_SVIDEO_LUMA3 = 0x30,
+++++++++++ CX25840_SVIDEO_LUMA4 = 0x40,
+++++++++++ CX25840_SVIDEO_CHROMA4 = 0x400,
+++++++++++ CX25840_SVIDEO_CHROMA5 = 0x500,
+++++++++++ CX25840_SVIDEO_CHROMA6 = 0x600,
+++++++++++ CX25840_SVIDEO_CHROMA7 = 0x700,
+++++++++++ CX25840_SVIDEO_CHROMA8 = 0x800,
+++++++++++
+++++++++++ /* S-Video aliases for common luma/chroma combinations */
+++++++++++ CX25840_SVIDEO1 = 0x510,
+++++++++++ CX25840_SVIDEO2 = 0x620,
+++++++++++ CX25840_SVIDEO3 = 0x730,
+++++++++++ CX25840_SVIDEO4 = 0x840,
};
-----------enum cx25840_input {
----------- CX25840_TUNER,
----------- CX25840_COMPOSITE0,
----------- CX25840_COMPOSITE1,
----------- CX25840_SVIDEO0,
----------- CX25840_SVIDEO1
+++++++++++enum cx25840_audio_input {
+++++++++++ /* Audio inputs: serial or In4-In8 */
+++++++++++ CX25840_AUDIO_SERIAL,
+++++++++++ CX25840_AUDIO4 = 4,
+++++++++++ CX25840_AUDIO5,
+++++++++++ CX25840_AUDIO6,
+++++++++++ CX25840_AUDIO7,
+++++++++++ CX25840_AUDIO8,
};
struct cx25840_state {
diff --cc drivers/media/video/cx88/cx88-alsa.c
index a2e36a1,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..a2e36a1
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
diff --cc drivers/media/video/cx88/cx88-cards.c
index ad2f565,951709a,951709a,f226863,951709a,f226863,f226863,f226863,951709a,951709a,951709a,951709a..ad2f565
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@@@@@@@@@@@@ -1286,23 -1084,19 -1084,19 -1082,20 -1084,19 -1082,20 -1082,20 -1082,20 -1084,19 -1084,19 -1084,19 -1084,19 +1286,23 @@@@@@@@@@@@@ static void hauppauge_eeprom(struct cx8
tveeprom_hauppauge_analog(&core->i2c_client, &tv, eeprom_data);
core->tuner_type = tv.tuner_type;
+++++++++++ core->tuner_formats = tv.tuner_formats;
core->has_radio = tv.has_radio;
- --- }
- ---
- --- static int hauppauge_eeprom_dvb(struct cx88_core *core, u8 *ee)
- --- {
- --- int model;
- --- int tuner;
/* Make sure we support the board model */
- --- model = ee[0x1f] << 24 | ee[0x1e] << 16 | ee[0x1d] << 8 | ee[0x1c];
- --- switch(model) {
- --- case 90002:
- --- case 90500:
- --- case 90501:
+ +++ switch (tv.model)
+ +++ {
+++++++++++ case 28552: /* WinTV-PVR 'Roslyn' (No IR) */
+ +++ case 90002: /* Nova-T-PCI (9002) */
+ +++ case 92001: /* Nova-S-Plus (Video and IR) */
+ +++ case 92002: /* Nova-S-Plus (Video and IR) */
+ +++ case 90003: /* Nova-T-PCI (9002 No RF out) */
+ +++ case 90500: /* Nova-T-PCI (oem) */
+ +++ case 90501: /* Nova-T-PCI (oem/IR) */
+ +++ case 92000: /* Nova-SE2 (OEM, No Video or IR) */
-- - ----
+++++++++++ case 94009: /* WinTV-HVR1100 (Video and IR Retail) */
+++++++++++ case 94501: /* WinTV-HVR1100 (Video and IR OEM) */
+++++++++++ case 98559: /* WinTV-HVR1100LP (Video no IR, Retail - Low Profile) */
/* known */
break;
default:
@@@@@@@@@@@@@ -1417,21 -1211,12 -1211,12 -1222,12 -1211,12 -1222,12 -1222,12 -1222,12 -1211,12 -1211,12 -1211,12 -1211,12 +1417,21 @@@@@@@@@@@@@ void cx88_card_setup(struct cx88_core *
if (0 == core->i2c_rc)
leadtek_eeprom(core,eeprom);
break;
+++++++++++ case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1:
+++++++++++ case CX88_BOARD_HAUPPAUGE_NOVASE2_S1:
case CX88_BOARD_HAUPPAUGE_DVB_T1:
+++++++++++ case CX88_BOARD_HAUPPAUGE_HVR1100:
+++++++++++ case CX88_BOARD_HAUPPAUGE_HVR1100LP:
if (0 == core->i2c_rc)
- --- hauppauge_eeprom_dvb(core,eeprom);
+ +++ hauppauge_eeprom(core,eeprom);
+ +++ break;
+++++++++++ case CX88_BOARD_KWORLD_DVBS_100:
+++++++++++ cx_write(MO_GP0_IO, 0x000007f8);
+++++++++++ cx_write(MO_GP1_IO, 0x00000001);
++ + ++++ break;
case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1:
case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
+++++++++++ case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL:
/* GPIO0:0 is hooked to mt352 reset pin */
cx_set(MO_GP0_IO, 0x00000101);
cx_clear(MO_GP0_IO, 0x00000001);
diff --cc drivers/media/video/cx88/cx88-core.c
index 8d6d6a6,bb6eb54,bb6eb54,eb806af,bb6eb54,eb806af,eb806af,eb806af,bb6eb54,bb6eb54,bb6eb54,bb6eb54..8d6d6a6
--- a/drivers/media/video/cx88/cx88-core.c
+++ b/drivers/media/video/cx88/cx88-core.c
@@@@@@@@@@@@@ -785,28 -837,29 -837,29 -837,6 -837,29 -837,6 -837,6 -837,6 -837,29 -837,29 -837,29 -837,29 +785,28 @@@@@@@@@@@@@ static int set_pll(struct cx88_core *co
return -1;
}
+ +++ int cx88_start_audio_dma(struct cx88_core *core)
+ +++ {
+ +++ /* setup fifo + format */
+ +++ cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH25], 128, 0);
+ +++ cx88_sram_channel_setup(core, &cx88_sram_channels[SRAM_CH26], 128, 0);
+ +++
+ +++ cx_write(MO_AUDD_LNGTH, 128); /* fifo bpl size */
+ +++ cx_write(MO_AUDR_LNGTH, 128); /* fifo bpl size */
+ +++
+ +++ /* start dma */
+ +++ cx_write(MO_AUD_DMACNTRL, 0x0003); /* Up and Down fifo enable */
-- - ----
+ +++ return 0;
+ +++ }
+ +++
+ +++ int cx88_stop_audio_dma(struct cx88_core *core)
+ +++ {
+ +++ /* stop dma */
+ +++ cx_write(MO_AUD_DMACNTRL, 0x0000);
+ +++
+ +++ return 0;
+ +++ }
+ +++
static int set_tvaudio(struct cx88_core *core)
{
struct cx88_tvnorm *norm = core->tvnorm;
diff --cc drivers/media/video/cx88/cx88-tvaudio.c
index da8d97c,a1b120c,a1b120c,6d9bec1,a1b120c,6d9bec1,6d9bec1,6d9bec1,a1b120c,a1b120c,a1b120c,a1b120c..da8d97c
--- a/drivers/media/video/cx88/cx88-tvaudio.c
+++ b/drivers/media/video/cx88/cx88-tvaudio.c
@@@@@@@@@@@@@ -137,31 -132,22 -132,22 -135,18 -132,22 -135,18 -135,18 -135,18 -132,22 -132,22 -132,22 -132,22 +137,31 @@@@@@@@@@@@@ static void set_audio_finish(struct cx8
{
u32 volume;
+++++++++++#ifndef USING_CX88_ALSA
+ +++ /* restart dma; This avoids buzz in NICAM and is good in others */
+ +++ cx88_stop_audio_dma(core);
+++++++++++#endif
+ +++ cx_write(AUD_RATE_THRES_DMD, 0x000000C0);
+++++++++++#ifndef USING_CX88_ALSA
+ +++ cx88_start_audio_dma(core);
+++++++++++#endif
+ +++
if (cx88_boards[core->board].blackbird) {
- --- // sets sound input from external adc
- --- cx_set(AUD_CTL, EN_I2SIN_ENABLE);
- --- //cx_write(AUD_I2SINPUTCNTL, 0);
+ +++ /* sets sound input from external adc */
-- - ---- cx_set(AUD_CTL, EN_I2SIN_ENABLE);
+++++++++++ if (core->board == CX88_BOARD_HAUPPAUGE_ROSLYN)
+++++++++++ cx_clear(AUD_CTL, EN_I2SIN_ENABLE);
+++++++++++ else
+++++++++++ cx_set(AUD_CTL, EN_I2SIN_ENABLE);
+++++++++++
cx_write(AUD_I2SINPUTCNTL, 4);
cx_write(AUD_BAUDRATE, 1);
- --- // 'pass-thru mode': this enables the i2s output to the mpeg encoder
+ +++ /* 'pass-thru mode': this enables the i2s output to the mpeg encoder */
cx_set(AUD_CTL, EN_I2SOUT_ENABLE);
cx_write(AUD_I2SOUTPUTCNTL, 1);
cx_write(AUD_I2SCNTL, 0);
- --- //cx_write(AUD_APB_IN_RATE_ADJ, 0);
- --- } else {
+ +++ /* cx_write(AUD_APB_IN_RATE_ADJ, 0); */
-- - ---- } else {
+++++++++++ }
+++++++++++ if ((always_analog) || (!cx88_boards[core->board].blackbird)) {
ctl |= EN_DAC_ENABLE;
cx_write(AUD_CTL, ctl);
}
diff --cc drivers/media/video/cx88/cx88-vp3054-i2c.c
index 751a754,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..751a754
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/media/video/cx88/cx88-vp3054-i2c.c
+++ b/drivers/media/video/cx88/cx88-vp3054-i2c.c
diff --cc drivers/media/video/cx88/cx88-vp3054-i2c.h
index b7a0a04,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..b7a0a04
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/media/video/cx88/cx88-vp3054-i2c.h
+++ b/drivers/media/video/cx88/cx88-vp3054-i2c.h
diff --cc drivers/media/video/cx88/cx88.h
index e9fd55b,77beafc,77beafc,b19d3a9,77beafc,b19d3a9,b19d3a9,b19d3a9,77beafc,77beafc,77beafc,77beafc..e9fd55b
--- a/drivers/media/video/cx88/cx88.h
+++ b/drivers/media/video/cx88/cx88.h
@@@@@@@@@@@@@ -425,8 -411,6 -411,6 -411,7 -411,6 -411,7 -411,7 -411,7 -411,6 -411,6 -411,6 -411,6 +425,8 @@@@@@@@@@@@@ struct cx8802_dev
struct videobuf_dvb dvb;
void* fe_handle;
int (*fe_release)(void *handle);
++ + ++++
+++++++++++ void *card_priv;
/* for switching modulation types */
unsigned char ts_gen_cntrl;
diff --cc drivers/media/video/em28xx/em28xx-core.c
index dff3893,0cfe754,e8a1c22,d54bc01,0cfe754,d54bc01,d54bc01,d54bc01,0cfe754,0cfe754,0cfe754,0cfe754..dff3893
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@@@@@@@@@@@@ -32,25 -32,25 -32,25 -32,25 -32,25 -32,25 -32,25 -32,25 -32,25 -32,25 -32,25 -32,25 +32,25 @@@@@@@@@@@@@
/* #define ENABLE_DEBUG_ISOC_FRAMES */
-- - ----static unsigned int core_debug;
- --- unsigned int core_debug;
+++++++++++static unsigned int core_debug = 0;
module_param(core_debug,int,0644);
MODULE_PARM_DESC(core_debug,"enable debug messages [core]");
#define em28xx_coredbg(fmt, arg...) do {\
if (core_debug) \
printk(KERN_INFO "%s %s :"fmt, \
- dev->name, __FUNCTION__, ##arg); } while (0)
+ dev->name, __FUNCTION__ , ##arg); } while (0)
-- - ----static unsigned int reg_debug;
- --- unsigned int reg_debug;
+++++++++++static unsigned int reg_debug = 0;
module_param(reg_debug,int,0644);
MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]");
#define em28xx_regdbg(fmt, arg...) do {\
if (reg_debug) \
printk(KERN_INFO "%s %s :"fmt, \
- dev->name, __FUNCTION__, ##arg); } while (0)
+ dev->name, __FUNCTION__ , ##arg); } while (0)
-- - ----static unsigned int isoc_debug;
- --- unsigned int isoc_debug;
+++++++++++static unsigned int isoc_debug = 0;
module_param(isoc_debug,int,0644);
MODULE_PARM_DESC(isoc_debug,"enable debug messages [isoc transfers]");
@@@@@@@@@@@@@ -63,6 -63,59 -63,59 -63,100 -63,59 -63,100 -63,100 -63,100 -63,59 -63,59 -63,59 -63,59 +63,6 @@@@@@@@@@@@@ static int alt = EM28XX_PINOUT
module_param(alt, int, 0644);
MODULE_PARM_DESC(alt, "alternate setting to use for video endpoint");
-----------/* ------------------------------------------------------------------ */
-----------/* debug help functions */
-----------
-----------static const char *v4l1_ioctls[] = {
----------- "0", "CGAP", "GCHAN", "SCHAN", "GTUNER", "STUNER", "GPICT", "SPICT",
----------- "CCAPTURE", "GWIN", "SWIN", "GFBUF", "SFBUF", "KEY", "GFREQ",
----------- "SFREQ", "GAUDIO", "SAUDIO", "SYNC", "MCAPTURE", "GMBUF", "GUNIT",
----------- "GCAPTURE", "SCAPTURE", "SPLAYMODE", "SWRITEMODE", "GPLAYINFO",
----------- "SMICROCODE", "GVBIFMT", "SVBIFMT" };
-----------#define V4L1_IOCTLS ARRAY_SIZE(v4l1_ioctls)
-----------
-----------static const char *v4l2_ioctls[] = {
----------- "QUERYCAP", "1", "ENUM_PIXFMT", "ENUM_FBUFFMT", "G_FMT", "S_FMT",
----------- "G_COMP", "S_COMP", "REQBUFS", "QUERYBUF", "G_FBUF", "S_FBUF",
----------- "G_WIN", "S_WIN", "PREVIEW", "QBUF", "16", "DQBUF", "STREAMON",
----------- "STREAMOFF", "G_PERF", "G_PARM", "S_PARM", "G_STD", "S_STD",
----------- "ENUMSTD", "ENUMINPUT", "G_CTRL", "S_CTRL", "G_TUNER", "S_TUNER",
----------- "G_FREQ", "S_FREQ", "G_AUDIO", "S_AUDIO", "35", "QUERYCTRL",
----------- "QUERYMENU", "G_INPUT", "S_INPUT", "ENUMCVT", "41", "42", "43",
----------- "44", "45", "G_OUTPUT", "S_OUTPUT", "ENUMOUTPUT", "G_AUDOUT",
----------- "S_AUDOUT", "ENUMFX", "G_EFFECT", "S_EFFECT", "G_MODULATOR",
----------- "S_MODULATOR"
-----------};
-----------#define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)
-----------
-----------void em28xx_print_ioctl(char *name, unsigned int cmd)
-----------{
----------- char *dir;
-----------
----------- switch (_IOC_DIR(cmd)) {
----------- case _IOC_NONE: dir = "--"; break;
----------- case _IOC_READ: dir = "r-"; break;
----------- case _IOC_WRITE: dir = "-w"; break;
----------- case _IOC_READ | _IOC_WRITE: dir = "rw"; break;
----------- default: dir = "??"; break;
----------- }
----------- switch (_IOC_TYPE(cmd)) {
----------- case 'v':
----------- printk(KERN_DEBUG "%s: ioctl 0x%08x (v4l1, %s, VIDIOC%s)\n",
----------- name, cmd, dir, (_IOC_NR(cmd) < V4L1_IOCTLS) ?
----------- v4l1_ioctls[_IOC_NR(cmd)] : "???");
----------- break;
----------- case 'V':
----------- printk(KERN_DEBUG "%s: ioctl 0x%08x (v4l2, %s, VIDIOC_%s)\n",
----------- name, cmd, dir, (_IOC_NR(cmd) < V4L2_IOCTLS) ?
----------- v4l2_ioctls[_IOC_NR(cmd)] : "???");
----------- break;
----------- default:
----------- printk(KERN_DEBUG "%s: ioctl 0x%08x (???, %s, #%d)\n",
----------- name, cmd, dir, _IOC_NR(cmd));
- --- }
- --- }
- ---
- --- static void *rvmalloc(size_t size)
- --- {
- --- void *mem;
- --- unsigned long adr;
- ---
- --- size = PAGE_ALIGN(size);
- ---
- --- mem = vmalloc_32((unsigned long)size);
- --- if (!mem)
- --- return NULL;
- ---
- --- memset(mem, 0, size);
- ---
- --- adr = (unsigned long)mem;
- --- while (size > 0) {
- --- SetPageReserved(vmalloc_to_page((void *)adr));
- --- adr += PAGE_SIZE;
- --- size -= PAGE_SIZE;
----------- }
- ---
- --- return mem;
-----------}
- ---
- --- static void rvfree(void *mem, size_t size)
- --- {
- --- unsigned long adr;
- ---
- --- if (!mem)
- --- return;
- ---
- --- size = PAGE_ALIGN(size);
- ---
- --- adr = (unsigned long)mem;
- --- while (size > 0) {
- --- ClearPageReserved(vmalloc_to_page((void *)adr));
- --- adr += PAGE_SIZE;
- --- size -= PAGE_SIZE;
- --- }
-----------
- --- vfree(mem);
- --- }
/*
* em28xx_request_buffers()
@@@@@@@@@@@@@ -73,7 -126,7 -126,7 -167,7 -126,7 -167,7 -167,7 -167,7 -126,7 -126,7 -126,7 -126,7 +73,7 @@@@@@@@@@@@@ u32 em28xx_request_buffers(struct em28x
const size_t imagesize = PAGE_ALIGN(dev->frame_size); /*needs to be page aligned cause the buffers can be mapped individually! */
void *buff = NULL;
u32 i;
- - ---- em28xx_coredbg("requested %i buffers with size %zd", count, imagesize);
-- --- em28xx_coredbg("requested %i buffers with size %i", count, imagesize);
+++++++++++ em28xx_coredbg("requested %i buffers with size %zi", count, imagesize);
if (count > EM28XX_NUM_FRAMES)
count = EM28XX_NUM_FRAMES;
diff --cc drivers/media/video/em28xx/em28xx-i2c.c
index 0591a70,d14bcf4,29e21ad,b32d985,7f56030,b32d985,b32d985,b32d985,d14bcf4,7f56030,d14bcf4,d14bcf4..0591a70
--- a/drivers/media/video/em28xx/em28xx-i2c.c
+++ b/drivers/media/video/em28xx/em28xx-i2c.c
@@@@@@@@@@@@@ -42,10 -41,10 -41,10 -41,10 -41,10 -41,10 -41,10 -41,10 -41,10 -41,10 -41,10 -41,10 +42,10 @@@@@@@@@@@@@ module_param(i2c_debug, int, 0644)
MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]");
#define dprintk1(lvl,fmt, args...) if (i2c_debug>=lvl) do {\
- --- printk(fmt , ##args); } while (0)
+ +++ printk(fmt, ##args); } while (0)
#define dprintk2(lvl,fmt, args...) if (i2c_debug>=lvl) do{ \
printk(KERN_DEBUG "%s at %s: " fmt, \
- dev->name, __FUNCTION__, ##args); } while (0)
+ dev->name, __FUNCTION__ , ##args); } while (0)
/*
* em2800_i2c_send_max4()
diff --cc drivers/media/video/em28xx/em28xx-video.c
index eea304f,3a56120,8ecaa08,57c1826,06d7687,57c1826,57c1826,57c1826,3a56120,06d7687,3a56120,3a56120..eea304f
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@@@@@@@@@@@@ -1074,47 -1017,21 -1017,21 -1028,21 -1017,21 -1028,21 -1028,21 -1028,21 -1017,21 -1017,21 -1017,21 -1017,21 +1074,47 @@@@@@@@@@@@@ static int em28xx_do_ioctl(struct inod
case VIDIOC_S_CTRL:
{
struct v4l2_control *ctrl = arg;
----------- u8 i, n;
-----------
-----------
----------- n = sizeof(em28xx_qctrl) / sizeof(em28xx_qctrl[0]);
----------- for (i = 0; i < n; i++)
----------- if (ctrl->id == em28xx_qctrl[i].id) {
----------- if (ctrl->value <
----------- em28xx_qctrl[i].minimum
----------- || ctrl->value >
----------- em28xx_qctrl[i].maximum)
----------- return -ERANGE;
+++++++++++ u8 i;
+++++++++++
+++++++++++ if (!dev->has_msp34xx){
+++++++++++ for (i = 0; i < ARRAY_SIZE(em28xx_qctrl); i++) {
+++++++++++ if (ctrl->id == em28xx_qctrl[i].id) {
+++++++++++ if (ctrl->value <
+++++++++++ em28xx_qctrl[i].minimum
+++++++++++ || ctrl->value >
+++++++++++ em28xx_qctrl[i].maximum)
+++++++++++ return -ERANGE;
+++++++++++ return em28xx_set_ctrl(dev, ctrl);
+++++++++++ }
+++++++++++ }
+++++++++++ }
----------- return em28xx_set_ctrl(dev, ctrl);
+++++++++++ if (dev->decoder == EM28XX_TVP5150) {
+++++++++++ em28xx_i2c_call_clients(dev,cmd,arg);
+++++++++++ return 0;
+++++++++++ } else if (!dev->has_msp34xx) {
+++++++++++ for (i = 0; i < ARRAY_SIZE(em28xx_qctrl); i++) {
+++++++++++ if (ctrl->id == em28xx_qctrl[i].id) {
+++++++++++ if (ctrl->value <
+++++++++++ em28xx_qctrl[i].minimum
+++++++++++ || ctrl->value >
+++++++++++ em28xx_qctrl[i].maximum)
+++++++++++ return -ERANGE;
+++++++++++ return em28xx_set_ctrl(dev, ctrl);
+++++++++++ }
+ + + }
+++++++++++ for (i = 0; i < ARRAY_SIZE(saa711x_qctrl); i++) {
+++++++++++ if (ctrl->id == saa711x_qctrl[i].id) {
+++++++++++ if (ctrl->value <
+++++++++++ saa711x_qctrl[i].minimum
+++++++++++ || ctrl->value >
+++++++++++ saa711x_qctrl[i].maximum)
+++++++++++ return -ERANGE;
+++++++++++ return saa711x_set_ctrl(dev, ctrl);
+++++++++++ }
+ + ++++ ++ }
+++++++++++ }
+++++++++++
return -EINVAL;
}
diff --cc drivers/media/video/ir-kbd-gpio.c
index 0000000,de1385e,de1385e,6345e29,de1385e,6345e29,6345e29,6345e29,de1385e,de1385e,de1385e,de1385e..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/media/video/ir-kbd-gpio.c
+++ /dev/null
@@@@@@@@@@@@@ -1,0 -1,768 -1,768 -1,768 -1,768 -1,768 -1,768 -1,768 -1,768 -1,768 -1,768 -1,768 +1,0 @@@@@@@@@@@@@
-----------/*
----------- *
----------- * Copyright (c) 2003 Gerd Knorr
----------- * Copyright (c) 2003 Pavel Machek
----------- *
----------- * This program is free software; you can redistribute it and/or modify
----------- * it under the terms of the GNU General Public License as published by
----------- * the Free Software Foundation; either version 2 of the License, or
----------- * (at your option) any later version.
----------- *
----------- * This program is distributed in the hope that it will be useful,
----------- * but WITHOUT ANY WARRANTY; without even the implied warranty of
----------- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
----------- * GNU General Public License for more details.
----------- *
----------- * You should have received a copy of the GNU General Public License
----------- * along with this program; if not, write to the Free Software
----------- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
----------- */
-----------
-----------#include <linux/module.h>
-----------#include <linux/moduleparam.h>
-----------#include <linux/init.h>
-----------#include <linux/delay.h>
-----------#include <linux/interrupt.h>
-----------#include <linux/input.h>
-----------#include <linux/pci.h>
-----------
-----------#include <media/ir-common.h>
-----------
-----------#include "bttv.h"
-----------
-----------/* ---------------------------------------------------------------------- */
-----------
-----------static IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE] = {
----------- [ 34 ] = KEY_KP0,
----------- [ 40 ] = KEY_KP1,
----------- [ 24 ] = KEY_KP2,
----------- [ 56 ] = KEY_KP3,
----------- [ 36 ] = KEY_KP4,
----------- [ 20 ] = KEY_KP5,
----------- [ 52 ] = KEY_KP6,
----------- [ 44 ] = KEY_KP7,
----------- [ 28 ] = KEY_KP8,
----------- [ 60 ] = KEY_KP9,
-----------
----------- [ 48 ] = KEY_EJECTCD, // Unmarked on my controller
----------- [ 0 ] = KEY_POWER,
----------- [ 18 ] = BTN_LEFT, // DISPLAY/L
----------- [ 50 ] = BTN_RIGHT, // LOOP/R
----------- [ 10 ] = KEY_MUTE,
----------- [ 38 ] = KEY_RECORD,
----------- [ 22 ] = KEY_PAUSE,
----------- [ 54 ] = KEY_STOP,
----------- [ 30 ] = KEY_VOLUMEDOWN,
----------- [ 62 ] = KEY_VOLUMEUP,
-----------
----------- [ 32 ] = KEY_TUNER, // TV/FM
----------- [ 16 ] = KEY_CD,
----------- [ 8 ] = KEY_VIDEO,
----------- [ 4 ] = KEY_AUDIO,
----------- [ 12 ] = KEY_ZOOM, // full screen
----------- [ 2 ] = KEY_INFO, // preview
----------- [ 42 ] = KEY_SEARCH, // autoscan
----------- [ 26 ] = KEY_STOP, // freeze
----------- [ 58 ] = KEY_RECORD, // capture
----------- [ 6 ] = KEY_PLAY, // unmarked
----------- [ 46 ] = KEY_RED, // unmarked
----------- [ 14 ] = KEY_GREEN, // unmarked
-----------
----------- [ 33 ] = KEY_YELLOW, // unmarked
----------- [ 17 ] = KEY_CHANNELDOWN,
----------- [ 49 ] = KEY_CHANNELUP,
----------- [ 1 ] = KEY_BLUE, // unmarked
-----------};
-----------
-----------/* Matt Jesson <dvb@jesson.eclipse.co.uk */
-----------static IR_KEYTAB_TYPE ir_codes_avermedia_dvbt[IR_KEYTAB_SIZE] = {
----------- [ 0x28 ] = KEY_KP0, //'0' / 'enter'
----------- [ 0x22 ] = KEY_KP1, //'1'
----------- [ 0x12 ] = KEY_KP2, //'2' / 'up arrow'
----------- [ 0x32 ] = KEY_KP3, //'3'
----------- [ 0x24 ] = KEY_KP4, //'4' / 'left arrow'
----------- [ 0x14 ] = KEY_KP5, //'5'
----------- [ 0x34 ] = KEY_KP6, //'6' / 'right arrow'
----------- [ 0x26 ] = KEY_KP7, //'7'
----------- [ 0x16 ] = KEY_KP8, //'8' / 'down arrow'
----------- [ 0x36 ] = KEY_KP9, //'9'
-----------
----------- [ 0x20 ] = KEY_LIST, // 'source'
----------- [ 0x10 ] = KEY_TEXT, // 'teletext'
----------- [ 0x00 ] = KEY_POWER, // 'power'
----------- [ 0x04 ] = KEY_AUDIO, // 'audio'
----------- [ 0x06 ] = KEY_ZOOM, // 'full screen'
----------- [ 0x18 ] = KEY_VIDEO, // 'display'
----------- [ 0x38 ] = KEY_SEARCH, // 'loop'
----------- [ 0x08 ] = KEY_INFO, // 'preview'
----------- [ 0x2a ] = KEY_REWIND, // 'backward <<'
----------- [ 0x1a ] = KEY_FASTFORWARD, // 'forward >>'
----------- [ 0x3a ] = KEY_RECORD, // 'capture'
----------- [ 0x0a ] = KEY_MUTE, // 'mute'
----------- [ 0x2c ] = KEY_RECORD, // 'record'
----------- [ 0x1c ] = KEY_PAUSE, // 'pause'
----------- [ 0x3c ] = KEY_STOP, // 'stop'
----------- [ 0x0c ] = KEY_PLAY, // 'play'
----------- [ 0x2e ] = KEY_RED, // 'red'
----------- [ 0x01 ] = KEY_BLUE, // 'blue' / 'cancel'
----------- [ 0x0e ] = KEY_YELLOW, // 'yellow' / 'ok'
----------- [ 0x21 ] = KEY_GREEN, // 'green'
----------- [ 0x11 ] = KEY_CHANNELDOWN, // 'channel -'
----------- [ 0x31 ] = KEY_CHANNELUP, // 'channel +'
----------- [ 0x1e ] = KEY_VOLUMEDOWN, // 'volume -'
----------- [ 0x3e ] = KEY_VOLUMEUP, // 'volume +'
-----------};
-----------
-----------/* Attila Kondoros <attila.kondoros@chello.hu> */
-----------static IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE] = {
-----------
----------- [ 1 ] = KEY_KP1,
----------- [ 2 ] = KEY_KP2,
----------- [ 3 ] = KEY_KP3,
----------- [ 4 ] = KEY_KP4,
----------- [ 5 ] = KEY_KP5,
----------- [ 6 ] = KEY_KP6,
----------- [ 7 ] = KEY_KP7,
----------- [ 8 ] = KEY_KP8,
----------- [ 9 ] = KEY_KP9,
----------- [ 0 ] = KEY_KP0,
----------- [ 23 ] = KEY_LAST, // +100
----------- [ 10 ] = KEY_LIST, // recall
-----------
-----------
----------- [ 28 ] = KEY_TUNER, // TV/FM
----------- [ 21 ] = KEY_SEARCH, // scan
----------- [ 18 ] = KEY_POWER, // power
----------- [ 31 ] = KEY_VOLUMEDOWN, // vol up
----------- [ 27 ] = KEY_VOLUMEUP, // vol down
----------- [ 30 ] = KEY_CHANNELDOWN, // chn up
----------- [ 26 ] = KEY_CHANNELUP, // chn down
-----------
----------- [ 17 ] = KEY_VIDEO, // video
----------- [ 15 ] = KEY_ZOOM, // full screen
----------- [ 19 ] = KEY_MUTE, // mute/unmute
----------- [ 16 ] = KEY_TEXT, // min
-----------
----------- [ 13 ] = KEY_STOP, // freeze
----------- [ 14 ] = KEY_RECORD, // record
----------- [ 29 ] = KEY_PLAYPAUSE, // stop
----------- [ 25 ] = KEY_PLAY, // play
-----------
----------- [ 22 ] = KEY_GOTO, // osd
----------- [ 20 ] = KEY_REFRESH, // default
----------- [ 12 ] = KEY_KPPLUS, // fine tune >>>>
----------- [ 24 ] = KEY_KPMINUS // fine tune <<<<
-----------};
-----------
-----------/* ---------------------------------------------------------------------- */
-----------
-----------/* Ricardo Cerqueira <v4l@cerqueira.org> */
-----------/* Weird matching, since the remote has "uncommon" keys */
-----------
-----------static IR_KEYTAB_TYPE ir_codes_conceptronic[IR_KEYTAB_SIZE] = {
-----------
----------- [ 30 ] = KEY_POWER, // power
----------- [ 7 ] = KEY_MEDIA, // source
----------- [ 28 ] = KEY_SEARCH, // scan
-----------
-----------/* FIXME: duplicate keycodes?
----------- *
----------- * These four keys seem to share the same GPIO as CH+, CH-, <<< and >>>
----------- * The GPIO values are
----------- * 6397fb for both "Scan <" and "CH -",
----------- * 639ffb for "Scan >" and "CH+",
----------- * 6384fb for "Tune <" and "<<<",
----------- * 638cfb for "Tune >" and ">>>", regardless of the mask.
----------- *
----------- * [ 23 ] = KEY_BACK, // fm scan <<
----------- * [ 31 ] = KEY_FORWARD, // fm scan >>
----------- *
----------- * [ 4 ] = KEY_LEFT, // fm tuning <
----------- * [ 12 ] = KEY_RIGHT, // fm tuning >
----------- *
----------- * For now, these four keys are disabled. Pressing them will generate
----------- * the CH+/CH-/<<</>>> events
----------- */
-----------
----------- [ 3 ] = KEY_TUNER, // TV/FM
-----------
----------- [ 0 ] = KEY_RECORD,
----------- [ 8 ] = KEY_STOP,
----------- [ 17 ] = KEY_PLAY,
-----------
----------- [ 26 ] = KEY_PLAYPAUSE, // freeze
----------- [ 25 ] = KEY_ZOOM, // zoom
----------- [ 15 ] = KEY_TEXT, // min
-----------
----------- [ 1 ] = KEY_KP1,
----------- [ 11 ] = KEY_KP2,
----------- [ 27 ] = KEY_KP3,
----------- [ 5 ] = KEY_KP4,
----------- [ 9 ] = KEY_KP5,
----------- [ 21 ] = KEY_KP6,
----------- [ 6 ] = KEY_KP7,
----------- [ 10 ] = KEY_KP8,
----------- [ 18 ] = KEY_KP9,
----------- [ 2 ] = KEY_KP0,
----------- [ 16 ] = KEY_LAST, // +100
----------- [ 19 ] = KEY_LIST, // recall
-----------
----------- [ 31 ] = KEY_CHANNELUP, // chn down
----------- [ 23 ] = KEY_CHANNELDOWN, // chn up
----------- [ 22 ] = KEY_VOLUMEUP, // vol down
----------- [ 20 ] = KEY_VOLUMEDOWN, // vol up
-----------
----------- [ 4 ] = KEY_KPMINUS, // <<<
----------- [ 14 ] = KEY_SETUP, // function
----------- [ 12 ] = KEY_KPPLUS, // >>>
-----------
----------- [ 13 ] = KEY_GOTO, // mts
----------- [ 29 ] = KEY_REFRESH, // reset
----------- [ 24 ] = KEY_MUTE // mute/unmute
-----------};
-----------
-----------static IR_KEYTAB_TYPE ir_codes_nebula[IR_KEYTAB_SIZE] = {
----------- [0x00] = KEY_KP0,
----------- [0x01] = KEY_KP1,
----------- [0x02] = KEY_KP2,
----------- [0x03] = KEY_KP3,
----------- [0x04] = KEY_KP4,
----------- [0x05] = KEY_KP5,
----------- [0x06] = KEY_KP6,
----------- [0x07] = KEY_KP7,
----------- [0x08] = KEY_KP8,
----------- [0x09] = KEY_KP9,
----------- [0x0a] = KEY_TV,
----------- [0x0b] = KEY_AUX,
----------- [0x0c] = KEY_DVD,
----------- [0x0d] = KEY_POWER,
----------- [0x0e] = KEY_MHP, /* labelled 'Picture' */
----------- [0x0f] = KEY_AUDIO,
----------- [0x10] = KEY_INFO,
----------- [0x11] = KEY_F13, /* 16:9 */
----------- [0x12] = KEY_F14, /* 14:9 */
----------- [0x13] = KEY_EPG,
----------- [0x14] = KEY_EXIT,
----------- [0x15] = KEY_MENU,
----------- [0x16] = KEY_UP,
----------- [0x17] = KEY_DOWN,
----------- [0x18] = KEY_LEFT,
----------- [0x19] = KEY_RIGHT,
----------- [0x1a] = KEY_ENTER,
----------- [0x1b] = KEY_CHANNELUP,
----------- [0x1c] = KEY_CHANNELDOWN,
----------- [0x1d] = KEY_VOLUMEUP,
----------- [0x1e] = KEY_VOLUMEDOWN,
----------- [0x1f] = KEY_RED,
----------- [0x20] = KEY_GREEN,
----------- [0x21] = KEY_YELLOW,
----------- [0x22] = KEY_BLUE,
----------- [0x23] = KEY_SUBTITLE,
----------- [0x24] = KEY_F15, /* AD */
----------- [0x25] = KEY_TEXT,
----------- [0x26] = KEY_MUTE,
----------- [0x27] = KEY_REWIND,
----------- [0x28] = KEY_STOP,
----------- [0x29] = KEY_PLAY,
----------- [0x2a] = KEY_FASTFORWARD,
----------- [0x2b] = KEY_F16, /* chapter */
----------- [0x2c] = KEY_PAUSE,
----------- [0x2d] = KEY_PLAY,
----------- [0x2e] = KEY_RECORD,
----------- [0x2f] = KEY_F17, /* picture in picture */
----------- [0x30] = KEY_KPPLUS, /* zoom in */
----------- [0x31] = KEY_KPMINUS, /* zoom out */
----------- [0x32] = KEY_F18, /* capture */
----------- [0x33] = KEY_F19, /* web */
----------- [0x34] = KEY_EMAIL,
----------- [0x35] = KEY_PHONE,
----------- [0x36] = KEY_PC
-----------};
-----------
-----------struct IR {
----------- struct bttv_sub_device *sub;
----------- struct input_dev *input;
----------- struct ir_input_state ir;
----------- char name[32];
----------- char phys[32];
-----------
----------- /* Usual gpio signalling */
-----------
----------- u32 mask_keycode;
----------- u32 mask_keydown;
----------- u32 mask_keyup;
-- - ---- u32 polling;
- --- u32 polling;
----------- u32 last_gpio;
----------- struct work_struct work;
----------- struct timer_list timer;
-----------
----------- /* RC5 gpio */
- ---
----------- u32 rc5_gpio;
----------- struct timer_list timer_end; /* timer_end for code completion */
----------- struct timer_list timer_keyup; /* timer_end for key release */
----------- u32 last_rc5; /* last good rc5 code */
----------- u32 last_bit; /* last raw bit seen */
----------- u32 code; /* raw code under construction */
----------- struct timeval base_time; /* time of last seen code */
----------- int active; /* building raw code */
-----------};
-----------
-----------static int debug;
-----------module_param(debug, int, 0644); /* debug level (0,1,2) */
-----------static int repeat_delay = 500;
-----------module_param(repeat_delay, int, 0644);
-----------static int repeat_period = 33;
-----------module_param(repeat_period, int, 0644);
-----------
-----------#define DEVNAME "ir-kbd-gpio"
-----------#define dprintk(fmt, arg...) if (debug) \
----------- printk(KERN_DEBUG DEVNAME ": " fmt , ## arg)
-----------
-----------static void ir_irq(struct bttv_sub_device *sub);
-----------static int ir_probe(struct device *dev);
-----------static int ir_remove(struct device *dev);
-----------
-----------static struct bttv_sub_driver driver = {
----------- .drv = {
----------- .name = DEVNAME,
----------- .probe = ir_probe,
----------- .remove = ir_remove,
----------- },
----------- .gpio_irq = ir_irq,
-----------};
-----------
-----------/* ---------------------------------------------------------------------- */
-----------
-----------static void ir_handle_key(struct IR *ir)
-----------{
----------- u32 gpio,data;
-----------
----------- /* read gpio value */
----------- gpio = bttv_gpio_read(ir->sub->core);
----------- if (ir->polling) {
----------- if (ir->last_gpio == gpio)
----------- return;
----------- ir->last_gpio = gpio;
----------- }
-----------
----------- /* extract data */
----------- data = ir_extract_bits(gpio, ir->mask_keycode);
----------- dprintk(DEVNAME ": irq gpio=0x%x code=%d | %s%s%s\n",
----------- gpio, data,
----------- ir->polling ? "poll" : "irq",
----------- (gpio & ir->mask_keydown) ? " down" : "",
----------- (gpio & ir->mask_keyup) ? " up" : "");
-----------
----------- if (ir->mask_keydown) {
----------- /* bit set on keydown */
----------- if (gpio & ir->mask_keydown) {
----------- ir_input_keydown(ir->input, &ir->ir, data, data);
----------- } else {
----------- ir_input_nokey(ir->input, &ir->ir);
----------- }
-----------
----------- } else if (ir->mask_keyup) {
----------- /* bit cleared on keydown */
----------- if (0 == (gpio & ir->mask_keyup)) {
----------- ir_input_keydown(ir->input, &ir->ir, data, data);
----------- } else {
----------- ir_input_nokey(ir->input, &ir->ir);
----------- }
-----------
----------- } else {
----------- /* can't disturgissh keydown/up :-/ */
----------- ir_input_keydown(ir->input, &ir->ir, data, data);
----------- ir_input_nokey(ir->input, &ir->ir);
----------- }
-----------}
-----------
-----------static void ir_irq(struct bttv_sub_device *sub)
-----------{
----------- struct IR *ir = dev_get_drvdata(&sub->dev);
-----------
----------- if (!ir->polling)
----------- ir_handle_key(ir);
-----------}
-----------
-----------static void ir_timer(unsigned long data)
-----------{
----------- struct IR *ir = (struct IR*)data;
-----------
----------- schedule_work(&ir->work);
-----------}
-----------
-----------static void ir_work(void *data)
-----------{
----------- struct IR *ir = data;
----------- unsigned long timeout;
-----------
----------- ir_handle_key(ir);
----------- timeout = jiffies + (ir->polling * HZ / 1000);
----------- mod_timer(&ir->timer, timeout);
-----------}
-----------
-----------/* ---------------------------------------------------------------*/
-----------
-----------static int rc5_remote_gap = 885;
-----------module_param(rc5_remote_gap, int, 0644);
-----------static int rc5_key_timeout = 200;
-----------module_param(rc5_key_timeout, int, 0644);
-----------
-----------#define RC5_START(x) (((x)>>12)&3)
-----------#define RC5_TOGGLE(x) (((x)>>11)&1)
-----------#define RC5_ADDR(x) (((x)>>6)&31)
-----------#define RC5_INSTR(x) ((x)&63)
-----------
-----------/* decode raw bit pattern to RC5 code */
-----------static u32 rc5_decode(unsigned int code)
-----------{
----------- unsigned int org_code = code;
----------- unsigned int pair;
----------- unsigned int rc5 = 0;
----------- int i;
-----------
----------- code = (code << 1) | 1;
----------- for (i = 0; i < 14; ++i) {
----------- pair = code & 0x3;
----------- code >>= 2;
-----------
----------- rc5 <<= 1;
----------- switch (pair) {
----------- case 0:
----------- case 2:
----------- break;
----------- case 1:
----------- rc5 |= 1;
----------- break;
----------- case 3:
----------- dprintk("bad code: %x\n", org_code);
----------- return 0;
----------- }
----------- }
----------- dprintk("code=%x, rc5=%x, start=%x, toggle=%x, address=%x, "
----------- "instr=%x\n", rc5, org_code, RC5_START(rc5),
----------- RC5_TOGGLE(rc5), RC5_ADDR(rc5), RC5_INSTR(rc5));
----------- return rc5;
-----------}
-----------
-----------static int ir_rc5_irq(struct bttv_sub_device *sub)
-----------{
----------- struct IR *ir = dev_get_drvdata(&sub->dev);
----------- struct timeval tv;
----------- u32 gpio;
----------- u32 gap;
----------- unsigned long current_jiffies, timeout;
-----------
----------- /* read gpio port */
----------- gpio = bttv_gpio_read(ir->sub->core);
-----------
----------- /* remote IRQ? */
----------- if (!(gpio & 0x20))
----------- return 0;
-----------
----------- /* get time of bit */
----------- current_jiffies = jiffies;
----------- do_gettimeofday(&tv);
-----------
----------- /* avoid overflow with gap >1s */
----------- if (tv.tv_sec - ir->base_time.tv_sec > 1) {
----------- gap = 200000;
----------- } else {
----------- gap = 1000000 * (tv.tv_sec - ir->base_time.tv_sec) +
----------- tv.tv_usec - ir->base_time.tv_usec;
----------- }
-----------
----------- /* active code => add bit */
----------- if (ir->active) {
----------- /* only if in the code (otherwise spurious IRQ or timer
----------- late) */
----------- if (ir->last_bit < 28) {
----------- ir->last_bit = (gap - rc5_remote_gap / 2) /
----------- rc5_remote_gap;
----------- ir->code |= 1 << ir->last_bit;
----------- }
----------- /* starting new code */
----------- } else {
----------- ir->active = 1;
----------- ir->code = 0;
----------- ir->base_time = tv;
----------- ir->last_bit = 0;
-----------
----------- timeout = current_jiffies + (500 + 30 * HZ) / 1000;
----------- mod_timer(&ir->timer_end, timeout);
----------- }
-----------
----------- /* toggle GPIO pin 4 to reset the irq */
----------- bttv_gpio_write(ir->sub->core, gpio & ~(1 << 4));
----------- bttv_gpio_write(ir->sub->core, gpio | (1 << 4));
----------- return 1;
-----------}
-----------
-----------static void ir_rc5_timer_end(unsigned long data)
-----------{
----------- struct IR *ir = (struct IR *)data;
----------- struct timeval tv;
----------- unsigned long current_jiffies, timeout;
----------- u32 gap;
-----------
----------- /* get time */
----------- current_jiffies = jiffies;
----------- do_gettimeofday(&tv);
-----------
----------- /* avoid overflow with gap >1s */
----------- if (tv.tv_sec - ir->base_time.tv_sec > 1) {
----------- gap = 200000;
----------- } else {
----------- gap = 1000000 * (tv.tv_sec - ir->base_time.tv_sec) +
----------- tv.tv_usec - ir->base_time.tv_usec;
----------- }
-----------
----------- /* Allow some timmer jitter (RC5 is ~24ms anyway so this is ok) */
----------- if (gap < 28000) {
----------- dprintk("spurious timer_end\n");
----------- return;
----------- }
-----------
----------- ir->active = 0;
----------- if (ir->last_bit < 20) {
----------- /* ignore spurious codes (caused by light/other remotes) */
----------- dprintk("short code: %x\n", ir->code);
----------- } else {
----------- u32 rc5 = rc5_decode(ir->code);
-----------
----------- /* two start bits? */
----------- if (RC5_START(rc5) != 3) {
----------- dprintk("rc5 start bits invalid: %u\n", RC5_START(rc5));
-----------
----------- /* right address? */
----------- } else if (RC5_ADDR(rc5) == 0x0) {
----------- u32 toggle = RC5_TOGGLE(rc5);
----------- u32 instr = RC5_INSTR(rc5);
-----------
----------- /* Good code, decide if repeat/repress */
----------- if (toggle != RC5_TOGGLE(ir->last_rc5) ||
----------- instr != RC5_INSTR(ir->last_rc5)) {
----------- dprintk("instruction %x, toggle %x\n", instr,
----------- toggle);
----------- ir_input_nokey(ir->input, &ir->ir);
----------- ir_input_keydown(ir->input, &ir->ir, instr,
----------- instr);
----------- }
-----------
----------- /* Set/reset key-up timer */
----------- timeout = current_jiffies + (500 + rc5_key_timeout
----------- * HZ) / 1000;
----------- mod_timer(&ir->timer_keyup, timeout);
-----------
----------- /* Save code for repeat test */
----------- ir->last_rc5 = rc5;
----------- }
----------- }
-----------}
-----------
-----------static void ir_rc5_timer_keyup(unsigned long data)
-----------{
----------- struct IR *ir = (struct IR *)data;
-----------
----------- dprintk("key released\n");
----------- ir_input_nokey(ir->input, &ir->ir);
-----------}
-----------
-----------/* ---------------------------------------------------------------------- */
-----------
-----------static int ir_probe(struct device *dev)
-----------{
----------- struct bttv_sub_device *sub = to_bttv_sub_dev(dev);
----------- struct IR *ir;
----------- struct input_dev *input_dev;
----------- IR_KEYTAB_TYPE *ir_codes = NULL;
----------- int ir_type = IR_TYPE_OTHER;
-----------
----------- ir = kzalloc(sizeof(*ir), GFP_KERNEL);
----------- input_dev = input_allocate_device();
----------- if (!ir || !input_dev) {
----------- kfree(ir);
----------- input_free_device(input_dev);
----------- return -ENOMEM;
----------- }
-----------
----------- /* detect & configure */
----------- switch (sub->core->type) {
----------- case BTTV_BOARD_AVERMEDIA:
----------- case BTTV_BOARD_AVPHONE98:
----------- case BTTV_BOARD_AVERMEDIA98:
----------- ir_codes = ir_codes_avermedia;
----------- ir->mask_keycode = 0xf88000;
----------- ir->mask_keydown = 0x010000;
----------- ir->polling = 50; // ms
----------- break;
-----------
----------- case BTTV_BOARD_AVDVBT_761:
----------- case BTTV_BOARD_AVDVBT_771:
----------- ir_codes = ir_codes_avermedia_dvbt;
----------- ir->mask_keycode = 0x0f00c0;
----------- ir->mask_keydown = 0x000020;
----------- ir->polling = 50; // ms
----------- break;
-----------
----------- case BTTV_BOARD_PXELVWPLTVPAK:
----------- ir_codes = ir_codes_pixelview;
----------- ir->mask_keycode = 0x003e00;
----------- ir->mask_keyup = 0x010000;
----------- ir->polling = 50; // ms
----------- break;
----------- case BTTV_BOARD_PV_BT878P_9B:
----------- case BTTV_BOARD_PV_BT878P_PLUS:
----------- ir_codes = ir_codes_pixelview;
----------- ir->mask_keycode = 0x001f00;
----------- ir->mask_keyup = 0x008000;
----------- ir->polling = 50; // ms
----------- break;
-----------
----------- case BTTV_BOARD_WINFAST2000:
----------- ir_codes = ir_codes_winfast;
----------- ir->mask_keycode = 0x1f8;
----------- break;
----------- case BTTV_BOARD_MAGICTVIEW061:
----------- case BTTV_BOARD_MAGICTVIEW063:
----------- ir_codes = ir_codes_winfast;
----------- ir->mask_keycode = 0x0008e000;
----------- ir->mask_keydown = 0x00200000;
----------- break;
----------- case BTTV_BOARD_APAC_VIEWCOMP:
----------- ir_codes = ir_codes_apac_viewcomp;
----------- ir->mask_keycode = 0x001f00;
----------- ir->mask_keyup = 0x008000;
----------- ir->polling = 50; // ms
----------- break;
----------- case BTTV_BOARD_CONCEPTRONIC_CTVFMI2:
----------- ir_codes = ir_codes_conceptronic;
----------- ir->mask_keycode = 0x001F00;
----------- ir->mask_keyup = 0x006000;
----------- ir->polling = 50; // ms
----------- break;
----------- case BTTV_BOARD_NEBULA_DIGITV:
----------- ir_codes = ir_codes_nebula;
----------- driver.any_irq = ir_rc5_irq;
----------- driver.gpio_irq = NULL;
----------- ir->rc5_gpio = 1;
-- - ---- break;
- --- break;
----------- }
----------- if (NULL == ir_codes) {
----------- kfree(ir);
----------- input_free_device(input_dev);
----------- return -ENODEV;
----------- }
-----------
----------- if (ir->rc5_gpio) {
----------- u32 gpio;
-- - ---- /* enable remote irq */
- --- /* enable remote irq */
----------- bttv_gpio_inout(sub->core, (1 << 4), 1 << 4);
----------- gpio = bttv_gpio_read(sub->core);
----------- bttv_gpio_write(sub->core, gpio & ~(1 << 4));
----------- bttv_gpio_write(sub->core, gpio | (1 << 4));
----------- } else {
----------- /* init hardware-specific stuff */
----------- bttv_gpio_inout(sub->core, ir->mask_keycode | ir->mask_keydown, 0);
----------- }
-----------
----------- /* init input device */
----------- snprintf(ir->name, sizeof(ir->name), "bttv IR (card=%d)",
----------- sub->core->type);
----------- snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",
----------- pci_name(sub->core->pci));
-----------
----------- ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
----------- input_dev->name = ir->name;
----------- input_dev->phys = ir->phys;
----------- input_dev->id.bustype = BUS_PCI;
----------- input_dev->id.version = 1;
----------- if (sub->core->pci->subsystem_vendor) {
----------- input_dev->id.vendor = sub->core->pci->subsystem_vendor;
----------- input_dev->id.product = sub->core->pci->subsystem_device;
----------- } else {
----------- input_dev->id.vendor = sub->core->pci->vendor;
----------- input_dev->id.product = sub->core->pci->device;
----------- }
----------- input_dev->cdev.dev = &sub->core->pci->dev;
-----------
----------- ir->input = input_dev;
----------- ir->sub = sub;
-----------
----------- if (ir->polling) {
----------- INIT_WORK(&ir->work, ir_work, ir);
----------- init_timer(&ir->timer);
----------- ir->timer.function = ir_timer;
----------- ir->timer.data = (unsigned long)ir;
----------- schedule_work(&ir->work);
----------- } else if (ir->rc5_gpio) {
----------- /* set timer_end for code completion */
----------- init_timer(&ir->timer_end);
----------- ir->timer_end.function = ir_rc5_timer_end;
----------- ir->timer_end.data = (unsigned long)ir;
-----------
----------- init_timer(&ir->timer_keyup);
----------- ir->timer_keyup.function = ir_rc5_timer_keyup;
----------- ir->timer_keyup.data = (unsigned long)ir;
----------- }
-----------
----------- /* all done */
----------- dev_set_drvdata(dev, ir);
----------- input_register_device(ir->input);
-----------
----------- /* the remote isn't as bouncy as a keyboard */
----------- ir->input->rep[REP_DELAY] = repeat_delay;
----------- ir->input->rep[REP_PERIOD] = repeat_period;
-----------
----------- return 0;
-----------}
-----------
-----------static int ir_remove(struct device *dev)
-----------{
----------- struct IR *ir = dev_get_drvdata(dev);
-----------
----------- if (ir->polling) {
----------- del_timer(&ir->timer);
----------- flush_scheduled_work();
----------- }
-- - ----
----------- if (ir->rc5_gpio) {
----------- u32 gpio;
-----------
----------- del_timer(&ir->timer_end);
----------- flush_scheduled_work();
-----------
----------- gpio = bttv_gpio_read(ir->sub->core);
----------- bttv_gpio_write(ir->sub->core, gpio & ~(1 << 4));
----------- }
-----------
----------- input_unregister_device(ir->input);
----------- kfree(ir);
----------- return 0;
-----------}
-----------
-----------/* ---------------------------------------------------------------------- */
-----------
-----------MODULE_AUTHOR("Gerd Knorr, Pavel Machek");
-----------MODULE_DESCRIPTION("input driver for bt8x8 gpio IR remote controls");
-----------MODULE_LICENSE("GPL");
-----------
-----------static int ir_init(void)
-----------{
----------- return bttv_sub_register(&driver, "remote");
-----------}
-----------
-----------static void ir_fini(void)
-----------{
----------- bttv_sub_unregister(&driver);
-----------}
-----------
-----------module_init(ir_init);
-----------module_exit(ir_fini);
-----------
-----------
-----------/*
----------- * Local variables:
----------- * c-basic-offset: 8
----------- * End:
----------- */
diff --cc drivers/media/video/ir-kbd-i2c.c
index 58b0e69,3cc1d6a,740e543,801c736,740e543,801c736,801c736,801c736,3cc1d6a,740e543,3cc1d6a,3cc1d6a..58b0e69
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@@@@@@@@@@@@ -278,10 -278,10 -278,9 -277,9 -278,9 -277,9 -277,9 -277,9 -278,10 -278,9 -278,10 -278,10 +278,10 @@@@@@@@@@@@@ static int ir_detach(struct i2c_client
static int ir_probe(struct i2c_adapter *adap);
static struct i2c_driver driver = {
------ - .name = "ir remote kbd driver",
- --- .id = I2C_DRIVERID_EXP3, /* FIXME */
- --- .flags = I2C_DF_NOTIFY,
++++++ + .driver = {
- - -- .name = "ir remote kbd driver",
+++++++++++ .name = "ir-kbd-i2c",
++++++ + },
+ +++ .id = I2C_DRIVERID_INFRARED,
- - - .flags = I2C_DF_NOTIFY,
.attach_adapter = ir_probe,
.detach_client = ir_detach,
};
@@@@@@@@@@@@@ -298,17 -298,16 -297,16 -296,16 -297,16 -296,16 -296,16 -296,16 -298,16 -297,16 -298,16 -298,16 +298,17 @@@@@@@@@@@@@ static int ir_attach(struct i2c_adapte
IR_KEYTAB_TYPE *ir_codes = NULL;
char *name;
int ir_type;
- --- struct IR_i2c *ir;
+ +++ struct IR_i2c *ir;
struct input_dev *input_dev;
- --- ir = kzalloc(sizeof(struct IR_i2c), GFP_KERNEL);
+ +++ ir = kzalloc(sizeof(struct IR_i2c),GFP_KERNEL);
input_dev = input_allocate_device();
if (!ir || !input_dev) {
----------- kfree(ir);
input_free_device(input_dev);
- --- return -ENOMEM;
+++++++++++ kfree(ir);
+ +++ return -ENOMEM;
}
+++++++++++ memset(ir,0,sizeof(*ir));
ir->c = client_template;
ir->input = input_dev;
diff --cc drivers/media/video/msp3400-driver.c
index 69ed369,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..69ed369
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
diff --cc drivers/media/video/msp3400-kthreads.c
index 2072c3e,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..2072c3e
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/media/video/msp3400-kthreads.c
+++ b/drivers/media/video/msp3400-kthreads.c
diff --cc drivers/media/video/msp3400.c
index 0000000,183253e,d86f8e9,a23fb03,d86f8e9,a23fb03,a23fb03,a23fb03,183253e,d86f8e9,183253e,183253e..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/media/video/msp3400.c
+++ /dev/null
@@@@@@@@@@@@@ -1,0 -1,2229 -1,2229 -1,2225 -1,2229 -1,2225 -1,2225 -1,2225 -1,2229 -1,2229 -1,2229 -1,2229 +1,0 @@@@@@@@@@@@@
-----------/*
----------- * programming the msp34* sound processor family
----------- *
----------- * (c) 1997-2001 Gerd Knorr <kraxel@bytesex.org>
----------- *
----------- * what works and what doesn't:
----------- *
----------- * AM-Mono
----------- * Support for Hauppauge cards added (decoding handled by tuner) added by
----------- * Frederic Crozat <fcrozat@mail.dotcom.fr>
----------- *
----------- * FM-Mono
----------- * should work. The stereo modes are backward compatible to FM-mono,
----------- * therefore FM-Mono should be allways available.
----------- *
----------- * FM-Stereo (B/G, used in germany)
----------- * should work, with autodetect
----------- *
----------- * FM-Stereo (satellite)
----------- * should work, no autodetect (i.e. default is mono, but you can
----------- * switch to stereo -- untested)
----------- *
----------- * NICAM (B/G, L , used in UK, Scandinavia, Spain and France)
----------- * should work, with autodetect. Support for NICAM was added by
----------- * Pekka Pietikainen <pp@netppl.fi>
----------- *
----------- *
----------- * TODO:
----------- * - better SAT support
----------- *
----------- *
----------- * 980623 Thomas Sailer (sailer@ife.ee.ethz.ch)
----------- * using soundcore instead of OSS
----------- *
----------- */
-----------
-----------#include <linux/config.h>
-----------#include <linux/module.h>
-----------#include <linux/moduleparam.h>
-----------#include <linux/kernel.h>
-----------#include <linux/sched.h>
-----------#include <linux/string.h>
-----------#include <linux/timer.h>
-----------#include <linux/delay.h>
-----------#include <linux/errno.h>
-----------#include <linux/slab.h>
-----------#include <linux/i2c.h>
-----------#include <linux/videodev.h>
-----------#include <linux/init.h>
-----------#include <linux/smp_lock.h>
-----------#include <linux/kthread.h>
-----------#include <linux/suspend.h>
-----------#include <asm/semaphore.h>
-----------#include <asm/pgtable.h>
-----------
-----------#include <media/audiochip.h>
-----------#include "msp3400.h"
-----------
-----------#define msp3400_dbg(fmt, arg...) \
----------- do { \
----------- if (debug) \
- - -- printk(KERN_INFO "%s debug %d-%04x: " fmt, \
- - -- client->driver->driver.name, \
------ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); \
----------- } while (0)
-----------
-----------/* Medium volume debug. */
-----------#define msp3400_dbg_mediumvol(fmt, arg...) \
----------- do { \
----------- if (debug >= 2) \
- - -- printk(KERN_INFO "%s debug %d-%04x: " fmt, \
- - -- client->driver->driver.name, \
------ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); \
----------- } while (0)
-----------
-----------/* High volume debug. Use with care. */
-----------#define msp3400_dbg_highvol(fmt, arg...) \
----------- do { \
----------- if (debug >= 16) \
- - -- printk(KERN_INFO "%s debug %d-%04x: " fmt, \
- - -- client->driver->driver.name, \
------ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); \
----------- } while (0)
-----------
-----------#define msp3400_err(fmt, arg...) do { \
- - -- printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------#define msp3400_warn(fmt, arg...) do { \
- - -- printk(KERN_WARNING "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_WARNING "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------#define msp3400_info(fmt, arg...) do { \
- - -- printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------
-----------#define OPMODE_AUTO -1
-----------#define OPMODE_MANUAL 0
-----------#define OPMODE_SIMPLE 1 /* use short programming (>= msp3410 only) */
-----------#define OPMODE_SIMPLER 2 /* use shorter programming (>= msp34xxG) */
-----------
-----------/* insmod parameters */
-----------static int opmode = OPMODE_AUTO;
-----------static int debug = 0; /* debug output */
-----------static int once = 0; /* no continous stereo monitoring */
-----------static int amsound = 0; /* hard-wire AM sound at 6.5 Hz (france),
----------- the autoscan seems work well only with FM... */
-----------static int standard = 1; /* Override auto detect of audio standard, if needed. */
-----------static int dolby = 0;
-----------
-----------static int stereo_threshold = 0x190; /* a2 threshold for stereo/bilingual
----------- (msp34xxg only) 0x00a0-0x03c0 */
-----------#define DFP_COUNT 0x41
-----------static const int bl_dfp[] = {
----------- 0x00, 0x01, 0x02, 0x03, 0x06, 0x08, 0x09, 0x0a,
----------- 0x0b, 0x0d, 0x0e, 0x10
-----------};
-----------
-----------#define IS_MSP34XX_G(msp) ((msp)->opmode==2)
-----------
-----------struct msp3400c {
----------- int rev1,rev2;
-----------
----------- int opmode;
----------- int nicam;
----------- int mode;
----------- int norm;
----------- int stereo;
----------- int nicam_on;
----------- int acb;
----------- int in_scart;
----------- int i2s_mode;
----------- int main, second; /* sound carrier */
----------- int input;
----------- int source; /* see msp34xxg_set_source */
-----------
----------- /* v4l2 */
----------- int audmode;
----------- int rxsubchans;
-----------
----------- int muted;
-- - ---- int left, right; /* volume */
- --- int left, right; /* volume */
----------- int bass, treble;
-----------
----------- /* shadow register set */
----------- int dfp_regs[DFP_COUNT];
-----------
----------- /* thread */
----------- struct task_struct *kthread;
----------- wait_queue_head_t wq;
----------- int restart:1;
----------- int watch_stereo:1;
-----------};
-----------
-----------#define MIN(a,b) (((a)>(b))?(b):(a))
-----------#define MAX(a,b) (((a)>(b))?(a):(b))
-----------#define HAVE_NICAM(msp) (((msp->rev2>>8) & 0xff) != 00)
-----------#define HAVE_SIMPLE(msp) ((msp->rev1 & 0xff) >= 'D'-'@')
-----------#define HAVE_SIMPLER(msp) ((msp->rev1 & 0xff) >= 'G'-'@')
-----------#define HAVE_RADIO(msp) ((msp->rev1 & 0xff) >= 'G'-'@')
-----------
-----------#define VIDEO_MODE_RADIO 16 /* norm magic for radio mode */
-----------
-----------/* ---------------------------------------------------------------------- */
-----------
-----------/* read-only */
-----------module_param(opmode, int, 0444);
-----------
-----------/* read-write */
-----------module_param(once, int, 0644);
-----------module_param(debug, int, 0644);
-----------module_param(stereo_threshold, int, 0644);
-----------module_param(standard, int, 0644);
-----------module_param(amsound, int, 0644);
-----------module_param(dolby, int, 0644);
-----------
-----------MODULE_PARM_DESC(opmode, "Forces a MSP3400 opmode. 0=Manual, 1=Simple, 2=Simpler");
-----------MODULE_PARM_DESC(once, "No continuous stereo monitoring");
-----------MODULE_PARM_DESC(debug, "Enable debug messages");
-----------MODULE_PARM_DESC(stereo_threshold, "Sets signal threshold to activate stereo");
-----------MODULE_PARM_DESC(standard, "Specify audio standard: 32 = NTSC, 64 = radio, Default: Autodetect");
-----------MODULE_PARM_DESC(amsound, "Hardwire AM sound at 6.5Hz (France), FM can autoscan");
-----------MODULE_PARM_DESC(dolby, "Activates Dolby processsing");
-----------
-----------/* ---------------------------------------------------------------------- */
-----------
-----------#define I2C_MSP3400C 0x80
-----------#define I2C_MSP3400C_ALT 0x88
-----------
-----------#define I2C_MSP3400C_DEM 0x10
-----------#define I2C_MSP3400C_DFP 0x12
-----------
-----------/* Addresses to scan */
-----------static unsigned short normal_i2c[] = {
----------- I2C_MSP3400C >> 1,
----------- I2C_MSP3400C_ALT >> 1,
----------- I2C_CLIENT_END
-----------};
-----------I2C_CLIENT_INSMOD;
-----------
-----------MODULE_DESCRIPTION("device driver for msp34xx TV sound processor");
-----------MODULE_AUTHOR("Gerd Knorr");
-----------MODULE_LICENSE("GPL");
-----------
-----------/* ----------------------------------------------------------------------- */
-----------/* functions for talking to the MSP3400C Sound processor */
-----------
-----------static int msp3400c_reset(struct i2c_client *client)
-----------{
----------- /* reset and read revision code */
----------- static char reset_off[3] = { 0x00, 0x80, 0x00 };
----------- static char reset_on[3] = { 0x00, 0x00, 0x00 };
----------- static char write[3] = { I2C_MSP3400C_DFP + 1, 0x00, 0x1e };
----------- char read[2];
----------- struct i2c_msg reset[2] = {
----------- { client->addr, I2C_M_IGNORE_NAK, 3, reset_off },
----------- { client->addr, I2C_M_IGNORE_NAK, 3, reset_on },
----------- };
----------- struct i2c_msg test[2] = {
----------- { client->addr, 0, 3, write },
----------- { client->addr, I2C_M_RD, 2, read },
----------- };
-----------
----------- msp3400_dbg_highvol("msp3400c_reset\n");
----------- if ( (1 != i2c_transfer(client->adapter,&reset[0],1)) ||
----------- (1 != i2c_transfer(client->adapter,&reset[1],1)) ||
----------- (2 != i2c_transfer(client->adapter,test,2)) ) {
----------- msp3400_err("chip reset failed\n");
----------- return -1;
----------- }
----------- return 0;
-----------}
-----------
-----------static int msp3400c_read(struct i2c_client *client, int dev, int addr)
-----------{
----------- int err,retval;
-----------
----------- unsigned char write[3];
----------- unsigned char read[2];
----------- struct i2c_msg msgs[2] = {
----------- { client->addr, 0, 3, write },
----------- { client->addr, I2C_M_RD, 2, read }
----------- };
-----------
----------- write[0] = dev+1;
----------- write[1] = addr >> 8;
----------- write[2] = addr & 0xff;
-----------
----------- for (err = 0; err < 3;) {
----------- if (2 == i2c_transfer(client->adapter,msgs,2))
----------- break;
----------- err++;
----------- msp3400_warn("I/O error #%d (read 0x%02x/0x%02x)\n", err,
----------- dev, addr);
----------- current->state = TASK_INTERRUPTIBLE;
----------- schedule_timeout(msecs_to_jiffies(10));
----------- }
----------- if (3 == err) {
----------- msp3400_warn("giving up, resetting chip. Sound will go off, sorry folks :-|\n");
----------- msp3400c_reset(client);
----------- return -1;
----------- }
----------- retval = read[0] << 8 | read[1];
----------- msp3400_dbg_highvol("msp3400c_read(0x%x, 0x%x): 0x%x\n", dev, addr, retval);
----------- return retval;
-----------}
-----------
-----------static int msp3400c_write(struct i2c_client *client, int dev, int addr, int val)
-----------{
----------- int err;
----------- unsigned char buffer[5];
-----------
----------- buffer[0] = dev;
----------- buffer[1] = addr >> 8;
----------- buffer[2] = addr & 0xff;
----------- buffer[3] = val >> 8;
----------- buffer[4] = val & 0xff;
-----------
----------- msp3400_dbg_highvol("msp3400c_write(0x%x, 0x%x, 0x%x)\n", dev, addr, val);
----------- for (err = 0; err < 3;) {
----------- if (5 == i2c_master_send(client, buffer, 5))
----------- break;
----------- err++;
----------- msp3400_warn("I/O error #%d (write 0x%02x/0x%02x)\n", err,
----------- dev, addr);
----------- current->state = TASK_INTERRUPTIBLE;
----------- schedule_timeout(msecs_to_jiffies(10));
----------- }
----------- if (3 == err) {
----------- msp3400_warn("giving up, reseting chip. Sound will go off, sorry folks :-|\n");
----------- msp3400c_reset(client);
----------- return -1;
----------- }
----------- return 0;
-----------}
-----------
-----------/* ------------------------------------------------------------------------ */
-----------
-----------/* This macro is allowed for *constants* only, gcc must calculate it
----------- at compile time. Remember -- no floats in kernel mode */
-----------#define MSP_CARRIER(freq) ((int)((float)(freq/18.432)*(1<<24)))
-----------
-----------#define MSP_MODE_AM_DETECT 0
-----------#define MSP_MODE_FM_RADIO 2
-----------#define MSP_MODE_FM_TERRA 3
-----------#define MSP_MODE_FM_SAT 4
-----------#define MSP_MODE_FM_NICAM1 5
-----------#define MSP_MODE_FM_NICAM2 6
-----------#define MSP_MODE_AM_NICAM 7
-----------#define MSP_MODE_BTSC 8
-----------#define MSP_MODE_EXTERN 9
-----------
-----------static struct MSP_INIT_DATA_DEM {
----------- int fir1[6];
----------- int fir2[6];
----------- int cdo1;
----------- int cdo2;
----------- int ad_cv;
----------- int mode_reg;
----------- int dfp_src;
----------- int dfp_matrix;
-----------} msp_init_data[] = {
----------- { /* AM (for carrier detect / msp3400) */
----------- {75, 19, 36, 35, 39, 40},
----------- {75, 19, 36, 35, 39, 40},
----------- MSP_CARRIER(5.5), MSP_CARRIER(5.5),
----------- 0x00d0, 0x0500, 0x0020, 0x3000
----------- },{ /* AM (for carrier detect / msp3410) */
----------- {-1, -1, -8, 2, 59, 126},
----------- {-1, -1, -8, 2, 59, 126},
----------- MSP_CARRIER(5.5), MSP_CARRIER(5.5),
----------- 0x00d0, 0x0100, 0x0020, 0x3000
----------- },{ /* FM Radio */
----------- {-8, -8, 4, 6, 78, 107},
----------- {-8, -8, 4, 6, 78, 107},
----------- MSP_CARRIER(10.7), MSP_CARRIER(10.7),
----------- 0x00d0, 0x0480, 0x0020, 0x3000
----------- },{ /* Terrestial FM-mono + FM-stereo */
----------- {3, 18, 27, 48, 66, 72},
----------- {3, 18, 27, 48, 66, 72},
----------- MSP_CARRIER(5.5), MSP_CARRIER(5.5),
----------- 0x00d0, 0x0480, 0x0030, 0x3000
----------- },{ /* Sat FM-mono */
----------- { 1, 9, 14, 24, 33, 37},
----------- { 3, 18, 27, 48, 66, 72},
----------- MSP_CARRIER(6.5), MSP_CARRIER(6.5),
----------- 0x00c6, 0x0480, 0x0000, 0x3000
----------- },{ /* NICAM/FM -- B/G (5.5/5.85), D/K (6.5/5.85) */
----------- {-2, -8, -10, 10, 50, 86},
----------- {3, 18, 27, 48, 66, 72},
----------- MSP_CARRIER(5.5), MSP_CARRIER(5.5),
----------- 0x00d0, 0x0040, 0x0120, 0x3000
----------- },{ /* NICAM/FM -- I (6.0/6.552) */
----------- {2, 4, -6, -4, 40, 94},
----------- {3, 18, 27, 48, 66, 72},
----------- MSP_CARRIER(6.0), MSP_CARRIER(6.0),
----------- 0x00d0, 0x0040, 0x0120, 0x3000
----------- },{ /* NICAM/AM -- L (6.5/5.85) */
----------- {-2, -8, -10, 10, 50, 86},
----------- {-4, -12, -9, 23, 79, 126},
----------- MSP_CARRIER(6.5), MSP_CARRIER(6.5),
----------- 0x00c6, 0x0140, 0x0120, 0x7c03
----------- },
-----------};
-----------
-----------struct CARRIER_DETECT {
----------- int cdo;
----------- char *name;
-----------};
-----------
-----------static struct CARRIER_DETECT carrier_detect_main[] = {
----------- /* main carrier */
----------- { MSP_CARRIER(4.5), "4.5 NTSC" },
----------- { MSP_CARRIER(5.5), "5.5 PAL B/G" },
----------- { MSP_CARRIER(6.0), "6.0 PAL I" },
----------- { MSP_CARRIER(6.5), "6.5 PAL D/K + SAT + SECAM" }
-----------};
-----------
-----------static struct CARRIER_DETECT carrier_detect_55[] = {
----------- /* PAL B/G */
----------- { MSP_CARRIER(5.7421875), "5.742 PAL B/G FM-stereo" },
----------- { MSP_CARRIER(5.85), "5.85 PAL B/G NICAM" }
-----------};
-----------
-----------static struct CARRIER_DETECT carrier_detect_65[] = {
----------- /* PAL SAT / SECAM */
----------- { MSP_CARRIER(5.85), "5.85 PAL D/K + SECAM NICAM" },
----------- { MSP_CARRIER(6.2578125), "6.25 PAL D/K1 FM-stereo" },
----------- { MSP_CARRIER(6.7421875), "6.74 PAL D/K2 FM-stereo" },
----------- { MSP_CARRIER(7.02), "7.02 PAL SAT FM-stereo s/b" },
----------- { MSP_CARRIER(7.20), "7.20 PAL SAT FM-stereo s" },
----------- { MSP_CARRIER(7.38), "7.38 PAL SAT FM-stereo b" },
-----------};
-----------
-----------#define CARRIER_COUNT(x) (sizeof(x)/sizeof(struct CARRIER_DETECT))
-----------
-----------/* ----------------------------------------------------------------------- *
----------- * bits 9 8 5 - SCART DSP input Select:
----------- * 0 0 0 - SCART 1 to DSP input (reset position)
----------- * 0 1 0 - MONO to DSP input
----------- * 1 0 0 - SCART 2 to DSP input
----------- * 1 1 1 - Mute DSP input
----------- *
----------- * bits 11 10 6 - SCART 1 Output Select:
----------- * 0 0 0 - undefined (reset position)
----------- * 0 1 0 - SCART 2 Input to SCART 1 Output (for devices with 2 SCARTS)
----------- * 1 0 0 - MONO input to SCART 1 Output
----------- * 1 1 0 - SCART 1 DA to SCART 1 Output
----------- * 0 0 1 - SCART 2 DA to SCART 1 Output
----------- * 0 1 1 - SCART 1 Input to SCART 1 Output
----------- * 1 1 1 - Mute SCART 1 Output
----------- *
----------- * bits 13 12 7 - SCART 2 Output Select (for devices with 2 Output SCART):
----------- * 0 0 0 - SCART 1 DA to SCART 2 Output (reset position)
----------- * 0 1 0 - SCART 1 Input to SCART 2 Output
----------- * 1 0 0 - MONO input to SCART 2 Output
----------- * 0 0 1 - SCART 2 DA to SCART 2 Output
----------- * 0 1 1 - SCART 2 Input to SCART 2 Output
----------- * 1 1 0 - Mute SCART 2 Output
----------- *
----------- * Bits 4 to 0 should be zero.
----------- * ----------------------------------------------------------------------- */
-----------
-----------static int scarts[3][9] = {
----------- /* MASK IN1 IN2 IN1_DA IN2_DA IN3 IN4 MONO MUTE */
----------- /* SCART DSP Input select */
----------- { 0x0320, 0x0000, 0x0200, -1, -1, 0x0300, 0x0020, 0x0100, 0x0320 },
----------- /* SCART1 Output select */
----------- { 0x0c40, 0x0440, 0x0400, 0x0c00, 0x0040, 0x0000, 0x0840, 0x0800, 0x0c40 },
----------- /* SCART2 Output select */
----------- { 0x3080, 0x1000, 0x1080, 0x0000, 0x0080, 0x2080, 0x3080, 0x2000, 0x3000 },
-----------};
-----------
-----------static char *scart_names[] = {
----------- "mask", "in1", "in2", "in1 da", "in2 da", "in3", "in4", "mono", "mute"
-----------};
-----------
-----------static void msp3400c_set_scart(struct i2c_client *client, int in, int out)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
-----------
----------- msp->in_scart=in;
-----------
----------- if (in >= 1 && in <= 8 && out >= 0 && out <= 2) {
----------- if (-1 == scarts[out][in])
----------- return;
-----------
----------- msp->acb &= ~scarts[out][SCART_MASK];
----------- msp->acb |= scarts[out][in];
----------- } else
----------- msp->acb = 0xf60; /* Mute Input and SCART 1 Output */
-----------
----------- msp3400_dbg("scart switch: %s => %d (ACB=0x%04x)\n",
----------- scart_names[in], out, msp->acb);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x13, msp->acb);
-----------
----------- /* Sets I2S speed 0 = 1.024 Mbps, 1 = 2.048 Mbps */
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x40, msp->i2s_mode);
-----------}
-----------
-----------/* ------------------------------------------------------------------------ */
-----------
-----------static void msp3400c_setcarrier(struct i2c_client *client, int cdo1, int cdo2)
-----------{
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x0093, cdo1 & 0xfff);
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x009b, cdo1 >> 12);
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x00a3, cdo2 & 0xfff);
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x00ab, cdo2 >> 12);
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x0056, 0); /*LOAD_REG_1/2*/
-----------}
-----------
-----------static void msp3400c_setvolume(struct i2c_client *client,
----------- int muted, int left, int right)
----------- {
----------- int vol = 0, val = 0, balance = 0;
-----------
----------- if (!muted) {
----------- /* 0x7f instead if 0x73 here has sound quality issues,
----------- * probably due to overmodulation + clipping ... */
----------- vol = (left > right) ? left : right;
----------- val = (vol * 0x73 / 65535) << 8;
----------- }
----------- if (vol > 0) {
----------- balance = ((right - left) * 127) / vol;
----------- }
-----------
----------- msp3400_dbg("setvolume: mute=%s %d:%d v=0x%02x b=0x%02x\n",
----------- muted ? "on" : "off", left, right, val >> 8, balance);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0000, val); /* loudspeaker */
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0006, val); /* headphones */
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0007,
----------- muted ? 0x1 : (val | 0x1));
----------- msp3400c_write(client, I2C_MSP3400C_DFP, 0x0001, balance << 8);
-----------}
-----------
-----------static void msp3400c_setbass(struct i2c_client *client, int bass)
-----------{
----------- int val = ((bass-32768) * 0x60 / 65535) << 8;
-----------
----------- msp3400_dbg("setbass: %d 0x%02x\n", bass, val >> 8);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0002, val); /* loudspeaker */
-----------}
-----------
-----------static void msp3400c_settreble(struct i2c_client *client, int treble)
-----------{
----------- int val = ((treble-32768) * 0x60 / 65535) << 8;
-----------
----------- msp3400_dbg("settreble: %d 0x%02x\n",treble, val>>8);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0003, val); /* loudspeaker */
-----------}
-----------
-----------static void msp3400c_setmode(struct i2c_client *client, int type)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
----------- int i;
-----------
----------- msp3400_dbg("setmode: %d\n",type);
----------- msp->mode = type;
----------- msp->audmode = V4L2_TUNER_MODE_MONO;
----------- msp->rxsubchans = V4L2_TUNER_SUB_MONO;
-----------
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x00bb, /* ad_cv */
----------- msp_init_data[type].ad_cv);
-----------
----------- for (i = 5; i >= 0; i--) /* fir 1 */
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x0001,
----------- msp_init_data[type].fir1[i]);
-----------
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x0005, 0x0004); /* fir 2 */
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x0005, 0x0040);
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x0005, 0x0000);
----------- for (i = 5; i >= 0; i--)
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x0005,
----------- msp_init_data[type].fir2[i]);
-----------
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x0083, /* MODE_REG */
----------- msp_init_data[type].mode_reg);
-----------
----------- msp3400c_setcarrier(client, msp_init_data[type].cdo1,
----------- msp_init_data[type].cdo2);
-----------
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x0056, 0); /*LOAD_REG_1/2*/
-----------
----------- if (dolby) {
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0008,
----------- 0x0520); /* I2S1 */
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0009,
----------- 0x0620); /* I2S2 */
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x000b,
----------- msp_init_data[type].dfp_src);
----------- } else {
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0008,
----------- msp_init_data[type].dfp_src);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0009,
----------- msp_init_data[type].dfp_src);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x000b,
----------- msp_init_data[type].dfp_src);
----------- }
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x000a,
----------- msp_init_data[type].dfp_src);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x000e,
----------- msp_init_data[type].dfp_matrix);
-----------
----------- if (HAVE_NICAM(msp)) {
----------- /* nicam prescale */
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0010, 0x5a00); /* was: 0x3000 */
----------- }
-----------}
-----------
-----------/* given a bitmask of VIDEO_SOUND_XXX returns the "best" in the bitmask */
-----------static int best_video_sound(int rxsubchans)
-----------{
----------- if (rxsubchans & V4L2_TUNER_SUB_STEREO)
----------- return V4L2_TUNER_MODE_STEREO;
----------- if (rxsubchans & V4L2_TUNER_SUB_LANG1)
----------- return V4L2_TUNER_MODE_LANG1;
----------- if (rxsubchans & V4L2_TUNER_SUB_LANG2)
----------- return V4L2_TUNER_MODE_LANG2;
----------- return V4L2_TUNER_MODE_MONO;
-----------}
-----------
-----------/* turn on/off nicam + stereo */
-----------static void msp3400c_setstereo(struct i2c_client *client, int mode)
-----------{
----------- static char *strmode[] = { "0", "mono", "stereo", "3",
----------- "lang1", "5", "6", "7", "lang2"
----------- };
----------- struct msp3400c *msp = i2c_get_clientdata(client);
----------- int nicam = 0; /* channel source: FM/AM or nicam */
----------- int src = 0;
-----------
----------- if (IS_MSP34XX_G(msp)) {
----------- /* this method would break everything, let's make sure
----------- * it's never called
----------- */
----------- msp3400_dbg
----------- ("DEBUG WARNING setstereo called with mode=%d instead of set_source (ignored)\n",
----------- mode);
----------- return;
----------- }
-----------
----------- /* switch demodulator */
----------- switch (msp->mode) {
----------- case MSP_MODE_FM_TERRA:
----------- msp3400_dbg("FM setstereo: %s\n", strmode[mode]);
----------- msp3400c_setcarrier(client,msp->second,msp->main);
----------- switch (mode) {
----------- case V4L2_TUNER_MODE_STEREO:
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x000e, 0x3001);
----------- break;
----------- case V4L2_TUNER_MODE_MONO:
----------- case V4L2_TUNER_MODE_LANG1:
----------- case V4L2_TUNER_MODE_LANG2:
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x000e, 0x3000);
----------- break;
----------- }
----------- break;
----------- case MSP_MODE_FM_SAT:
----------- msp3400_dbg("SAT setstereo: %s\n", strmode[mode]);
----------- switch (mode) {
----------- case V4L2_TUNER_MODE_MONO:
----------- msp3400c_setcarrier(client, MSP_CARRIER(6.5), MSP_CARRIER(6.5));
----------- break;
----------- case V4L2_TUNER_MODE_STEREO:
----------- msp3400c_setcarrier(client, MSP_CARRIER(7.2), MSP_CARRIER(7.02));
----------- break;
----------- case V4L2_TUNER_MODE_LANG1:
----------- msp3400c_setcarrier(client, MSP_CARRIER(7.38), MSP_CARRIER(7.02));
----------- break;
----------- case V4L2_TUNER_MODE_LANG2:
----------- msp3400c_setcarrier(client, MSP_CARRIER(7.38), MSP_CARRIER(7.02));
----------- break;
----------- }
----------- break;
----------- case MSP_MODE_FM_NICAM1:
----------- case MSP_MODE_FM_NICAM2:
----------- case MSP_MODE_AM_NICAM:
----------- msp3400_dbg("NICAM setstereo: %s\n",strmode[mode]);
----------- msp3400c_setcarrier(client,msp->second,msp->main);
----------- if (msp->nicam_on)
----------- nicam=0x0100;
----------- break;
----------- case MSP_MODE_BTSC:
----------- msp3400_dbg("BTSC setstereo: %s\n",strmode[mode]);
----------- nicam=0x0300;
----------- break;
----------- case MSP_MODE_EXTERN:
----------- msp3400_dbg("extern setstereo: %s\n",strmode[mode]);
----------- nicam = 0x0200;
----------- break;
----------- case MSP_MODE_FM_RADIO:
----------- msp3400_dbg("FM-Radio setstereo: %s\n",strmode[mode]);
----------- break;
----------- default:
----------- msp3400_dbg("mono setstereo\n");
----------- return;
----------- }
-----------
----------- /* switch audio */
----------- switch (best_video_sound(mode)) {
----------- case V4L2_TUNER_MODE_STEREO:
----------- src = 0x0020 | nicam;
----------- break;
----------- case V4L2_TUNER_MODE_MONO:
----------- if (msp->mode == MSP_MODE_AM_NICAM) {
----------- msp3400_dbg("switching to AM mono\n");
----------- /* AM mono decoding is handled by tuner, not MSP chip */
----------- /* SCART switching control register */
----------- msp3400c_set_scart(client,SCART_MONO,0);
----------- src = 0x0200;
----------- break;
----------- }
----------- case V4L2_TUNER_MODE_LANG1:
----------- src = 0x0000 | nicam;
----------- break;
----------- case V4L2_TUNER_MODE_LANG2:
----------- src = 0x0010 | nicam;
----------- break;
----------- }
----------- msp3400_dbg("setstereo final source/matrix = 0x%x\n", src);
-----------
----------- if (dolby) {
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0008,0x0520);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0009,0x0620);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x000a,src);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x000b,src);
----------- } else {
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0008,src);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0009,src);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x000a,src);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x000b,src);
----------- }
-----------}
-----------
-----------static void
-----------msp3400c_print_mode(struct i2c_client *client)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
-----------
----------- if (msp->main == msp->second) {
----------- msp3400_dbg("mono sound carrier: %d.%03d MHz\n",
----------- msp->main/910000,(msp->main/910)%1000);
----------- } else {
----------- msp3400_dbg("main sound carrier: %d.%03d MHz\n",
----------- msp->main/910000,(msp->main/910)%1000);
----------- }
----------- if (msp->mode == MSP_MODE_FM_NICAM1 || msp->mode == MSP_MODE_FM_NICAM2)
----------- msp3400_dbg("NICAM/FM carrier : %d.%03d MHz\n",
----------- msp->second/910000,(msp->second/910)%1000);
----------- if (msp->mode == MSP_MODE_AM_NICAM)
----------- msp3400_dbg("NICAM/AM carrier : %d.%03d MHz\n",
----------- msp->second/910000,(msp->second/910)%1000);
----------- if (msp->mode == MSP_MODE_FM_TERRA &&
----------- msp->main != msp->second) {
----------- msp3400_dbg("FM-stereo carrier : %d.%03d MHz\n",
----------- msp->second/910000,(msp->second/910)%1000);
----------- }
-----------}
-----------
-----------#define MSP3400_MAX 4
-----------static struct i2c_client *msps[MSP3400_MAX];
-----------static void msp3400c_restore_dfp(struct i2c_client *client)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
----------- int i;
-----------
----------- for (i = 0; i < DFP_COUNT; i++) {
----------- if (-1 == msp->dfp_regs[i])
----------- continue;
----------- msp3400c_write(client, I2C_MSP3400C_DFP, i, msp->dfp_regs[i]);
----------- }
-----------}
-----------
-----------/* if the dfp_regs is set, set what's in there. Otherwise, set the default value */
-----------static int msp3400c_write_dfp_with_default(struct i2c_client *client,
----------- int addr, int default_value)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
----------- int value = default_value;
----------- if (addr < DFP_COUNT && -1 != msp->dfp_regs[addr])
----------- value = msp->dfp_regs[addr];
----------- return msp3400c_write(client, I2C_MSP3400C_DFP, addr, value);
-----------}
-----------
-----------/* ----------------------------------------------------------------------- */
-----------
-----------struct REGISTER_DUMP {
----------- int addr;
----------- char *name;
-----------};
-----------
-----------struct REGISTER_DUMP d1[] = {
----------- {0x007e, "autodetect"},
----------- {0x0023, "C_AD_BITS "},
----------- {0x0038, "ADD_BITS "},
----------- {0x003e, "CIB_BITS "},
----------- {0x0057, "ERROR_RATE"},
-----------};
-----------
-----------static int autodetect_stereo(struct i2c_client *client)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
----------- int val;
----------- int rxsubchans = msp->rxsubchans;
----------- int newnicam = msp->nicam_on;
----------- int update = 0;
-----------
----------- switch (msp->mode) {
----------- case MSP_MODE_FM_TERRA:
----------- val = msp3400c_read(client, I2C_MSP3400C_DFP, 0x18);
----------- if (val > 32767)
----------- val -= 65536;
----------- msp3400_dbg("stereo detect register: %d\n",val);
----------- if (val > 4096) {
----------- rxsubchans = V4L2_TUNER_SUB_STEREO | V4L2_TUNER_SUB_MONO;
----------- } else if (val < -4096) {
----------- rxsubchans = V4L2_TUNER_SUB_LANG1 | V4L2_TUNER_SUB_LANG2;
----------- } else {
----------- rxsubchans = V4L2_TUNER_SUB_MONO;
----------- }
----------- newnicam = 0;
----------- break;
----------- case MSP_MODE_FM_NICAM1:
----------- case MSP_MODE_FM_NICAM2:
----------- case MSP_MODE_AM_NICAM:
----------- val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x23);
----------- msp3400_dbg("nicam sync=%d, mode=%d\n",
----------- val & 1, (val & 0x1e) >> 1);
-----------
----------- if (val & 1) {
----------- /* nicam synced */
----------- switch ((val & 0x1e) >> 1) {
----------- case 0:
----------- case 8:
----------- rxsubchans = V4L2_TUNER_SUB_STEREO;
----------- break;
----------- case 1:
----------- case 9:
----------- rxsubchans = V4L2_TUNER_SUB_MONO
----------- | V4L2_TUNER_SUB_LANG1;
----------- break;
----------- case 2:
----------- case 10:
----------- rxsubchans = V4L2_TUNER_SUB_MONO
----------- | V4L2_TUNER_SUB_LANG1
----------- | V4L2_TUNER_SUB_LANG2;
----------- break;
----------- default:
----------- rxsubchans = V4L2_TUNER_SUB_MONO;
----------- break;
----------- }
----------- newnicam=1;
----------- } else {
----------- newnicam = 0;
----------- rxsubchans = V4L2_TUNER_SUB_MONO;
----------- }
----------- break;
----------- case MSP_MODE_BTSC:
----------- val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x200);
----------- msp3400_dbg("status=0x%x (pri=%s, sec=%s, %s%s%s)\n",
----------- val,
----------- (val & 0x0002) ? "no" : "yes",
----------- (val & 0x0004) ? "no" : "yes",
----------- (val & 0x0040) ? "stereo" : "mono",
----------- (val & 0x0080) ? ", nicam 2nd mono" : "",
----------- (val & 0x0100) ? ", bilingual/SAP" : "");
----------- rxsubchans = V4L2_TUNER_SUB_MONO;
----------- if (val & 0x0040) rxsubchans |= V4L2_TUNER_SUB_STEREO;
----------- if (val & 0x0100) rxsubchans |= V4L2_TUNER_SUB_LANG1;
----------- break;
----------- }
----------- if (rxsubchans != msp->rxsubchans) {
----------- update = 1;
----------- msp3400_dbg("watch: rxsubchans %d => %d\n",
----------- msp->rxsubchans,rxsubchans);
----------- msp->rxsubchans = rxsubchans;
----------- }
----------- if (newnicam != msp->nicam_on) {
----------- update = 1;
----------- msp3400_dbg("watch: nicam %d => %d\n",
----------- msp->nicam_on,newnicam);
----------- msp->nicam_on = newnicam;
----------- }
----------- return update;
-----------}
-----------
-----------/*
----------- * A kernel thread for msp3400 control -- we don't want to block the
----------- * in the ioctl while doing the sound carrier & stereo detect
----------- */
-----------
-----------static int msp34xx_sleep(struct msp3400c *msp, int timeout)
-----------{
----------- DECLARE_WAITQUEUE(wait, current);
-----------
----------- add_wait_queue(&msp->wq, &wait);
----------- if (!kthread_should_stop()) {
----------- if (timeout < 0) {
----------- set_current_state(TASK_INTERRUPTIBLE);
----------- schedule();
----------- } else {
----------- schedule_timeout_interruptible
----------- (msecs_to_jiffies(timeout));
----------- }
----------- }
-----------
----------- remove_wait_queue(&msp->wq, &wait);
----------- try_to_freeze();
----------- return msp->restart;
-----------}
-----------
-----------/* stereo/multilang monitoring */
-----------static void watch_stereo(struct i2c_client *client)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
-----------
----------- if (autodetect_stereo(client)) {
----------- if (msp->stereo & V4L2_TUNER_MODE_STEREO)
----------- msp3400c_setstereo(client, V4L2_TUNER_MODE_STEREO);
----------- else if (msp->stereo & VIDEO_SOUND_LANG1)
----------- msp3400c_setstereo(client, V4L2_TUNER_MODE_LANG1);
----------- else
----------- msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO);
----------- }
-----------
----------- if (once)
----------- msp->watch_stereo = 0;
-----------}
-- - ----
-----------
-----------static int msp3400c_thread(void *data)
-----------{
----------- struct i2c_client *client = data;
----------- struct msp3400c *msp = i2c_get_clientdata(client);
----------- struct CARRIER_DETECT *cd;
----------- int count, max1,max2,val1,val2, val,this;
-- - ----
-----------
----------- msp3400_info("msp3400 daemon started\n");
----------- for (;;) {
----------- msp3400_dbg_mediumvol("msp3400 thread: sleep\n");
----------- msp34xx_sleep(msp,-1);
----------- msp3400_dbg_mediumvol("msp3400 thread: wakeup\n");
-----------
----------- restart:
----------- msp3400_dbg("thread: restart scan\n");
----------- msp->restart = 0;
----------- if (kthread_should_stop())
----------- break;
-----------
----------- if (VIDEO_MODE_RADIO == msp->norm ||
----------- MSP_MODE_EXTERN == msp->mode) {
----------- /* no carrier scan, just unmute */
----------- msp3400_info("thread: no carrier scan\n");
----------- msp3400c_setvolume(client, msp->muted, msp->left, msp->right);
----------- continue;
----------- }
-----------
----------- /* mute */
----------- msp3400c_setvolume(client, msp->muted, 0, 0);
----------- msp3400c_setmode(client, MSP_MODE_AM_DETECT /* +1 */ );
----------- val1 = val2 = 0;
----------- max1 = max2 = -1;
----------- msp->watch_stereo = 0;
-----------
----------- /* some time for the tuner to sync */
----------- if (msp34xx_sleep(msp,200))
----------- goto restart;
-----------
----------- /* carrier detect pass #1 -- main carrier */
----------- cd = carrier_detect_main;
----------- count = CARRIER_COUNT(carrier_detect_main);
-----------
----------- if (amsound && (msp->norm == VIDEO_MODE_SECAM)) {
----------- /* autodetect doesn't work well with AM ... */
----------- max1 = 3;
----------- count = 0;
----------- msp3400_dbg("AM sound override\n");
----------- }
-----------
----------- for (this = 0; this < count; this++) {
----------- msp3400c_setcarrier(client, cd[this].cdo,cd[this].cdo);
----------- if (msp34xx_sleep(msp,100))
----------- goto restart;
----------- val = msp3400c_read(client, I2C_MSP3400C_DFP, 0x1b);
----------- if (val > 32767)
----------- val -= 65536;
----------- if (val1 < val)
----------- val1 = val, max1 = this;
----------- msp3400_dbg("carrier1 val: %5d / %s\n", val,cd[this].name);
----------- }
-----------
----------- /* carrier detect pass #2 -- second (stereo) carrier */
----------- switch (max1) {
----------- case 1: /* 5.5 */
----------- cd = carrier_detect_55;
----------- count = CARRIER_COUNT(carrier_detect_55);
----------- break;
----------- case 3: /* 6.5 */
----------- cd = carrier_detect_65;
----------- count = CARRIER_COUNT(carrier_detect_65);
----------- break;
----------- case 0: /* 4.5 */
----------- case 2: /* 6.0 */
----------- default:
----------- cd = NULL;
----------- count = 0;
----------- break;
----------- }
-----------
----------- if (amsound && (msp->norm == VIDEO_MODE_SECAM)) {
----------- /* autodetect doesn't work well with AM ... */
----------- cd = NULL;
----------- count = 0;
----------- max2 = 0;
----------- }
----------- for (this = 0; this < count; this++) {
----------- msp3400c_setcarrier(client, cd[this].cdo,cd[this].cdo);
----------- if (msp34xx_sleep(msp,100))
----------- goto restart;
----------- val = msp3400c_read(client, I2C_MSP3400C_DFP, 0x1b);
----------- if (val > 32767)
----------- val -= 65536;
----------- if (val2 < val)
----------- val2 = val, max2 = this;
----------- msp3400_dbg("carrier2 val: %5d / %s\n", val,cd[this].name);
----------- }
-----------
----------- /* programm the msp3400 according to the results */
----------- msp->main = carrier_detect_main[max1].cdo;
----------- switch (max1) {
----------- case 1: /* 5.5 */
----------- if (max2 == 0) {
----------- /* B/G FM-stereo */
----------- msp->second = carrier_detect_55[max2].cdo;
----------- msp3400c_setmode(client, MSP_MODE_FM_TERRA);
----------- msp->nicam_on = 0;
----------- msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO);
----------- msp->watch_stereo = 1;
----------- } else if (max2 == 1 && HAVE_NICAM(msp)) {
----------- /* B/G NICAM */
----------- msp->second = carrier_detect_55[max2].cdo;
----------- msp3400c_setmode(client, MSP_MODE_FM_NICAM1);
----------- msp->nicam_on = 1;
----------- msp3400c_setcarrier(client, msp->second, msp->main);
----------- msp->watch_stereo = 1;
----------- } else {
----------- goto no_second;
----------- }
----------- break;
----------- case 2: /* 6.0 */
----------- /* PAL I NICAM */
----------- msp->second = MSP_CARRIER(6.552);
----------- msp3400c_setmode(client, MSP_MODE_FM_NICAM2);
----------- msp->nicam_on = 1;
----------- msp3400c_setcarrier(client, msp->second, msp->main);
----------- msp->watch_stereo = 1;
----------- break;
----------- case 3: /* 6.5 */
----------- if (max2 == 1 || max2 == 2) {
----------- /* D/K FM-stereo */
----------- msp->second = carrier_detect_65[max2].cdo;
----------- msp3400c_setmode(client, MSP_MODE_FM_TERRA);
----------- msp->nicam_on = 0;
----------- msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO);
----------- msp->watch_stereo = 1;
----------- } else if (max2 == 0 &&
----------- msp->norm == VIDEO_MODE_SECAM) {
----------- /* L NICAM or AM-mono */
----------- msp->second = carrier_detect_65[max2].cdo;
----------- msp3400c_setmode(client, MSP_MODE_AM_NICAM);
----------- msp->nicam_on = 0;
----------- msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO);
----------- msp3400c_setcarrier(client, msp->second, msp->main);
----------- /* volume prescale for SCART (AM mono input) */
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x000d, 0x1900);
----------- msp->watch_stereo = 1;
----------- } else if (max2 == 0 && HAVE_NICAM(msp)) {
----------- /* D/K NICAM */
----------- msp->second = carrier_detect_65[max2].cdo;
----------- msp3400c_setmode(client, MSP_MODE_FM_NICAM1);
----------- msp->nicam_on = 1;
----------- msp3400c_setcarrier(client, msp->second, msp->main);
----------- msp->watch_stereo = 1;
----------- } else {
----------- goto no_second;
----------- }
----------- break;
----------- case 0: /* 4.5 */
----------- default:
----------- no_second:
----------- msp->second = carrier_detect_main[max1].cdo;
----------- msp3400c_setmode(client, MSP_MODE_FM_TERRA);
----------- msp->nicam_on = 0;
----------- msp3400c_setcarrier(client, msp->second, msp->main);
----------- msp->rxsubchans = V4L2_TUNER_SUB_MONO;
----------- msp3400c_setstereo(client, V4L2_TUNER_MODE_MONO);
----------- break;
----------- }
-----------
----------- /* unmute */
----------- msp3400c_setvolume(client, msp->muted, msp->left, msp->right);
----------- msp3400c_restore_dfp(client);
-----------
----------- if (debug)
----------- msp3400c_print_mode(client);
-----------
----------- /* monitor tv audio mode */
----------- while (msp->watch_stereo) {
----------- if (msp34xx_sleep(msp,5000))
----------- goto restart;
----------- watch_stereo(client);
----------- }
----------- }
----------- msp3400_dbg("thread: exit\n");
----------- return 0;
-----------}
-----------
-----------/* ----------------------------------------------------------------------- */
-----------/* this one uses the automatic sound standard detection of newer */
-----------/* msp34xx chip versions */
-----------
-----------static struct MODES {
----------- int retval;
----------- int main, second;
----------- char *name;
-----------} modelist[] = {
----------- { 0x0000, 0, 0, "ERROR" },
----------- { 0x0001, 0, 0, "autodetect start" },
----------- { 0x0002, MSP_CARRIER(4.5), MSP_CARRIER(4.72), "4.5/4.72 M Dual FM-Stereo" },
----------- { 0x0003, MSP_CARRIER(5.5), MSP_CARRIER(5.7421875), "5.5/5.74 B/G Dual FM-Stereo" },
----------- { 0x0004, MSP_CARRIER(6.5), MSP_CARRIER(6.2578125), "6.5/6.25 D/K1 Dual FM-Stereo" },
----------- { 0x0005, MSP_CARRIER(6.5), MSP_CARRIER(6.7421875), "6.5/6.74 D/K2 Dual FM-Stereo" },
----------- { 0x0006, MSP_CARRIER(6.5), MSP_CARRIER(6.5), "6.5 D/K FM-Mono (HDEV3)" },
----------- { 0x0008, MSP_CARRIER(5.5), MSP_CARRIER(5.85), "5.5/5.85 B/G NICAM FM" },
----------- { 0x0009, MSP_CARRIER(6.5), MSP_CARRIER(5.85), "6.5/5.85 L NICAM AM" },
----------- { 0x000a, MSP_CARRIER(6.0), MSP_CARRIER(6.55), "6.0/6.55 I NICAM FM" },
----------- { 0x000b, MSP_CARRIER(6.5), MSP_CARRIER(5.85), "6.5/5.85 D/K NICAM FM" },
----------- { 0x000c, MSP_CARRIER(6.5), MSP_CARRIER(5.85), "6.5/5.85 D/K NICAM FM (HDEV2)" },
----------- { 0x0020, MSP_CARRIER(4.5), MSP_CARRIER(4.5), "4.5 M BTSC-Stereo" },
----------- { 0x0021, MSP_CARRIER(4.5), MSP_CARRIER(4.5), "4.5 M BTSC-Mono + SAP" },
----------- { 0x0030, MSP_CARRIER(4.5), MSP_CARRIER(4.5), "4.5 M EIA-J Japan Stereo" },
----------- { 0x0040, MSP_CARRIER(10.7), MSP_CARRIER(10.7), "10.7 FM-Stereo Radio" },
----------- { 0x0050, MSP_CARRIER(6.5), MSP_CARRIER(6.5), "6.5 SAT-Mono" },
----------- { 0x0051, MSP_CARRIER(7.02), MSP_CARRIER(7.20), "7.02/7.20 SAT-Stereo" },
----------- { 0x0060, MSP_CARRIER(7.2), MSP_CARRIER(7.2), "7.2 SAT ADR" },
----------- { -1, 0, 0, NULL }, /* EOF */
-----------};
-----------
-----------static inline const char *msp34xx_standard_mode_name(int mode)
-----------{
----------- int i;
----------- for (i = 0; modelist[i].name != NULL; i++)
----------- if (modelist[i].retval == mode)
----------- return modelist[i].name;
----------- return "unknown";
-----------}
-----------
-----------static int msp34xx_modus(struct i2c_client *client, int norm)
-----------{
----------- switch (norm) {
----------- case VIDEO_MODE_PAL:
----------- msp3400_dbg("video mode selected to PAL\n");
-----------
-----------#if 1
----------- /* experimental: not sure this works with all chip versions */
----------- return 0x7003;
-----------#else
----------- /* previous value, try this if it breaks ... */
----------- return 0x1003;
-----------#endif
----------- case VIDEO_MODE_NTSC: /* BTSC */
----------- msp3400_dbg("video mode selected to NTSC\n");
----------- return 0x2003;
----------- case VIDEO_MODE_SECAM:
----------- msp3400_dbg("video mode selected to SECAM\n");
----------- return 0x0003;
----------- case VIDEO_MODE_RADIO:
----------- msp3400_dbg("video mode selected to Radio\n");
----------- return 0x0003;
----------- case VIDEO_MODE_AUTO:
----------- msp3400_dbg("video mode selected to Auto\n");
----------- return 0x2003;
----------- default:
----------- return 0x0003;
----------- }
-----------}
-----------
-----------static int msp34xx_standard(int norm)
-----------{
----------- switch (norm) {
----------- case VIDEO_MODE_PAL:
----------- return 1;
----------- case VIDEO_MODE_NTSC: /* BTSC */
----------- return 0x0020;
----------- case VIDEO_MODE_SECAM:
----------- return 1;
----------- case VIDEO_MODE_RADIO:
----------- return 0x0040;
----------- default:
----------- return 1;
----------- }
-----------}
-----------
-----------static int msp3410d_thread(void *data)
-----------{
----------- struct i2c_client *client = data;
----------- struct msp3400c *msp = i2c_get_clientdata(client);
----------- int mode,val,i,std;
-----------
----------- msp3400_info("msp3410 daemon started\n");
-- - ----
----------- for (;;) {
----------- msp3400_dbg_mediumvol("msp3410 thread: sleep\n");
----------- msp34xx_sleep(msp,-1);
----------- msp3400_dbg_mediumvol("msp3410 thread: wakeup\n");
-----------
----------- restart:
----------- msp3400_dbg("thread: restart scan\n");
----------- msp->restart = 0;
----------- if (kthread_should_stop())
----------- break;
-----------
----------- if (msp->mode == MSP_MODE_EXTERN) {
----------- /* no carrier scan needed, just unmute */
----------- msp3400_dbg("thread: no carrier scan\n");
----------- msp3400c_setvolume(client, msp->muted, msp->left, msp->right);
----------- continue;
----------- }
-----------
----------- /* put into sane state (and mute) */
----------- msp3400c_reset(client);
-----------
----------- /* some time for the tuner to sync */
----------- if (msp34xx_sleep(msp,200))
----------- goto restart;
-----------
----------- /* start autodetect */
----------- mode = msp34xx_modus(client, msp->norm);
----------- std = msp34xx_standard(msp->norm);
----------- msp3400c_write(client, I2C_MSP3400C_DEM, 0x30, mode);
----------- msp3400c_write(client, I2C_MSP3400C_DEM, 0x20, std);
----------- msp->watch_stereo = 0;
-----------
----------- if (debug)
----------- msp3400_dbg("setting mode: %s (0x%04x)\n",
----------- msp34xx_standard_mode_name(std) ,std);
-----------
----------- if (std != 1) {
----------- /* programmed some specific mode */
----------- val = std;
----------- } else {
----------- /* triggered autodetect */
----------- for (;;) {
----------- if (msp34xx_sleep(msp,100))
----------- goto restart;
-----------
----------- /* check results */
----------- val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x7e);
----------- if (val < 0x07ff)
----------- break;
----------- msp3400_dbg("detection still in progress\n");
----------- }
----------- }
----------- for (i = 0; modelist[i].name != NULL; i++)
----------- if (modelist[i].retval == val)
----------- break;
----------- msp3400_dbg("current mode: %s (0x%04x)\n",
----------- modelist[i].name ? modelist[i].name : "unknown",
----------- val);
----------- msp->main = modelist[i].main;
----------- msp->second = modelist[i].second;
-----------
----------- if (amsound && (msp->norm == VIDEO_MODE_SECAM) && (val != 0x0009)) {
----------- /* autodetection has failed, let backup */
----------- msp3400_dbg("autodetection failed,"
----------- " switching to backup mode: %s (0x%04x)\n",
----------- modelist[8].name ? modelist[8].name : "unknown",val);
----------- val = 0x0009;
----------- msp3400c_write(client, I2C_MSP3400C_DEM, 0x20, val);
----------- }
-----------
----------- /* set various prescales */
----------- msp3400c_write(client, I2C_MSP3400C_DFP, 0x0d, 0x1900); /* scart */
----------- msp3400c_write(client, I2C_MSP3400C_DFP, 0x0e, 0x2403); /* FM */
----------- msp3400c_write(client, I2C_MSP3400C_DFP, 0x10, 0x5a00); /* nicam */
-----------
----------- /* set stereo */
----------- switch (val) {
----------- case 0x0008: /* B/G NICAM */
----------- case 0x000a: /* I NICAM */
----------- if (val == 0x0008)
----------- msp->mode = MSP_MODE_FM_NICAM1;
----------- else
----------- msp->mode = MSP_MODE_FM_NICAM2;
----------- /* just turn on stereo */
----------- msp->rxsubchans = V4L2_TUNER_SUB_STEREO;
----------- msp->nicam_on = 1;
----------- msp->watch_stereo = 1;
----------- msp3400c_setstereo(client,V4L2_TUNER_MODE_STEREO);
----------- break;
----------- case 0x0009:
----------- msp->mode = MSP_MODE_AM_NICAM;
----------- msp->rxsubchans = V4L2_TUNER_SUB_MONO;
----------- msp->nicam_on = 1;
----------- msp3400c_setstereo(client,V4L2_TUNER_MODE_MONO);
----------- msp->watch_stereo = 1;
----------- break;
----------- case 0x0020: /* BTSC */
----------- /* just turn on stereo */
----------- msp->mode = MSP_MODE_BTSC;
----------- msp->rxsubchans = V4L2_TUNER_SUB_STEREO;
----------- msp->nicam_on = 0;
----------- msp->watch_stereo = 1;
----------- msp3400c_setstereo(client,V4L2_TUNER_MODE_STEREO);
----------- break;
----------- case 0x0040: /* FM radio */
----------- msp->mode = MSP_MODE_FM_RADIO;
----------- msp->rxsubchans = V4L2_TUNER_SUB_STEREO;
----------- msp->audmode = V4L2_TUNER_MODE_STEREO;
----------- msp->nicam_on = 0;
----------- msp->watch_stereo = 0;
----------- /* not needed in theory if HAVE_RADIO(), but
----------- short programming enables carrier mute */
----------- msp3400c_setmode(client,MSP_MODE_FM_RADIO);
----------- msp3400c_setcarrier(client, MSP_CARRIER(10.7),
----------- MSP_CARRIER(10.7));
----------- /* scart routing */
----------- msp3400c_set_scart(client,SCART_IN2,0);
----------- /* msp34xx does radio decoding */
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x08, 0x0020);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x09, 0x0020);
----------- msp3400c_write(client,I2C_MSP3400C_DFP, 0x0b, 0x0020);
----------- break;
----------- case 0x0003:
----------- case 0x0004:
----------- case 0x0005:
----------- msp->mode = MSP_MODE_FM_TERRA;
----------- msp->rxsubchans = V4L2_TUNER_SUB_MONO;
----------- msp->audmode = V4L2_TUNER_MODE_MONO;
----------- msp->nicam_on = 0;
----------- msp->watch_stereo = 1;
----------- break;
----------- }
-----------
----------- /* unmute, restore misc registers */
----------- msp3400c_setbass(client, msp->bass);
----------- msp3400c_settreble(client, msp->treble);
----------- msp3400c_setvolume(client, msp->muted, msp->left, msp->right);
----------- msp3400c_write(client, I2C_MSP3400C_DFP, 0x13, msp->acb);
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x40, msp->i2s_mode);
----------- msp3400c_restore_dfp(client);
-----------
----------- /* monitor tv audio mode */
----------- while (msp->watch_stereo) {
----------- if (msp34xx_sleep(msp,5000))
----------- goto restart;
----------- watch_stereo(client);
----------- }
----------- }
----------- msp3400_dbg("thread: exit\n");
----------- return 0;
-----------}
-----------
-----------/* ----------------------------------------------------------------------- */
-----------/* msp34xxG + (simpler no-thread) */
-----------/* this one uses both automatic standard detection and automatic sound */
-----------/* select which are available in the newer G versions */
-----------/* struct msp: only norm, acb and source are really used in this mode */
-----------
-----------static void msp34xxg_set_source(struct i2c_client *client, int source);
-----------
-----------/* (re-)initialize the msp34xxg, according to the current norm in msp->norm
----------- * return 0 if it worked, -1 if it failed
----------- */
-----------static int msp34xxg_reset(struct i2c_client *client)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
----------- int modus,std;
-----------
----------- if (msp3400c_reset(client))
----------- return -1;
-----------
----------- /* make sure that input/output is muted (paranoid mode) */
----------- if (msp3400c_write(client,
----------- I2C_MSP3400C_DFP,
----------- 0x13, /* ACB */
----------- 0x0f20 /* mute DSP input, mute SCART 1 */))
----------- return -1;
-----------
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x40, msp->i2s_mode);
-----------
----------- /* step-by-step initialisation, as described in the manual */
----------- modus = msp34xx_modus(client, msp->norm);
----------- std = msp34xx_standard(msp->norm);
----------- modus &= ~0x03; /* STATUS_CHANGE=0 */
----------- modus |= 0x01; /* AUTOMATIC_SOUND_DETECTION=1 */
----------- if (msp3400c_write(client,
----------- I2C_MSP3400C_DEM,
----------- 0x30/*MODUS*/,
----------- modus))
----------- return -1;
----------- if (msp3400c_write(client,
----------- I2C_MSP3400C_DEM,
----------- 0x20/*standard*/,
----------- std))
----------- return -1;
-----------
----------- /* write the dfps that may have an influence on
----------- standard/audio autodetection right now */
----------- msp34xxg_set_source(client, msp->source);
-----------
----------- if (msp3400c_write_dfp_with_default(client, 0x0e, /* AM/FM Prescale */
----------- 0x3000
----------- /* default: [15:8] 75khz deviation */
----------- ))
----------- return -1;
-----------
----------- if (msp3400c_write_dfp_with_default(client, 0x10, /* NICAM Prescale */
----------- 0x5a00
----------- /* default: 9db gain (as recommended) */
----------- ))
----------- return -1;
-----------
----------- return 0;
-----------}
-----------
-----------static int msp34xxg_thread(void *data)
-----------{
----------- struct i2c_client *client = data;
----------- struct msp3400c *msp = i2c_get_clientdata(client);
----------- int val, std, i;
-----------
----------- msp3400_info("msp34xxg daemon started\n");
-- - ----
----------- msp->source = 1; /* default */
----------- for (;;) {
----------- msp3400_dbg_mediumvol("msp34xxg thread: sleep\n");
----------- msp34xx_sleep(msp,-1);
----------- msp3400_dbg_mediumvol("msp34xxg thread: wakeup\n");
-----------
----------- restart:
----------- msp3400_dbg("thread: restart scan\n");
----------- msp->restart = 0;
----------- if (kthread_should_stop())
----------- break;
-----------
----------- /* setup the chip*/
----------- msp34xxg_reset(client);
----------- std = standard;
----------- if (std != 0x01)
----------- goto unmute;
-----------
----------- /* watch autodetect */
----------- msp3400_dbg("triggered autodetect, waiting for result\n");
----------- for (i = 0; i < 10; i++) {
----------- if (msp34xx_sleep(msp,100))
----------- goto restart;
-----------
----------- /* check results */
----------- val = msp3400c_read(client, I2C_MSP3400C_DEM, 0x7e);
----------- if (val < 0x07ff) {
----------- std = val;
----------- break;
----------- }
----------- msp3400_dbg("detection still in progress\n");
----------- }
----------- if (0x01 == std) {
----------- msp3400_dbg("detection still in progress after 10 tries. giving up.\n");
----------- continue;
----------- }
-----------
----------- unmute:
----------- msp3400_dbg("current mode: %s (0x%04x)\n",
----------- msp34xx_standard_mode_name(std), std);
-----------
----------- /* unmute: dispatch sound to scart output, set scart volume */
----------- msp3400_dbg("unmute\n");
-----------
----------- msp3400c_setbass(client, msp->bass);
----------- msp3400c_settreble(client, msp->treble);
----------- msp3400c_setvolume(client, msp->muted, msp->left, msp->right);
-----------
----------- /* restore ACB */
----------- if (msp3400c_write(client,
----------- I2C_MSP3400C_DFP,
----------- 0x13, /* ACB */
----------- msp->acb))
----------- return -1;
-----------
----------- msp3400c_write(client,I2C_MSP3400C_DEM, 0x40, msp->i2s_mode);
----------- }
----------- msp3400_dbg("thread: exit\n");
----------- return 0;
-----------}
-----------
-----------/* set the same 'source' for the loudspeaker, scart and quasi-peak detector
----------- * the value for source is the same as bit 15:8 of DFP registers 0x08,
----------- * 0x0a and 0x0c: 0=mono, 1=stereo or A|B, 2=SCART, 3=stereo or A, 4=stereo or B
----------- *
----------- * this function replaces msp3400c_setstereo
----------- */
-----------static void msp34xxg_set_source(struct i2c_client *client, int source)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
-----------
----------- /* fix matrix mode to stereo and let the msp choose what
----------- * to output according to 'source', as recommended
----------- * for MONO (source==0) downmixing set bit[7:0] to 0x30
----------- */
----------- int value = (source&0x07)<<8|(source==0 ? 0x30:0x20);
----------- msp3400_dbg("set source to %d (0x%x)\n", source, value);
----------- msp3400c_write(client,
----------- I2C_MSP3400C_DFP,
----------- 0x08, /* Loudspeaker Output */
----------- value);
----------- msp3400c_write(client,
----------- I2C_MSP3400C_DFP,
----------- 0x0a, /* SCART1 DA Output */
----------- value);
----------- msp3400c_write(client,
----------- I2C_MSP3400C_DFP,
----------- 0x0c, /* Quasi-peak detector */
----------- value);
----------- /*
----------- * set identification threshold. Personally, I
----------- * I set it to a higher value that the default
----------- * of 0x190 to ignore noisy stereo signals.
----------- * this needs tuning. (recommended range 0x00a0-0x03c0)
----------- * 0x7f0 = forced mono mode
----------- */
----------- msp3400c_write(client,
----------- I2C_MSP3400C_DEM,
----------- 0x22, /* a2 threshold for stereo/bilingual */
----------- stereo_threshold);
----------- msp->source=source;
-----------}
-----------
-----------static void msp34xxg_detect_stereo(struct i2c_client *client)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
-----------
----------- int status = msp3400c_read(client,
----------- I2C_MSP3400C_DEM,
----------- 0x0200 /* STATUS */);
----------- int is_bilingual = status&0x100;
----------- int is_stereo = status&0x40;
-----------
----------- msp->rxsubchans = 0;
----------- if (is_stereo)
----------- msp->rxsubchans |= V4L2_TUNER_SUB_STEREO;
----------- else
----------- msp->rxsubchans |= V4L2_TUNER_SUB_MONO;
----------- if (is_bilingual) {
----------- msp->rxsubchans |= V4L2_TUNER_SUB_LANG1|V4L2_TUNER_SUB_LANG2;
----------- /* I'm supposed to check whether it's SAP or not
----------- * and set only LANG2/SAP in this case. Yet, the MSP
----------- * does a lot of work to hide this and handle everything
----------- * the same way. I don't want to work around it so unless
----------- * this is a problem, I'll handle SAP just like lang1/lang2.
----------- */
----------- }
----------- msp3400_dbg("status=0x%x, stereo=%d, bilingual=%d -> rxsubchans=%d\n",
----------- status, is_stereo, is_bilingual, msp->rxsubchans);
-----------}
-----------
-----------static void msp34xxg_set_audmode(struct i2c_client *client, int audmode)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
----------- int source;
-----------
----------- switch (audmode) {
----------- case V4L2_TUNER_MODE_MONO:
----------- source=0; /* mono only */
----------- break;
----------- case V4L2_TUNER_MODE_STEREO:
----------- source=1; /* stereo or A|B, see comment in msp34xxg_get_v4l2_stereo() */
----------- /* problem: that could also mean 2 (scart input) */
----------- break;
----------- case V4L2_TUNER_MODE_LANG1:
----------- source=3; /* stereo or A */
----------- break;
----------- case V4L2_TUNER_MODE_LANG2:
----------- source=4; /* stereo or B */
----------- break;
----------- default:
----------- audmode = 0;
----------- source = 1;
----------- break;
----------- }
----------- msp->audmode = audmode;
----------- msp34xxg_set_source(client, source);
-----------}
-----------
-----------
-----------/* ----------------------------------------------------------------------- */
-----------
-----------static int msp_attach(struct i2c_adapter *adap, int addr, int kind);
-----------static int msp_detach(struct i2c_client *client);
-----------static int msp_probe(struct i2c_adapter *adap);
-----------static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg);
-----------
-----------static int msp_suspend(struct device * dev, pm_message_t state);
-----------static int msp_resume(struct device * dev);
-----------
-----------static void msp_wake_thread(struct i2c_client *client);
-----------
-----------static struct i2c_driver driver = {
------ - .owner = THIS_MODULE,
------ - .name = "msp3400",
-- - ---- .id = I2C_DRIVERID_MSP3400,
- - - .flags = I2C_DF_NOTIFY,
-- - ---- .attach_adapter = msp_probe,
-- - ---- .detach_client = msp_detach,
-- - ---- .command = msp_command,
- --- .id = I2C_DRIVERID_MSP3400,
- --- .flags = I2C_DF_NOTIFY,
- --- .attach_adapter = msp_probe,
- --- .detach_client = msp_detach,
- --- .command = msp_command,
----------- .driver = {
- - -- .name = "i2c msp3400 driver",
----------- .suspend = msp_suspend,
----------- .resume = msp_resume,
----------- },
-----------};
-----------
-----------static struct i2c_client client_template =
-----------{
----------- .name = "(unset)",
------ - .flags = I2C_CLIENT_ALLOW_USE,
-- - ---- .driver = &driver,
- --- .driver = &driver,
-----------};
-----------
-----------static int msp_attach(struct i2c_adapter *adap, int addr, int kind)
-----------{
----------- struct msp3400c *msp;
----------- struct i2c_client *client = &client_template;
----------- int (*thread_func)(void *data) = NULL;
----------- int i;
-----------
----------- client_template.adapter = adap;
----------- client_template.addr = addr;
-----------
----------- if (-1 == msp3400c_reset(&client_template)) {
----------- msp3400_dbg("no chip found\n");
----------- return -1;
----------- }
-----------
----------- if (NULL == (client = kmalloc(sizeof(struct i2c_client),GFP_KERNEL)))
----------- return -ENOMEM;
----------- memcpy(client,&client_template,sizeof(struct i2c_client));
----------- if (NULL == (msp = kmalloc(sizeof(struct msp3400c),GFP_KERNEL))) {
----------- kfree(client);
----------- return -ENOMEM;
----------- }
-----------
----------- memset(msp,0,sizeof(struct msp3400c));
----------- msp->norm = VIDEO_MODE_NTSC;
----------- msp->left = 58880; /* 0db gain */
----------- msp->right = 58880; /* 0db gain */
----------- msp->bass = 32768;
----------- msp->treble = 32768;
----------- msp->input = -1;
----------- msp->muted = 0;
----------- msp->i2s_mode = 0;
----------- for (i = 0; i < DFP_COUNT; i++)
----------- msp->dfp_regs[i] = -1;
-----------
----------- i2c_set_clientdata(client, msp);
----------- init_waitqueue_head(&msp->wq);
-----------
----------- if (-1 == msp3400c_reset(client)) {
----------- kfree(msp);
----------- kfree(client);
----------- msp3400_dbg("no chip found\n");
----------- return -1;
----------- }
-----------
----------- msp->rev1 = msp3400c_read(client, I2C_MSP3400C_DFP, 0x1e);
----------- if (-1 != msp->rev1)
----------- msp->rev2 = msp3400c_read(client, I2C_MSP3400C_DFP, 0x1f);
----------- if ((-1 == msp->rev1) || (0 == msp->rev1 && 0 == msp->rev2)) {
----------- kfree(msp);
----------- kfree(client);
----------- msp3400_dbg("error while reading chip version\n");
----------- return -1;
----------- }
----------- msp3400_dbg("rev1=0x%04x, rev2=0x%04x\n", msp->rev1, msp->rev2);
-----------
----------- msp3400c_setvolume(client, msp->muted, msp->left, msp->right);
-----------
----------- snprintf(client->name, sizeof(client->name), "MSP%c4%02d%c-%c%d",
----------- ((msp->rev1>>4)&0x0f) + '3',
----------- (msp->rev2>>8)&0xff, (msp->rev1&0x0f)+'@',
----------- ((msp->rev1>>8)&0xff)+'@', msp->rev2&0x1f);
-----------
----------- msp->opmode = opmode;
----------- if (OPMODE_AUTO == msp->opmode) {
----------- if (HAVE_SIMPLER(msp))
----------- msp->opmode = OPMODE_SIMPLER;
----------- else if (HAVE_SIMPLE(msp))
----------- msp->opmode = OPMODE_SIMPLE;
----------- else
----------- msp->opmode = OPMODE_MANUAL;
----------- }
-----------
----------- /* hello world :-) */
----------- msp3400_info("chip=%s", client->name);
----------- if (HAVE_NICAM(msp))
----------- printk(" +nicam");
----------- if (HAVE_SIMPLE(msp))
----------- printk(" +simple");
----------- if (HAVE_SIMPLER(msp))
----------- printk(" +simpler");
----------- if (HAVE_RADIO(msp))
----------- printk(" +radio");
-----------
----------- /* version-specific initialization */
----------- switch (msp->opmode) {
----------- case OPMODE_MANUAL:
----------- printk(" mode=manual");
----------- thread_func = msp3400c_thread;
----------- break;
----------- case OPMODE_SIMPLE:
----------- printk(" mode=simple");
----------- thread_func = msp3410d_thread;
----------- break;
----------- case OPMODE_SIMPLER:
----------- printk(" mode=simpler");
----------- thread_func = msp34xxg_thread;
----------- break;
----------- }
----------- printk("\n");
-----------
----------- /* startup control thread if needed */
----------- if (thread_func) {
----------- msp->kthread = kthread_run(thread_func, client, "msp34xx");
-----------
----------- if (NULL == msp->kthread)
----------- msp3400_warn("kernel_thread() failed\n");
----------- msp_wake_thread(client);
----------- }
-----------
----------- /* done */
----------- i2c_attach_client(client);
-----------
----------- /* update our own array */
----------- for (i = 0; i < MSP3400_MAX; i++) {
----------- if (NULL == msps[i]) {
----------- msps[i] = client;
----------- break;
----------- }
----------- }
-----------
----------- return 0;
-----------}
-----------
-----------static int msp_detach(struct i2c_client *client)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
----------- int i;
-----------
----------- /* shutdown control thread */
----------- if (msp->kthread) {
----------- msp->restart = 1;
----------- kthread_stop(msp->kthread);
----------- }
----------- msp3400c_reset(client);
-----------
----------- /* update our own array */
----------- for (i = 0; i < MSP3400_MAX; i++) {
----------- if (client == msps[i]) {
----------- msps[i] = NULL;
----------- break;
----------- }
----------- }
-----------
----------- i2c_detach_client(client);
-----------
----------- kfree(msp);
----------- kfree(client);
----------- return 0;
-----------}
-----------
-----------static int msp_probe(struct i2c_adapter *adap)
-----------{
----------- if (adap->class & I2C_CLASS_TV_ANALOG)
----------- return i2c_probe(adap, &addr_data, msp_attach);
----------- return 0;
-----------}
-----------
-----------static void msp_wake_thread(struct i2c_client *client)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
-----------
----------- if (NULL == msp->kthread)
----------- return;
----------- msp3400c_setvolume(client,msp->muted,0,0);
----------- msp->watch_stereo = 0;
----------- msp->restart = 1;
----------- wake_up_interruptible(&msp->wq);
-----------}
-----------
-----------/* ----------------------------------------------------------------------- */
-----------
-----------static int mode_v4l2_to_v4l1(int rxsubchans)
-----------{
----------- int mode = 0;
-----------
----------- if (rxsubchans & V4L2_TUNER_SUB_STEREO)
----------- mode |= VIDEO_SOUND_STEREO;
----------- if (rxsubchans & V4L2_TUNER_SUB_LANG2)
----------- mode |= VIDEO_SOUND_LANG2;
----------- if (rxsubchans & V4L2_TUNER_SUB_LANG1)
----------- mode |= VIDEO_SOUND_LANG1;
----------- if (0 == mode)
----------- mode |= VIDEO_SOUND_MONO;
----------- return mode;
-----------}
-----------
-----------static int mode_v4l1_to_v4l2(int mode)
-----------{
----------- if (mode & VIDEO_SOUND_STEREO)
----------- return V4L2_TUNER_MODE_STEREO;
----------- if (mode & VIDEO_SOUND_LANG2)
----------- return V4L2_TUNER_MODE_LANG2;
----------- if (mode & VIDEO_SOUND_LANG1)
----------- return V4L2_TUNER_MODE_LANG1;
----------- return V4L2_TUNER_MODE_MONO;
-----------}
-----------
-----------static void msp_any_detect_stereo(struct i2c_client *client)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
-----------
----------- switch (msp->opmode) {
----------- case OPMODE_MANUAL:
----------- case OPMODE_SIMPLE:
----------- autodetect_stereo(client);
----------- break;
----------- case OPMODE_SIMPLER:
----------- msp34xxg_detect_stereo(client);
----------- break;
----------- }
-----------}
-----------
-----------static void msp_any_set_audmode(struct i2c_client *client, int audmode)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
-----------
----------- switch (msp->opmode) {
----------- case OPMODE_MANUAL:
----------- case OPMODE_SIMPLE:
----------- msp->watch_stereo = 0;
----------- msp3400c_setstereo(client, audmode);
----------- break;
----------- case OPMODE_SIMPLER:
----------- msp34xxg_set_audmode(client, audmode);
----------- break;
----------- }
-----------}
-----------
-----------
-----------static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg)
-----------{
----------- struct msp3400c *msp = i2c_get_clientdata(client);
----------- __u16 *sarg = arg;
----------- int scart = 0;
-----------
----------- switch (cmd) {
-----------
----------- case AUDC_SET_INPUT:
----------- msp3400_dbg("AUDC_SET_INPUT(%d)\n",*sarg);
-----------
----------- if (*sarg == msp->input)
----------- break;
----------- msp->input = *sarg;
----------- switch (*sarg) {
----------- case AUDIO_RADIO:
----------- /* Hauppauge uses IN2 for the radio */
----------- msp->mode = MSP_MODE_FM_RADIO;
----------- scart = SCART_IN2;
----------- break;
----------- case AUDIO_EXTERN_1:
----------- /* IN1 is often used for external input ... */
----------- msp->mode = MSP_MODE_EXTERN;
----------- scart = SCART_IN1;
----------- break;
----------- case AUDIO_EXTERN_2:
----------- /* ... sometimes it is IN2 through ;) */
----------- msp->mode = MSP_MODE_EXTERN;
----------- scart = SCART_IN2;
----------- break;
----------- case AUDIO_TUNER:
----------- msp->mode = -1;
----------- break;
----------- default:
----------- if (*sarg & AUDIO_MUTE)
----------- msp3400c_set_scart(client,SCART_MUTE,0);
----------- break;
----------- }
----------- if (scart) {
----------- msp->rxsubchans = V4L2_TUNER_SUB_STEREO;
----------- msp->audmode = V4L2_TUNER_MODE_STEREO;
----------- msp3400c_set_scart(client,scart,0);
----------- msp3400c_write(client,I2C_MSP3400C_DFP,0x000d,0x1900);
----------- if (msp->opmode != OPMODE_SIMPLER)
----------- msp3400c_setstereo(client, msp->audmode);
----------- }
----------- msp_wake_thread(client);
----------- break;
-----------
----------- case AUDC_SET_RADIO:
----------- msp3400_dbg("AUDC_SET_RADIO\n");
----------- msp->norm = VIDEO_MODE_RADIO;
----------- msp3400_dbg("switching to radio mode\n");
----------- msp->watch_stereo = 0;
----------- switch (msp->opmode) {
----------- case OPMODE_MANUAL:
----------- /* set msp3400 to FM radio mode */
----------- msp3400c_setmode(client,MSP_MODE_FM_RADIO);
----------- msp3400c_setcarrier(client, MSP_CARRIER(10.7),
----------- MSP_CARRIER(10.7));
----------- msp3400c_setvolume(client, msp->muted, msp->left, msp->right);
----------- break;
----------- case OPMODE_SIMPLE:
----------- case OPMODE_SIMPLER:
----------- /* the thread will do for us */
----------- msp_wake_thread(client);
----------- break;
----------- }
----------- break;
----------- /* work-in-progress: hook to control the DFP registers */
----------- case MSP_SET_DFPREG:
----------- {
----------- struct msp_dfpreg *r = arg;
----------- int i;
-----------
----------- if (r->reg < 0 || r->reg >= DFP_COUNT)
----------- return -EINVAL;
----------- for (i = 0; i < sizeof(bl_dfp) / sizeof(int); i++)
----------- if (r->reg == bl_dfp[i])
----------- return -EINVAL;
----------- msp->dfp_regs[r->reg] = r->value;
----------- msp3400c_write(client, I2C_MSP3400C_DFP, r->reg, r->value);
----------- return 0;
----------- }
----------- case MSP_GET_DFPREG:
----------- {
----------- struct msp_dfpreg *r = arg;
-----------
----------- if (r->reg < 0 || r->reg >= DFP_COUNT)
----------- return -EINVAL;
----------- r->value = msp3400c_read(client, I2C_MSP3400C_DFP, r->reg);
----------- return 0;
----------- }
-----------
----------- /* --- v4l ioctls --- */
----------- /* take care: bttv does userspace copying, we'll get a
----------- kernel pointer here... */
----------- case VIDIOCGAUDIO:
----------- {
----------- struct video_audio *va = arg;
-----------
----------- msp3400_dbg("VIDIOCGAUDIO\n");
----------- va->flags |= VIDEO_AUDIO_VOLUME |
----------- VIDEO_AUDIO_BASS |
----------- VIDEO_AUDIO_TREBLE |
----------- VIDEO_AUDIO_MUTABLE;
----------- if (msp->muted)
----------- va->flags |= VIDEO_AUDIO_MUTE;
-----------
----------- if (msp->muted)
----------- va->flags |= VIDEO_AUDIO_MUTE;
----------- va->volume = MAX(msp->left, msp->right);
----------- va->balance = (32768 * MIN(msp->left, msp->right)) /
----------- (va->volume ? va->volume : 1);
----------- va->balance = (msp->left < msp->right) ?
----------- (65535 - va->balance) : va->balance;
----------- if (0 == va->volume)
----------- va->balance = 32768;
----------- va->bass = msp->bass;
----------- va->treble = msp->treble;
-----------
----------- msp_any_detect_stereo(client);
----------- va->mode = mode_v4l2_to_v4l1(msp->rxsubchans);
----------- break;
----------- }
----------- case VIDIOCSAUDIO:
----------- {
----------- struct video_audio *va = arg;
-----------
----------- msp3400_dbg("VIDIOCSAUDIO\n");
----------- msp->muted = (va->flags & VIDEO_AUDIO_MUTE);
----------- msp->left = (MIN(65536 - va->balance, 32768) *
----------- va->volume) / 32768;
----------- msp->right = (MIN(va->balance, 32768) * va->volume) / 32768;
----------- msp->bass = va->bass;
----------- msp->treble = va->treble;
----------- msp3400_dbg("VIDIOCSAUDIO setting va->volume to %d\n",
----------- va->volume);
----------- msp3400_dbg("VIDIOCSAUDIO setting va->balance to %d\n",
----------- va->balance);
----------- msp3400_dbg("VIDIOCSAUDIO setting va->flags to %d\n",
----------- va->flags);
----------- msp3400_dbg("VIDIOCSAUDIO setting msp->left to %d\n",
----------- msp->left);
----------- msp3400_dbg("VIDIOCSAUDIO setting msp->right to %d\n",
----------- msp->right);
----------- msp3400_dbg("VIDIOCSAUDIO setting msp->bass to %d\n",
----------- msp->bass);
----------- msp3400_dbg("VIDIOCSAUDIO setting msp->treble to %d\n",
----------- msp->treble);
----------- msp3400_dbg("VIDIOCSAUDIO setting msp->mode to %d\n",
----------- msp->mode);
----------- msp3400c_setvolume(client, msp->muted, msp->left, msp->right);
----------- msp3400c_setbass(client, msp->bass);
----------- msp3400c_settreble(client, msp->treble);
-----------
----------- if (va->mode != 0 && msp->norm != VIDEO_MODE_RADIO)
----------- msp_any_set_audmode(client,mode_v4l1_to_v4l2(va->mode));
----------- break;
----------- }
-----------
----------- case VIDIOCSCHAN:
----------- {
----------- struct video_channel *vc = arg;
-----------
----------- msp3400_dbg("VIDIOCSCHAN (norm=%d)\n",vc->norm);
----------- msp->norm = vc->norm;
----------- msp_wake_thread(client);
----------- break;
----------- }
-----------
----------- case VIDIOCSFREQ:
----------- case VIDIOC_S_FREQUENCY:
----------- {
----------- /* new channel -- kick audio carrier scan */
----------- msp3400_dbg("VIDIOCSFREQ\n");
----------- msp_wake_thread(client);
----------- break;
----------- }
-----------
----------- /* msp34xx specific */
----------- case MSP_SET_MATRIX:
----------- {
----------- struct msp_matrix *mspm = arg;
-----------
----------- msp3400_dbg("MSP_SET_MATRIX\n");
----------- msp3400c_set_scart(client, mspm->input, mspm->output);
----------- break;
----------- }
-----------
----------- /* --- v4l2 ioctls --- */
----------- case VIDIOC_S_STD:
----------- {
----------- v4l2_std_id *id = arg;
-----------
----------- /*FIXME: use V4L2 mode flags on msp3400 instead of V4L1*/
----------- if (*id & V4L2_STD_PAL) {
----------- msp->norm=VIDEO_MODE_PAL;
----------- } else if (*id & V4L2_STD_SECAM) {
----------- msp->norm=VIDEO_MODE_SECAM;
----------- } else {
----------- msp->norm=VIDEO_MODE_NTSC;
----------- }
-----------
----------- msp_wake_thread(client);
----------- return 0;
----------- }
-----------
----------- case VIDIOC_ENUMINPUT:
----------- {
----------- struct v4l2_input *i = arg;
-----------
----------- if (i->index != 0)
----------- return -EINVAL;
-----------
----------- i->type = V4L2_INPUT_TYPE_TUNER;
----------- switch (i->index) {
----------- case AUDIO_RADIO:
----------- strcpy(i->name,"Radio");
----------- break;
----------- case AUDIO_EXTERN_1:
----------- strcpy(i->name,"Extern 1");
----------- break;
----------- case AUDIO_EXTERN_2:
----------- strcpy(i->name,"Extern 2");
----------- break;
----------- case AUDIO_TUNER:
----------- strcpy(i->name,"Television");
----------- break;
----------- default:
----------- return -EINVAL;
----------- }
----------- return 0;
----------- }
-----------
----------- case VIDIOC_G_AUDIO:
----------- {
----------- struct v4l2_audio *a = arg;
-----------
----------- memset(a,0,sizeof(*a));
-----------
----------- switch (a->index) {
----------- case AUDIO_RADIO:
----------- strcpy(a->name,"Radio");
----------- break;
----------- case AUDIO_EXTERN_1:
----------- strcpy(a->name,"Extern 1");
----------- break;
----------- case AUDIO_EXTERN_2:
----------- strcpy(a->name,"Extern 2");
----------- break;
----------- case AUDIO_TUNER:
----------- strcpy(a->name,"Television");
----------- break;
----------- default:
----------- return -EINVAL;
----------- }
-----------
----------- msp_any_detect_stereo(client);
----------- if (msp->audmode == V4L2_TUNER_MODE_STEREO) {
----------- a->capability=V4L2_AUDCAP_STEREO;
----------- }
-----------
----------- break;
----------- }
----------- case VIDIOC_S_AUDIO:
----------- {
----------- struct v4l2_audio *sarg = arg;
-----------
----------- switch (sarg->index) {
----------- case AUDIO_RADIO:
----------- /* Hauppauge uses IN2 for the radio */
----------- msp->mode = MSP_MODE_FM_RADIO;
----------- scart = SCART_IN2;
----------- break;
----------- case AUDIO_EXTERN_1:
----------- /* IN1 is often used for external input ... */
----------- msp->mode = MSP_MODE_EXTERN;
----------- scart = SCART_IN1;
----------- break;
----------- case AUDIO_EXTERN_2:
----------- /* ... sometimes it is IN2 through ;) */
----------- msp->mode = MSP_MODE_EXTERN;
----------- scart = SCART_IN2;
----------- break;
----------- case AUDIO_TUNER:
----------- msp->mode = -1;
----------- break;
----------- }
----------- if (scart) {
----------- msp->rxsubchans = V4L2_TUNER_SUB_STEREO;
----------- msp->audmode = V4L2_TUNER_MODE_STEREO;
----------- msp3400c_set_scart(client,scart,0);
----------- msp3400c_write(client,I2C_MSP3400C_DFP,0x000d,0x1900);
----------- }
----------- if (sarg->capability==V4L2_AUDCAP_STEREO) {
----------- msp->audmode = V4L2_TUNER_MODE_STEREO;
----------- } else {
----------- msp->audmode &= ~V4L2_TUNER_MODE_STEREO;
----------- }
----------- msp_any_set_audmode(client, msp->audmode);
----------- msp_wake_thread(client);
----------- break;
----------- }
----------- case VIDIOC_G_TUNER:
----------- {
----------- struct v4l2_tuner *vt = arg;
-----------
----------- msp_any_detect_stereo(client);
----------- vt->audmode = msp->audmode;
----------- vt->rxsubchans = msp->rxsubchans;
----------- vt->capability = V4L2_TUNER_CAP_STEREO |
----------- V4L2_TUNER_CAP_LANG1|
----------- V4L2_TUNER_CAP_LANG2;
----------- break;
----------- }
----------- case VIDIOC_S_TUNER:
----------- {
----------- struct v4l2_tuner *vt=(struct v4l2_tuner *)arg;
-----------
----------- /* only set audmode */
----------- if (vt->audmode != -1 && vt->audmode != 0)
----------- msp_any_set_audmode(client, vt->audmode);
----------- break;
----------- }
-----------
----------- case VIDIOC_G_AUDOUT:
----------- {
----------- struct v4l2_audioout *a=(struct v4l2_audioout *)arg;
----------- int idx=a->index;
-----------
----------- memset(a,0,sizeof(*a));
-----------
----------- switch (idx) {
----------- case 0:
----------- strcpy(a->name,"Scart1 Out");
----------- break;
----------- case 1:
----------- strcpy(a->name,"Scart2 Out");
----------- break;
----------- case 2:
----------- strcpy(a->name,"I2S Out");
----------- break;
----------- default:
----------- return -EINVAL;
----------- }
----------- break;
-----------
----------- }
----------- case VIDIOC_S_AUDOUT:
----------- {
----------- struct v4l2_audioout *a=(struct v4l2_audioout *)arg;
-----------
----------- if (a->index<0||a->index>2)
----------- return -EINVAL;
-----------
----------- if (a->index==2) {
----------- if (a->mode == V4L2_AUDMODE_32BITS)
----------- msp->i2s_mode=1;
----------- else
----------- msp->i2s_mode=0;
----------- }
----------- msp3400_dbg("Setting audio out on msp34xx to input %i, mode %i\n",
----------- a->index,msp->i2s_mode);
----------- msp3400c_set_scart(client,msp->in_scart,a->index+1);
-----------
----------- break;
----------- }
-----------
----------- default:
----------- /* nothing */
----------- break;
----------- }
----------- return 0;
-----------}
-----------
-----------static int msp_suspend(struct device * dev, pm_message_t state)
-----------{
----------- struct i2c_client *client = container_of(dev, struct i2c_client, dev);
-----------
----------- msp3400_dbg("msp34xx: suspend\n");
----------- msp3400c_reset(client);
----------- return 0;
-----------}
-----------
-----------static int msp_resume(struct device * dev)
-----------{
----------- struct i2c_client *client = container_of(dev, struct i2c_client, dev);
-----------
----------- msp3400_dbg("msp34xx: resume\n");
----------- msp_wake_thread(client);
----------- return 0;
-----------}
-----------
-----------/* ----------------------------------------------------------------------- */
-----------
-----------static int __init msp3400_init_module(void)
-----------{
----------- return i2c_add_driver(&driver);
-----------}
-----------
-----------static void __exit msp3400_cleanup_module(void)
-----------{
----------- i2c_del_driver(&driver);
-----------}
-----------
-----------module_init(msp3400_init_module);
-----------module_exit(msp3400_cleanup_module);
-----------
-----------/*
----------- * Overrides for Emacs so that we follow Linus's tabbing style.
----------- * ---------------------------------------------------------------------------
----------- * Local variables:
----------- * c-basic-offset: 8
----------- * End:
----------- */
diff --cc drivers/media/video/saa6588.c
index d17395c,d60a783,9233225,dca3ddf,9233225,dca3ddf,dca3ddf,dca3ddf,d60a783,9233225,d60a783,d60a783..d17395c
--- a/drivers/media/video/saa6588.c
+++ b/drivers/media/video/saa6588.c
@@@@@@@@@@@@@ -485,10 -495,10 -495,10 -496,10 -495,10 -496,10 -496,10 -496,10 -495,10 -495,10 -495,10 -495,10 +485,10 @@@@@@@@@@@@@ static int saa6588_command(struct i2c_c
/* ----------------------------------------------------------------------- */
static struct i2c_driver driver = {
------ - .owner = THIS_MODULE,
------ - .name = "i2c saa6588 driver",
++++++ + .driver = {
- - -- .name = "i2c saa6588 driver",
+++++++++++ .name = "saa6588",
++++++ + },
.id = -1, /* FIXME */
------ - .flags = I2C_DF_NOTIFY,
.attach_adapter = saa6588_probe,
.detach_client = saa6588_detach,
.command = saa6588_command,
diff --cc drivers/media/video/saa7110.c
index 7bb85a7,619ff0b,e116bdb,e116bdb,e116bdb,e116bdb,e116bdb,e116bdb,619ff0b,e116bdb,619ff0b,619ff0b..7bb85a7
--- a/drivers/media/video/saa7110.c
+++ b/drivers/media/video/saa7110.c
@@@@@@@@@@@@@ -500,9 -500,10 -500,11 -500,11 -500,11 -500,11 -500,11 -500,11 -500,10 -500,11 -500,10 -500,10 +500,9 @@@@@@@@@@@@@ saa7110_detect_client (struct i2c_adapt
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver_saa7110;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client)));
----------- decoder = kmalloc(sizeof(struct saa7110), GFP_KERNEL);
+++++++++++ decoder = kzalloc(sizeof(struct saa7110), GFP_KERNEL);
if (decoder == 0) {
kfree(client);
return -ENOMEM;
diff --cc drivers/media/video/saa7111.c
index 8c06592,acaeee5,fe8a5e4,fe8a5e4,fe8a5e4,fe8a5e4,fe8a5e4,fe8a5e4,acaeee5,fe8a5e4,acaeee5,acaeee5..8c06592
--- a/drivers/media/video/saa7111.c
+++ b/drivers/media/video/saa7111.c
@@@@@@@@@@@@@ -517,9 -517,10 -517,11 -517,11 -517,11 -517,11 -517,11 -517,11 -517,10 -517,11 -517,10 -517,10 +517,9 @@@@@@@@@@@@@ saa7111_detect_client (struct i2c_adapt
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver_saa7111;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
strlcpy(I2C_NAME(client), "saa7111", sizeof(I2C_NAME(client)));
----------- decoder = kmalloc(sizeof(struct saa7111), GFP_KERNEL);
+++++++++++ decoder = kzalloc(sizeof(struct saa7111), GFP_KERNEL);
if (decoder == NULL) {
kfree(client);
return -ENOMEM;
diff --cc drivers/media/video/saa7114.c
index fd0a4b4,b7ac012,d9f50e2,d9f50e2,d9f50e2,d9f50e2,d9f50e2,d9f50e2,b7ac012,d9f50e2,b7ac012,b7ac012..fd0a4b4
--- a/drivers/media/video/saa7114.c
+++ b/drivers/media/video/saa7114.c
@@@@@@@@@@@@@ -858,9 -858,10 -858,11 -858,11 -858,11 -858,11 -858,11 -858,11 -858,10 -858,11 -858,10 -858,10 +858,9 @@@@@@@@@@@@@ saa7114_detect_client (struct i2c_adapt
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver_saa7114;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
strlcpy(I2C_NAME(client), "saa7114", sizeof(I2C_NAME(client)));
----------- decoder = kmalloc(sizeof(struct saa7114), GFP_KERNEL);
+++++++++++ decoder = kzalloc(sizeof(struct saa7114), GFP_KERNEL);
if (decoder == NULL) {
kfree(client);
return -ENOMEM;
diff --cc drivers/media/video/saa7115.c
index 048d000,29e28c7,e717e30,0235cef,e717e30,0235cef,0235cef,0235cef,29e28c7,e717e30,29e28c7,29e28c7..048d000
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@@@@@@@@@@@@ -51,6 -49,21 -49,20 -49,20 -49,20 -49,20 -49,20 -49,20 -49,21 -49,20 -49,21 -49,21 +51,6 @@@@@@@@@@@@@ module_param(debug, bool, 0644)
MODULE_PARM_DESC(debug, "Debug level (0-1)");
-----------#define saa7115_dbg(fmt,arg...) \
----------- do { \
----------- if (debug) \
- - -- printk(KERN_INFO "%s debug %d-%04x: " fmt, \
- - -- client->driver->driver.name, \
------ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); \
----------- } while (0)
-----------
-----------#define saa7115_err(fmt, arg...) do { \
- - -- printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------#define saa7115_info(fmt, arg...) do { \
- - -- printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------
static unsigned short normal_i2c[] = { 0x42 >> 1, 0x40 >> 1, I2C_CLIENT_END };
@@@@@@@@@@@@@ -697,12 -772,19 -771,19 -771,17 -771,19 -771,17 -771,17 -771,17 -772,19 -771,19 -772,19 -772,19 +697,12 @@@@@@@@@@@@@ static v4l2_std_id saa7115_get_v4lstd(s
static void saa7115_log_status(struct i2c_client *client)
{
- --- static const char * const audclk_freq_strs[] = {
- --- "44.1 kHz",
- --- "48 kHz",
- --- "32 kHz"
- --- };
struct saa7115_state *state = i2c_get_clientdata(client);
-- - ---- char *audfreq = "undefined";
int reg1e, reg1f;
int signalOk;
int vcr;
-- - ---- switch (state->audclk_freq) {
-- - ---- case V4L2_AUDCLK_32_KHZ: audfreq = "32 kHz"; break;
-- - ---- case V4L2_AUDCLK_441_KHZ: audfreq = "44.1 kHz"; break;
-- - ---- case V4L2_AUDCLK_48_KHZ: audfreq = "48 kHz"; break;
-- - ---- }
-- - ----
-- - ---- saa7115_info("Audio frequency: %s\n", audfreq);
- --- saa7115_info("Audio frequency: %s\n", audclk_freq_strs[state->audclk_freq]);
+++++++++++ v4l_info(client, "Audio frequency: %d Hz\n", state->audclk_freq);
if (client->name[6] == '4') {
/* status for the saa7114 */
reg1f = saa7115_read(client, 0x1f);
@@@@@@@@@@@@@ -1255,9 -1270,10 -1269,11 -1267,11 -1269,11 -1267,11 -1267,11 -1267,11 -1270,10 -1269,11 -1270,10 -1270,10 +1255,9 @@@@@@@@@@@@@ static int saa7115_attach(struct i2c_ad
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver_saa7115;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
snprintf(client->name, sizeof(client->name) - 1, "saa7115");
----------- saa7115_dbg("detecting saa7115 client on address 0x%x\n", address << 1);
+++++++++++ v4l_dbg(1, debug, client, "detecting saa7115 client on address 0x%x\n", address << 1);
saa7115_write(client, 0, 5);
chip_id = saa7115_read(client, 0) & 0x0f;
diff --cc drivers/media/video/saa711x.c
index 6c161f2,8008537,31f7b95,25b30f3,31f7b95,25b30f3,25b30f3,25b30f3,8008537,31f7b95,8008537,8008537..6c161f2
--- a/drivers/media/video/saa711x.c
+++ b/drivers/media/video/saa711x.c
@@@@@@@@@@@@@ -493,8 -493,9 -493,10 -493,10 -493,10 -493,10 -493,10 -493,10 -493,9 -493,10 -493,9 -493,9 +493,8 @@@@@@@@@@@@@ saa711x_detect_client (struct i2c_adapt
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver_saa711x;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
strlcpy(I2C_NAME(client), "saa711x", sizeof(I2C_NAME(client)));
----------- decoder = kmalloc(sizeof(struct saa711x), GFP_KERNEL);
+++++++++++ decoder = kzalloc(sizeof(struct saa711x), GFP_KERNEL);
if (decoder == NULL) {
kfree(client);
return -ENOMEM;
@@@@@@@@@@@@@ -562,10 -564,12 -565,12 -565,12 -565,12 -565,12 -565,12 -565,12 -564,12 -565,12 -564,12 -564,12 +562,10 @@@@@@@@@@@@@ saa711x_detach_client (struct i2c_clien
/* ----------------------------------------------------------------------- */
static struct i2c_driver i2c_driver_saa711x = {
------ - .owner = THIS_MODULE,
------ - .name = "saa711x",
------ -
++++++ + .driver = {
++++++ + .name = "saa711x",
++++++ + },
- - --
.id = I2C_DRIVERID_SAA711X,
------ - .flags = I2C_DF_NOTIFY,
-----------
.attach_adapter = saa711x_attach_adapter,
.detach_client = saa711x_detach_client,
.command = saa711x_command,
diff --cc drivers/media/video/saa7127.c
index 992c717,bca6ed0,3428e1e,843431f,c36f014,843431f,843431f,843431f,bca6ed0,c36f014,bca6ed0,bca6ed0..992c717
--- a/drivers/media/video/saa7127.c
+++ b/drivers/media/video/saa7127.c
@@@@@@@@@@@@@ -66,6 -66,30 -66,28 -66,28 -66,28 -66,28 -66,28 -66,28 -66,30 -66,28 -66,30 -66,30 +66,6 @@@@@@@@@@@@@ module_param(test_image, int, 0644)
MODULE_PARM_DESC(debug, "debug level (0-2)");
MODULE_PARM_DESC(test_image, "test_image (0-1)");
-----------#define saa7127_dbg(fmt, arg...) \
----------- do { \
----------- if (debug >= 1) \
- - -- printk(KERN_INFO "%s debug %d-%04x: " fmt, \
- - -- client->driver->driver.name, \
------ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); \
----------- } while (0)
-----------
-----------/* High volume debug. Use with care. */
-----------#define saa7127_dbg_highvol(fmt, arg...) \
----------- do { \
----------- if (debug == 2) \
- - -- printk(KERN_INFO "%s debug %d-%04x: " fmt, \
- - -- client->driver->driver.name, \
------ - printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); \
----------- } while (0)
-----------
-----------#define saa7127_err(fmt, arg...) do { \
- - -- printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------#define saa7127_info(fmt, arg...) do { \
- - -- printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------
static unsigned short normal_i2c[] = { 0x88 >> 1, I2C_CLIENT_END };
@@@@@@@@@@@@@ -373,9 -397,9 -395,9 -395,9 -395,9 -395,9 -395,9 -395,9 -397,9 -395,9 -397,9 -397,9 +373,9 @@@@@@@@@@@@@ static int saa7127_set_cc(struct i2c_cl
if (enable && (data->field != 0 || data->line != 21))
return -EINVAL;
if (state->cc_enable != enable) {
----------- saa7127_dbg("Turn CC %s\n", enable ? "on" : "off");
+++++++++++ v4l_dbg(1, debug, client, "Turn CC %s\n", enable ? "on" : "off");
saa7127_write(client, SAA7127_REG_CLOSED_CAPTION,
-- --- (enable << 6) | 0x11);
++ +++ (state->xds_enable << 7) | (enable << 6) | 0x11);
state->cc_enable = enable;
}
if (!enable)
@@@@@@@@@@@@@ -399,9 -423,9 -421,9 -421,9 -421,9 -421,9 -421,9 -421,9 -423,9 -421,9 -423,9 -423,9 +399,9 @@@@@@@@@@@@@ static int saa7127_set_xds(struct i2c_c
if (enable && (data->field != 1 || data->line != 21))
return -EINVAL;
if (state->xds_enable != enable) {
----------- saa7127_dbg("Turn XDS %s\n", enable ? "on" : "off");
+++++++++++ v4l_dbg(1, debug, client, "Turn XDS %s\n", enable ? "on" : "off");
saa7127_write(client, SAA7127_REG_CLOSED_CAPTION,
-- --- (enable << 7) | 0x11);
++ +++ (enable << 7) | (state->cc_enable << 6) | 0x11);
state->xds_enable = enable;
}
if (!enable)
@@@@@@@@@@@@@ -696,9 -720,10 -718,11 -718,11 -718,11 -718,11 -718,11 -718,11 -720,10 -718,11 -720,10 -720,10 +696,9 @@@@@@@@@@@@@ static int saa7127_attach(struct i2c_ad
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver_saa7127;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
snprintf(client->name, sizeof(client->name) - 1, "saa7127");
----------- saa7127_dbg("detecting saa7127 client on address 0x%x\n", address << 1);
+++++++++++ v4l_dbg(1, debug, client, "detecting saa7127 client on address 0x%x\n", address << 1);
/* First test register 0: Bits 5-7 are a version ID (should be 0),
and bit 2 should also be 0.
@@@@@@@@@@@@@ -789,11 -819,11 -818,10 -818,10 -818,10 -818,10 -818,10 -818,10 -819,11 -818,10 -819,11 -819,11 +789,11 @@@@@@@@@@@@@ static int saa7127_detach(struct i2c_cl
/* ----------------------------------------------------------------------- */
- --- struct i2c_driver i2c_driver_saa7127 = {
- --- .name = "saa7127",
+ +++ static struct i2c_driver i2c_driver_saa7127 = {
- - - .name = "saa7127",
++++++ + .driver = {
++++++ + .name = "saa7127",
++++++ + },
.id = I2C_DRIVERID_SAA7127,
------ - .flags = I2C_DF_NOTIFY,
.attach_adapter = saa7127_probe,
.detach_client = saa7127_detach,
.command = saa7127_command,
diff --cc drivers/media/video/saa7134/Kconfig
index 86671a4,8a5c3e7,c512c44,c512c44,8a5c3e7,c512c44,c512c44,c512c44,8a5c3e7,c0f604a,8a5c3e7,8a5c3e7..86671a4
--- a/drivers/media/video/saa7134/Kconfig
+++ b/drivers/media/video/saa7134/Kconfig
@@@@@@@@@@@@@ -12,29 -12,29 -13,6 -13,6 -12,29 -13,6 -13,6 -13,6 -12,29 -12,29 -12,29 -12,29 +12,29 @@@@@@@@@@@@@ config VIDEO_SAA713
To compile this driver as a module, choose M here: the
module will be called saa7134.
++ +++ config VIDEO_SAA7134_ALSA
++ +++ tristate "Philips SAA7134 DMA audio support"
- depends on VIDEO_SAA7134 && SOUND && SND && (!VIDEO_SAA7134_OSS || VIDEO_SAA7134_OSS = m)
- select SND_PCM_OSS
++ +++ + depends on VIDEO_SAA7134 && SND
- - - -- select SND_PCM_OSS
+++++++++++ select SND_PCM
++ +++ ---help---
++ +++ This is a video4linux driver for direct (DMA) audio in
++ +++ Philips SAA713x based TV cards using ALSA
++ +++
++ +++ To compile this driver as a module, choose M here: the
++ +++ module will be called saa7134-alsa.
++ +++
++ +++ config VIDEO_SAA7134_OSS
++ +++ tristate "Philips SAA7134 DMA audio support (OSS, DEPRECATED)"
- depends on VIDEO_SAA7134 && SOUND_PRIME && (!VIDEO_SAA7134_ALSA || VIDEO_SAA7134_ALSA = m)
++ +++ + depends on VIDEO_SAA7134 && SOUND_PRIME && !VIDEO_SAA7134_ALSA
++ +++ ---help---
++ +++ This is a video4linux driver for direct (DMA) audio in
++ +++ Philips SAA713x based TV cards using OSS
++ +++
++ +++ This is deprecated in favor of the ALSA module
++ +++
++ +++ To compile this driver as a module, choose M here: the
++ +++ module will be called saa7134-oss.
++ +++
config VIDEO_SAA7134_DVB
tristate "DVB/ATSC Support for saa7134 based TV cards"
depends on VIDEO_SAA7134 && DVB_CORE
diff --cc drivers/media/video/saa7134/saa6752hs.c
index 0e0ba50,4615a98,a61d24f,cdd1ed9,a61d24f,cdd1ed9,cdd1ed9,cdd1ed9,4615a98,a61d24f,4615a98,4615a98..0e0ba50
--- a/drivers/media/video/saa7134/saa6752hs.c
+++ b/drivers/media/video/saa7134/saa6752hs.c
@@@@@@@@@@@@@ -522,10 -523,8 -523,8 -523,7 -523,8 -523,7 -523,7 -523,7 -523,8 -523,8 -523,8 -523,8 +522,10 @@@@@@@@@@@@@ static int saa6752hs_attach(struct i2c_
h->standard = 0;
i2c_set_clientdata(&h->client, h);
- --- i2c_attach_client(&h->client);
+ +++ i2c_attach_client(&h->client);
+ +++
+++++++++++ v4l_info(&h->client,"saa6752hs: chip found @ 0x%x\n", addr<<1);
+++++++++++
return 0;
}
@@@@@@@@@@@@@ -598,19 -597,19 -597,20 -596,20 -597,20 -596,20 -596,20 -596,20 -597,19 -597,20 -597,19 -597,19 +598,19 @@@@@@@@@@@@@ saa6752hs_command(struct i2c_client *cl
/* ----------------------------------------------------------------------- */
static struct i2c_driver driver = {
------ - .owner = THIS_MODULE,
- - - .name = "i2c saa6752hs MPEG encoder",
- --- .name = "i2c saa6752hs MPEG encoder",
- --- .id = I2C_DRIVERID_SAA6752HS,
- --- .flags = I2C_DF_NOTIFY,
- --- .attach_adapter = saa6752hs_probe,
- --- .detach_client = saa6752hs_detach,
- --- .command = saa6752hs_command,
++++++ + .driver = {
- - -- .name = "i2c saa6752hs MPEG encoder",
+++++++++++ .name = "saa6752hs",
++++++ + },
+ +++ .id = I2C_DRIVERID_SAA6752HS,
- - - .flags = I2C_DF_NOTIFY,
+ +++ .attach_adapter = saa6752hs_probe,
+ +++ .detach_client = saa6752hs_detach,
+ +++ .command = saa6752hs_command,
};
static struct i2c_client client_template =
{
.name = "saa6752hs",
------ - .flags = I2C_CLIENT_ALLOW_USE,
- --- .driver = &driver,
+ +++ .driver = &driver,
};
static int __init saa6752hs_init_module(void)
diff --cc drivers/media/video/saa7134/saa7134-alsa.c
index a7a6ab9,ade05f7,b24a26b,5707c66,ade05f7,5707c66,5707c66,5707c66,ade05f7,ade05f7,ade05f7,ade05f7..a7a6ab9
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@@@@@@@@@@@@ -59,10 -59,10 -59,10 -58,10 -59,10 -58,10 -58,10 -58,10 -59,10 -59,10 -59,10 -59,10 +59,10 @@@@@@@@@@@@@ static int enable[SNDRV_CARDS] = {1, [
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s).");
- --- int position;
- ---
#define dprintk(fmt, arg...) if (debug) \
- printk(KERN_DEBUG "%s/alsa: " fmt, dev->name, ## arg)
- --- printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ## arg)
++ +++ printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg)
+ +++
+ +++
/*
* Main chip structure
@@@@@@@@@@@@@ -989,15 -989,15 -989,7 -968,9 -989,15 -968,9 -968,9 -968,9 -989,15 -989,15 -989,15 -989,15 +989,15 @@@@@@@@@@@@@ static int saa7134_alsa_init(void
struct saa7134_dev *dev = NULL;
struct list_head *list;
- --- position = 0;
++ +++ if (!dmasound_init && !dmasound_exit) {
++ +++ dmasound_init = alsa_device_init;
++ +++ dmasound_exit = alsa_device_exit;
++ +++ } else {
++ +++ printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n");
++ +++ return -EBUSY;
++ +++ }
+
- --- printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n");
+ +++ printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n");
list_for_each(list,&saa7134_devlist) {
dev = list_entry(list, struct saa7134_dev, devlist);
diff --cc drivers/media/video/saa7134/saa7134-core.c
index 028904b,23d8747,23d8747,4275d2d,23d8747,4275d2d,4275d2d,4275d2d,23d8747,23d8747,23d8747,23d8747..028904b
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@@@@@@@@@@@@ -540,38 -610,11 -610,11 -609,11 -610,11 -609,11 -609,11 -609,11 -610,11 -610,11 -610,11 -610,11 +540,38 @@@@@@@@@@@@@ static irqreturn_t saa7134_irq(int irq
card_has_mpeg(dev))
saa7134_irq_ts_done(dev,status);
----------- if ((report & (SAA7134_IRQ_REPORT_GPIO16 |
----------- SAA7134_IRQ_REPORT_GPIO18)) &&
----------- dev->remote)
----------- saa7134_input_irq(dev);
+++++++++++ if (report & SAA7134_IRQ_REPORT_GPIO16) {
+++++++++++ switch (dev->has_remote) {
+++++++++++ case SAA7134_REMOTE_GPIO:
+++++++++++ if (dev->remote->mask_keydown & 0x10000) {
+++++++++++ saa7134_input_irq(dev);
+++++++++++ }
+++++++++++ break;
+++++++++++
+++++++++++ case SAA7134_REMOTE_I2C:
+++++++++++ break; /* FIXME: invoke I2C get_key() */
+ +++
+++++++++++ default: /* GPIO16 not used by IR remote */
+++++++++++ break;
+++++++++++ }
+++++++++++ }
++ + ++++
+++++++++++ if (report & SAA7134_IRQ_REPORT_GPIO18) {
+++++++++++ switch (dev->has_remote) {
+++++++++++ case SAA7134_REMOTE_GPIO:
+++++++++++ if ((dev->remote->mask_keydown & 0x40000) ||
+++++++++++ (dev->remote->mask_keyup & 0x40000)) {
+++++++++++ saa7134_input_irq(dev);
+++++++++++ }
+++++++++++ break;
+++++++++++
+++++++++++ case SAA7134_REMOTE_I2C:
+++++++++++ break; /* FIXME: invoke I2C get_key() */
+++++++++++
+++++++++++ default: /* GPIO18 not used by IR remote */
+++++++++++ break;
+++++++++++ }
+++++++++++ }
}
if (10 == loop) {
diff --cc drivers/media/video/saa7134/saa7134-i2c.c
index 6162550,1792d03,df9dd36,7575043,df9dd36,7575043,7575043,7575043,1792d03,df9dd36,1792d03,1792d03..6162550
--- a/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/drivers/media/video/saa7134/saa7134-i2c.c
@@@@@@@@@@@@@ -334,7 -333,7 -333,7 -333,7 -333,7 -333,7 -333,7 -333,7 -333,7 -333,7 -333,7 -333,7 +334,7 @@@@@@@@@@@@@ static int attach_inform(struct i2c_cli
struct tuner_setup tun_setup;
d1printk( "%s i2c attach [addr=0x%x,client=%s]\n",
- - - client->driver->name, client->addr, client->name);
- --- client->driver->name, client->addr, client->name);
++++++ + client->driver->driver.name, client->addr, client->name);
/* Am I an i2c remote control? */
diff --cc drivers/media/video/saa7134/saa7134-oss.c
index 7448e38,8badd2a,513a699,fd9ed11,8badd2a,fd9ed11,fd9ed11,fd9ed11,8badd2a,8badd2a,8badd2a,8badd2a..7448e38
--- a/drivers/media/video/saa7134/saa7134-oss.c
+++ b/drivers/media/video/saa7134/saa7134-oss.c
@@@@@@@@@@@@@ -965,61 -929,61 -929,55 -929,29 -929,61 -929,29 -929,29 -929,29 -929,61 -929,61 -929,61 -929,61 +965,61 @@@@@@@@@@@@@ fail
}
+ +++ static int oss_device_init(struct saa7134_dev *dev)
+ +++ {
+ +++ dev->dmasound.priv_data = dev;
+ +++ saa7134_oss_init1(dev);
+ +++ saa7134_dsp_create(dev);
+ +++ return 1;
+ +++ }
+ +++
+ +++ static int oss_device_exit(struct saa7134_dev *dev)
+ +++ {
+ +++
+ +++ unregister_sound_mixer(dev->dmasound.minor_mixer);
+ +++ unregister_sound_dsp(dev->dmasound.minor_dsp);
+ +++
+ +++ saa7134_oss_fini(dev);
+ +++
+ +++ if (dev->pci->irq > 0) {
+ +++ synchronize_irq(dev->pci->irq);
+ +++ free_irq(dev->pci->irq,&dev->dmasound);
+ +++ }
+ +++
+ +++ dev->dmasound.priv_data = NULL;
+ +++ return 1;
+ +++ }
+ +++
static int saa7134_oss_init(void)
{
- --- struct saa7134_dev *dev = NULL;
- --- struct list_head *list;
+ +++ struct saa7134_dev *dev = NULL;
+ +++ struct list_head *list;
+ +++
++ +++ if (!dmasound_init && !dmasound_exit) {
++ +++ dmasound_init = oss_device_init;
++ +++ dmasound_exit = oss_device_exit;
++ +++ } else {
++ +++ printk(KERN_WARNING "saa7134 OSS: can't load, DMA sound handler already assigned (probably to ALSA)\n");
++ +++ return -EBUSY;
++ +++ }
+
- --- printk(KERN_INFO "saa7134 OSS driver for DMA sound loaded\n");
+ +++ printk(KERN_INFO "saa7134 OSS driver for DMA sound loaded\n");
- --- list_for_each(list,&saa7134_devlist) {
- --- dev = list_entry(list, struct saa7134_dev, devlist);
++ +++
+ +++ list_for_each(list,&saa7134_devlist) {
+ +++ dev = list_entry(list, struct saa7134_dev, devlist);
if (dev->dmasound.priv_data == NULL) {
- --- dev->dmasound.priv_data = dev;
- --- saa7134_oss_init1(dev);
- --- saa7134_dsp_create(dev);
+ +++ oss_device_init(dev);
} else {
- --- printk(KERN_ERR "saa7134 OSS: DMA sound is being handled by ALSA, ignoring %s\n",dev->name);
+ +++ printk(KERN_ERR "saa7134 OSS: DMA sound is being handled by ALSA, ignoring %s\n",dev->name);
return -EBUSY;
}
- --- }
+ +++ }
- --- if (dev == NULL)
- --- printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n");
+ +++ if (dev == NULL)
+ +++ printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n");
- dmasound_init = oss_device_init;
- dmasound_exit = oss_device_exit;
-
- --- return 0;
+ +++ return 0;
}
@@@@@@@@@@@@@ -1035,20 -999,20 -993,16 -967,26 -999,20 -967,26 -967,26 -967,26 -999,20 -999,20 -999,20 -999,20 +1035,20 @@@@@@@@@@@@@ static void saa7134_oss_exit(void
if (!dev->dmasound.minor_dsp)
continue;
- --- unregister_sound_mixer(dev->dmasound.minor_mixer);
- --- unregister_sound_dsp(dev->dmasound.minor_dsp);
- ---
- --- saa7134_oss_fini(dev);
+ +++ oss_device_exit(dev);
- --- if (dev->pci->irq > 0) {
- --- synchronize_irq(dev->pci->irq);
- --- free_irq(dev->pci->irq,&dev->dmasound);
- --- }
- ---
- --- dev->dmasound.priv_data = NULL;
+ +++ }
- --- }
++ +++ dmasound_init = NULL;
++ +++ dmasound_exit = NULL;
+
- --- printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n");
+ +++ printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n");
- --- return;
+ +++ return;
}
-- --- module_init(saa7134_oss_init);
++ +++ /* We initialize this late, to make sure the sound system is up and running */
++ +++ late_initcall(saa7134_oss_init);
module_exit(saa7134_oss_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]");
diff --cc drivers/media/video/saa7185.c
index 3ed0edb,f72a9f7,132aa79,132aa79,132aa79,132aa79,132aa79,132aa79,f72a9f7,132aa79,f72a9f7,f72a9f7..3ed0edb
--- a/drivers/media/video/saa7185.c
+++ b/drivers/media/video/saa7185.c
@@@@@@@@@@@@@ -414,9 -414,10 -414,11 -414,11 -414,11 -414,11 -414,11 -414,11 -414,10 -414,11 -414,10 -414,10 +414,9 @@@@@@@@@@@@@ saa7185_detect_client (struct i2c_adapt
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver_saa7185;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
strlcpy(I2C_NAME(client), "saa7185", sizeof(I2C_NAME(client)));
----------- encoder = kmalloc(sizeof(struct saa7185), GFP_KERNEL);
+++++++++++ encoder = kzalloc(sizeof(struct saa7185), GFP_KERNEL);
if (encoder == NULL) {
kfree(client);
return -ENOMEM;
diff --cc drivers/media/video/tda7432.c
index fc3d582,549c992,d32737d,d32737d,d32737d,d32737d,d32737d,d32737d,549c992,d32737d,549c992,549c992..fc3d582
--- a/drivers/media/video/tda7432.c
+++ b/drivers/media/video/tda7432.c
@@@@@@@@@@@@@ -487,10 -501,10 -501,10 -501,10 -501,10 -501,10 -501,10 -501,10 -501,10 -501,10 -501,10 -501,10 +487,10 @@@@@@@@@@@@@ static int tda7432_command(struct i2c_c
}
static struct i2c_driver driver = {
------ - .owner = THIS_MODULE,
------ - .name = "i2c tda7432 driver",
++++++ + .driver = {
- - -- .name = "i2c tda7432 driver",
+++++++++++ .name = "tda7432",
++++++ + },
.id = I2C_DRIVERID_TDA7432,
------ - .flags = I2C_DF_NOTIFY,
.attach_adapter = tda7432_probe,
.detach_client = tda7432_detach,
.command = tda7432_command,
diff --cc drivers/media/video/tda9875.c
index ef98c49,9c3ecf7,a5e37dc,a5e37dc,a5e37dc,a5e37dc,a5e37dc,a5e37dc,9c3ecf7,a5e37dc,9c3ecf7,9c3ecf7..ef98c49
--- a/drivers/media/video/tda9875.c
+++ b/drivers/media/video/tda9875.c
@@@@@@@@@@@@@ -366,10 -372,10 -372,10 -372,10 -372,10 -372,10 -372,10 -372,10 -372,10 -372,10 -372,10 -372,10 +366,10 @@@@@@@@@@@@@ static int tda9875_command(struct i2c_c
static struct i2c_driver driver = {
------ - .owner = THIS_MODULE,
------ - .name = "i2c tda9875 driver",
++++++ + .driver = {
- - -- .name = "i2c tda9875 driver",
+++++++++++ .name = "tda9875",
++++++ + },
.id = I2C_DRIVERID_TDA9875,
------ - .flags = I2C_DF_NOTIFY,
.attach_adapter = tda9875_probe,
.detach_client = tda9875_detach,
.command = tda9875_command,
diff --cc drivers/media/video/tda9887.c
index 5815649,7165a1b,2f2414e,4249127,2f2414e,4249127,4249127,4249127,7165a1b,2f2414e,7165a1b,7165a1b..5815649
--- a/drivers/media/video/tda9887.c
+++ b/drivers/media/video/tda9887.c
@@@@@@@@@@@@@ -9,10 -9,10 -9,10 -9,9 -9,10 -9,9 -9,9 -9,9 -9,10 -9,10 -9,10 -9,10 +9,10 @@@@@@@@@@@@@
#include <linux/slab.h>
#include <linux/delay.h>
-----------#include <media/audiochip.h>
+++++++++++#include <media/v4l2-common.h>
#include <media/tuner.h>
+ +++
/* Chips:
TDA9885 (PAL, NTSC)
TDA9886 (PAL, SECAM, NTSC)
@@@@@@@@@@@@@ -517,13 -472,38 -472,38 -471,38 -472,38 -471,38 -471,38 -471,38 -472,38 -472,38 -472,38 -472,38 +517,13 @@@@@@@@@@@@@ static int tda9887_set_config(struct td
/* ---------------------------------------------------------------------- */
-----------static int tda9887_set_pinnacle(struct tda9887 *t, char *buf)
-----------{
----------- unsigned int bCarrierMode = UNSET;
-----------
----------- if (t->std & V4L2_STD_625_50) {
----------- if ((1 == t->pinnacle_id) || (7 == t->pinnacle_id)) {
----------- bCarrierMode = cIntercarrier;
----------- } else {
----------- bCarrierMode = cQSS;
----------- }
----------- }
----------- if (t->std & V4L2_STD_525_60) {
----------- if ((5 == t->pinnacle_id) || (6 == t->pinnacle_id)) {
----------- bCarrierMode = cIntercarrier;
----------- } else {
----------- bCarrierMode = cQSS;
----------- }
-- - ---- }
-- - ----
-- - ---- if (bCarrierMode != UNSET) {
-- - ---- buf[1] &= ~0x04;
-- - ---- buf[1] |= bCarrierMode;
----------- }
-- - ---- return 0;
-- - ----}
-- - ----
-- - ----/* ---------------------------------------------------------------------- */
+++++++++++static char pal[] = "--";
+++++++++++static char secam[] = "--";
+++++++++++static char ntsc[] = "-";
- --- if (bCarrierMode != UNSET) {
- --- buf[1] &= ~0x04;
- --- buf[1] |= bCarrierMode;
- --- }
- --- return 0;
- --- }
- ---
- --- /* ---------------------------------------------------------------------- */
- ---
-----------static char pal[] = "-";
module_param_string(pal, pal, sizeof(pal), 0644);
-----------static char secam[] = "-";
module_param_string(secam, secam, sizeof(secam), 0644);
+++++++++++module_param_string(ntsc, ntsc, sizeof(ntsc), 0644);
static int tda9887_fixup_std(struct tda9887 *t)
{
@@@@@@@@@@@@@ -876,12 -819,12 -819,14 -818,14 -819,14 -818,14 -818,14 -818,14 -819,12 -819,14 -819,12 -819,12 +876,12 @@@@@@@@@@@@@ static int tda9887_resume(struct devic
/* ----------------------------------------------------------------------- */
static struct i2c_driver driver = {
------ - .owner = THIS_MODULE,
- - - .name = "i2c tda9887 driver",
- --- .name = "i2c tda9887 driver",
- --- .id = -1, /* FIXME */
- --- .flags = I2C_DF_NOTIFY,
- --- .attach_adapter = tda9887_probe,
- --- .detach_client = tda9887_detach,
- --- .command = tda9887_command,
+ +++ .id = -1, /* FIXME */
- - - .flags = I2C_DF_NOTIFY,
+ +++ .attach_adapter = tda9887_probe,
+ +++ .detach_client = tda9887_detach,
+ +++ .command = tda9887_command,
.driver = {
- - -- .name = "i2c tda9887 driver",
+++++++++++ .name = "tda9887",
.suspend = tda9887_suspend,
.resume = tda9887_resume,
},
@@@@@@@@@@@@@ -889,7 -832,7 -834,8 -833,8 -834,8 -833,8 -833,8 -833,8 -832,7 -834,8 -832,7 -832,7 +889,7 @@@@@@@@@@@@@
static struct i2c_client client_template =
{
.name = "tda9887",
------ - .flags = I2C_CLIENT_ALLOW_USE,
- --- .driver = &driver,
+ +++ .driver = &driver,
};
static int __init tda9887_init_module(void)
diff --cc drivers/media/video/tuner-core.c
index 2995b22,c13c7b9,e58abdf,e58abdf,e58abdf,e58abdf,e58abdf,e58abdf,c13c7b9,e58abdf,c13c7b9,c13c7b9..2995b22
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@@@@@@@@@@@@ -224,9 -204,9 -204,9 -204,9 -204,9 -204,9 -204,9 -204,9 -204,9 -204,9 -204,9 -204,9 +224,9 @@@@@@@@@@@@@ static void set_type(struct i2c_client
if (t->mode_mask == T_UNINITIALIZED)
t->mode_mask = new_mode_mask;
----------- set_freq(c, t->freq);
+++++++++++ set_freq(c, (V4L2_TUNER_RADIO == t->mode) ? t->radio_freq : t->tv_freq);
tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n",
------ - c->adapter->name, c->driver->name, c->addr << 1, type,
++++++ + c->adapter->name, c->driver->driver.name, c->addr << 1, type,
t->mode_mask);
}
@@@@@@@@@@@@@ -823,10 -747,10 -750,9 -750,9 -750,9 -750,9 -750,9 -750,9 -747,10 -750,9 -747,10 -747,10 +823,10 @@@@@@@@@@@@@ static struct i2c_driver driver =
.detach_client = tuner_detach,
.command = tuner_command,
.driver = {
- - -- .name = "tuner",
----------- .suspend = tuner_suspend,
----------- .resume = tuner_resume,
----------- },
+++++++++++ .name = "tuner",
+++++++++++ .suspend = tuner_suspend,
+++++++++++ .resume = tuner_resume,
+++++++++++ },
};
static struct i2c_client client_template = {
.name = "(tuner unset)",
diff --cc drivers/media/video/tuner-types.c
index 6fe7817,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..6fe7817
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/media/video/tuner-types.c
+++ b/drivers/media/video/tuner-types.c
diff --cc drivers/media/video/tvaudio.c
index 6d03b9b,0292c5a,5b20e81,c31bf28,5b20e81,c31bf28,c31bf28,c31bf28,0292c5a,5b20e81,0292c5a,0292c5a..6d03b9b
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@@@@@@@@@@@@ -175,8 -187,8 -187,8 -187,8 -187,8 -187,8 -187,8 -187,8 -187,8 -187,8 -187,8 -187,8 +175,8 @@@@@@@@@@@@@ static int chip_write(struct CHIPSTATE
buffer[0] = subaddr;
buffer[1] = val;
if (2 != i2c_master_send(&chip->c,buffer,2)) {
----------- tvaudio_warn("%s: I/O error (write reg%d=0x%x)\n",
- --- chip->c.name, subaddr, val);
+++++++++++ v4l_warn(&chip->c, "%s: I/O error (write reg%d=0x%x)\n",
+ +++ chip->c.name, subaddr, val);
return -1;
}
}
@@@@@@@@@@@@@ -204,7 -216,7 -216,7 -216,7 -216,7 -216,7 -216,7 -216,7 -216,7 -216,7 -216,7 -216,7 +204,7 @@@@@@@@@@@@@ static int chip_read(struct CHIPSTATE *
chip->c.name);
return -1;
}
-- - ---- tvaudio_dbg("%s: chip_read: 0x%x\n",chip->c.name, buffer);
- --- tvaudio_dbg("%s: chip_read: 0x%x\n",chip->c.name,buffer);
+++++++++++ v4l_dbg(1, debug, &chip->c, "%s: chip_read: 0x%x\n",chip->c.name, buffer);
return buffer;
}
@@@@@@@@@@@@@ -219,11 -231,11 -231,11 -231,11 -231,11 -231,11 -231,11 -231,11 -231,11 -231,11 -231,11 -231,11 +219,11 @@@@@@@@@@@@@ static int chip_read2(struct CHIPSTATE
write[0] = subaddr;
if (2 != i2c_transfer(chip->c.adapter,msgs,2)) {
----------- tvaudio_warn("%s: I/O error (read2)\n", chip->c.name);
+++++++++++ v4l_warn(&chip->c, "%s: I/O error (read2)\n", chip->c.name);
return -1;
}
----------- tvaudio_dbg("%s: chip_read2: reg%d=0x%x\n",
- --- chip->c.name,subaddr,read[0]);
+++++++++++ v4l_dbg(1, debug, &chip->c, "%s: chip_read2: reg%d=0x%x\n",
+ +++ chip->c.name, subaddr,read[0]);
return read[0];
}
@@@@@@@@@@@@@ -235,8 -247,8 -247,8 -247,8 -247,8 -247,8 -247,8 -247,8 -247,8 -247,8 -247,8 -247,8 +235,8 @@@@@@@@@@@@@ static int chip_cmd(struct CHIPSTATE *c
return 0;
/* update our shadow register set; print bytes if (debug > 0) */
----------- tvaudio_dbg("%s: chip_cmd(%s): reg=%d, data:",
- --- chip->c.name,name,cmd->bytes[0]);
+++++++++++ v4l_dbg(1, debug, &chip->c, "%s: chip_cmd(%s): reg=%d, data:",
+ +++ chip->c.name, name,cmd->bytes[0]);
for (i = 1; i < cmd->count; i++) {
if (debug)
printk(" 0x%x",cmd->bytes[i]);
@@@@@@@@@@@@@ -310,9 -322,9 -322,9 -322,9 -322,9 -322,9 -322,9 -322,9 -322,9 -322,9 -322,9 -322,9 +310,9 @@@@@@@@@@@@@ static void generic_checkmode(struct CH
int mode = desc->getmode(chip);
if (mode == chip->prevmode)
- --- return;
+ +++ return;
----------- tvaudio_dbg("%s: thread checkmode\n", chip->c.name);
+++++++++++ v4l_dbg(1, debug, &chip->c, "%s: thread checkmode\n", chip->c.name);
chip->prevmode = mode;
if (mode & VIDEO_SOUND_STEREO)
@@@@@@@@@@@@@ -1489,22 -1502,22 -1502,22 -1502,22 -1502,22 -1502,22 -1502,22 -1502,22 -1502,22 -1502,22 -1502,22 -1502,22 +1489,22 @@@@@@@@@@@@@ static int chip_attach(struct i2c_adapt
break;
}
if (desc->name == NULL) {
----------- tvaudio_dbg("no matching chip description found\n");
+++++++++++ v4l_dbg(1, debug, &chip->c, "no matching chip description found\n");
return -EIO;
}
----------- tvaudio_info("%s found @ 0x%x (%s)\n", desc->name, addr<<1, adap->name);
- --- if (desc->flags) {
- --- tvaudio_dbg("matches:%s%s%s.\n",
- --- (desc->flags & CHIP_HAS_VOLUME) ? " volume" : "",
- --- (desc->flags & CHIP_HAS_BASSTREBLE) ? " bass/treble" : "",
- --- (desc->flags & CHIP_HAS_INPUTSEL) ? " audiomux" : "");
- --- }
+++++++++++ v4l_info(&chip->c, "%s found @ 0x%x (%s)\n", desc->name, addr<<1, adap->name);
+ +++ if (desc->flags) {
-- - ---- tvaudio_dbg("matches:%s%s%s.\n",
+++++++++++ v4l_dbg(1, debug, &chip->c, "matches:%s%s%s.\n",
+ +++ (desc->flags & CHIP_HAS_VOLUME) ? " volume" : "",
+ +++ (desc->flags & CHIP_HAS_BASSTREBLE) ? " bass/treble" : "",
+ +++ (desc->flags & CHIP_HAS_INPUTSEL) ? " audiomux" : "");
+ +++ }
/* fill required data structures */
- --- strcpy(chip->c.name,desc->name);
+ +++ strcpy(chip->c.name, desc->name);
chip->type = desc-chiplist;
chip->shadow.count = desc->registers+1;
- --- chip->prevmode = -1;
+ +++ chip->prevmode = -1;
/* register */
i2c_attach_client(&chip->c);
@@@@@@@@@@@@@ -1582,7 -1604,7 -1604,7 -1604,7 -1604,7 -1604,7 -1604,7 -1604,7 -1604,7 -1604,7 -1604,7 -1604,7 +1582,7 @@@@@@@@@@@@@ static int chip_command(struct i2c_clie
struct CHIPSTATE *chip = i2c_get_clientdata(client);
struct CHIPDESC *desc = chiplist + chip->type;
-- - ---- tvaudio_dbg("%s: chip_command 0x%x\n", chip->c.name, cmd);
- --- tvaudio_dbg("%s: chip_command 0x%x\n",chip->c.name,cmd);
+++++++++++ v4l_dbg(1, debug, &chip->c, "%s: chip_command 0x%x\n", chip->c.name, cmd);
switch (cmd) {
case AUDC_SET_INPUT:
@@@@@@@@@@@@@ -1656,80 -1678,15 -1678,15 -1678,15 -1678,15 -1678,15 -1678,15 -1678,15 -1678,15 -1678,15 -1678,15 -1678,15 +1656,80 @@@@@@@@@@@@@
}
break;
}
----------- case VIDIOCSCHAN:
+++++++++++
+++++++++++ case VIDIOC_S_TUNER:
{
----------- struct video_channel *vc = arg;
+++++++++++ struct v4l2_tuner *vt = arg;
+++++++++++ int mode = 0;
+ + +
- - ---- -- chip->norm = vc->norm;
+++++++++++ switch (vt->audmode) {
+++++++++++ case V4L2_TUNER_MODE_MONO:
+++++++++++ mode = VIDEO_SOUND_MONO;
+++++++++++ break;
+++++++++++ case V4L2_TUNER_MODE_STEREO:
+++++++++++ mode = VIDEO_SOUND_STEREO;
+++++++++++ break;
+++++++++++ case V4L2_TUNER_MODE_LANG1:
+++++++++++ mode = VIDEO_SOUND_LANG1;
+++++++++++ break;
+++++++++++ case V4L2_TUNER_MODE_LANG2:
+++++++++++ mode = VIDEO_SOUND_LANG2;
+++++++++++ break;
+++++++++++ default:
+++++++++++ break;
+++++++++++ }
+ + ++++ ++
- - - chip->norm = vc->norm;
+++++++++++ if (desc->setmode && mode) {
+++++++++++ chip->watch_stereo = 0;
+++++++++++ /* del_timer(&chip->wt); */
+++++++++++ chip->mode = mode;
+++++++++++ desc->setmode(chip, mode);
+++++++++++ }
break;
}
----------- case VIDIOCSFREQ:
+++++++++++
+++++++++++ case VIDIOC_G_TUNER:
{
+++++++++++ struct v4l2_tuner *vt = arg;
+++++++++++ int mode = VIDEO_SOUND_MONO;
+++++++++++
+++++++++++ if (chip->radio)
+++++++++++ break;
+++++++++++ vt->audmode = 0;
+++++++++++ vt->rxsubchans = 0;
+++++++++++ vt->capability = V4L2_TUNER_CAP_STEREO |
+++++++++++ V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2;
+++++++++++
+++++++++++ if (desc->getmode)
+++++++++++ mode = desc->getmode(chip);
+++++++++++
+++++++++++ if (mode & VIDEO_SOUND_MONO)
+++++++++++ vt->rxsubchans |= V4L2_TUNER_SUB_MONO;
+++++++++++ if (mode & VIDEO_SOUND_STEREO)
+++++++++++ vt->rxsubchans |= V4L2_TUNER_SUB_STEREO;
+++++++++++ if (mode & VIDEO_SOUND_LANG1)
+++++++++++ vt->rxsubchans |= V4L2_TUNER_SUB_LANG1 |
+++++++++++ V4L2_TUNER_SUB_LANG2;
+++++++++++
+++++++++++ mode = chip->mode;
+++++++++++ if (mode & VIDEO_SOUND_MONO)
+++++++++++ vt->audmode = V4L2_TUNER_MODE_MONO;
+++++++++++ if (mode & VIDEO_SOUND_STEREO)
+++++++++++ vt->audmode = V4L2_TUNER_MODE_STEREO;
+++++++++++ if (mode & VIDEO_SOUND_LANG1)
+++++++++++ vt->audmode = V4L2_TUNER_MODE_LANG1;
+++++++++++ if (mode & VIDEO_SOUND_LANG2)
+++++++++++ vt->audmode = V4L2_TUNER_MODE_LANG2;
+++++++++++ break;
+++++++++++ }
+++++++++++
+++++++++++ case VIDIOCSCHAN:
+++++++++++ case VIDIOC_S_STD:
+++++++++++ chip->radio = 0;
+++++++++++ break;
+++++++++++
+++++++++++ case VIDIOCSFREQ:
+++++++++++ case VIDIOC_S_FREQUENCY:
chip->mode = 0; /* automatic */
if (desc->checkmode) {
desc->setmode(chip,VIDEO_SOUND_MONO);
@@@@@@@@@@@@@ -1743,11 -1700,12 -1700,12 -1700,12 -1700,12 -1700,12 -1700,12 -1700,12 -1700,12 -1700,12 -1700,12 -1700,12 +1743,11 @@@@@@@@@@@@@
return 0;
}
-----------
static struct i2c_driver driver = {
------ - .owner = THIS_MODULE,
------ - .name = "generic i2c audio driver",
++++++ + .driver = {
- - -- .name = "generic i2c audio driver",
+++++++++++ .name = "tvaudio",
++++++ + },
.id = I2C_DRIVERID_TVAUDIO,
------ - .flags = I2C_DF_NOTIFY,
.attach_adapter = chip_probe,
.detach_client = chip_detach,
.command = chip_command,
diff --cc drivers/media/video/tveeprom.c
index 582551b,8ac4cb8,cd7cf1b,72e8741,5ac2353,72e8741,72e8741,72e8741,8ac4cb8,5ac2353,8ac4cb8,8ac4cb8..582551b
--- a/drivers/media/video/tveeprom.c
+++ b/drivers/media/video/tveeprom.c
@@@@@@@@@@@@@ -73,14 -74,14 -74,14 -74,14 -74,14 -74,14 -74,14 -74,14 -74,14 -74,14 -74,14 -74,14 +73,14 @@@@@@@@@@@@@ static struct HAUPPAUGE_TUNER_FM
}
hauppauge_tuner_fmt[] =
{
----------- { 0x00000000, " unknown1" },
----------- { 0x00000000, " unknown2" },
----------- { 0x00000007, " PAL(B/G)" },
----------- { 0x00001000, " NTSC(M)" },
----------- { 0x00000010, " PAL(I)" },
----------- { 0x00400000, " SECAM(L/L')" },
----------- { 0x00000e00, " PAL(D/K)" },
-- - ---- { 0x03000000, " ATSC/DVB Digital" },
- --- { 0x03000000, " ATSC Digital" },
+++++++++++ { V4L2_STD_UNKNOWN," UNKNOWN" },
+++++++++++ { V4L2_STD_UNKNOWN," FM" },
+++++++++++ { V4L2_STD_PAL_BG, " PAL(B/G)" },
+++++++++++ { V4L2_STD_NTSC_M, " NTSC(M)" },
+++++++++++ { V4L2_STD_PAL_I, " PAL(I)" },
+++++++++++ { V4L2_STD_SECAM_L," SECAM(L/L')" },
+++++++++++ { V4L2_STD_PAL_DK, " PAL(D/D1/K)" },
+++++++++++ { V4L2_STD_ATSC, " ATSC/DVB Digital" },
};
/* This is the full list of possible tuners. Many thanks to Hauppauge for
@@@@@@@@@@@@@ -205,10 -206,10 -206,10 -206,10 -206,10 -206,10 -206,10 -206,10 -206,10 -206,10 -206,10 -206,10 +205,10 @@@@@@@@@@@@@ hauppauge_tuner[]
{ TUNER_ABSENT, "TCL 2002MI_3H"},
{ TUNER_TCL_2002N, "TCL 2002N 5H"},
/* 100-109 */
-- --- { TUNER_ABSENT, "Philips FMD1216ME"},
++ +++ { TUNER_PHILIPS_FMD1216ME_MK3, "Philips FMD1216ME"},
{ TUNER_TEA5767, "Philips TEA5768HL FM Radio"},
{ TUNER_ABSENT, "Panasonic ENV57H12D5"},
- --- { TUNER_ABSENT, "TCL MFNM05-4"},
+ +++ { TUNER_PHILIPS_FM1236_MK3, "TCL MFNM05-4"},
{ TUNER_ABSENT, "TCL MNM05-4"},
{ TUNER_PHILIPS_FM1216ME_MK3, "TCL MPE05-2"},
{ TUNER_ABSENT, "TCL MQNM05-4"},
@@@@@@@@@@@@@ -382,15 -383,15 -383,15 -368,10 -383,15 -368,10 -368,10 -368,10 -383,15 -383,15 -383,15 -383,15 +382,15 @@@@@@@@@@@@@ void tveeprom_hauppauge_analog(struct i
memset(tvee, 0, sizeof(*tvee));
done = len = beenhere = 0;
- --- /* Hack for processing eeprom for em28xx */
- --- if ((eeprom_data[0]==0x1a)&&(eeprom_data[1]==0xeb)&&
- --- (eeprom_data[2]==0x67)&&(eeprom_data[3]==0x95))
- --- start=0xa0;
+ +++ /* Hack for processing eeprom for em28xx and cx 2388x*/
+ +++ if ((eeprom_data[0] == 0x1a) && (eeprom_data[1] == 0xeb) &&
+ +++ (eeprom_data[2] == 0x67) && (eeprom_data[3] == 0x95))
+ +++ start=0xa0; /* Generic em28xx offset */
-- - ---- else if (((eeprom_data[0] & 0xf0) == 0x10) &&
+++++++++++ else if (((eeprom_data[0] & 0xe1) == 0x01) &&
+ +++ (eeprom_data[1] == 0x00) &&
+ +++ (eeprom_data[2] == 0x00) &&
+ +++ (eeprom_data[8] == 0x84))
+ +++ start=8; /* Generic cx2388x offset */
else
start=0;
@@@@@@@@@@@@@ -748,9 -750,10 -750,11 -708,10 -750,11 -708,10 -708,10 -708,10 -750,10 -750,11 -750,10 -750,10 +748,9 @@@@@@@@@@@@@ tveeprom_detect_client(struct i2c_adapt
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver_tveeprom;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
snprintf(client->name, sizeof(client->name), "tveeprom");
- --- i2c_attach_client(client);
+ +++ i2c_attach_client(client);
+ +++
return 0;
}
diff --cc drivers/media/video/tvmixer.c
index 9e86cae,e837f9f,8318bd1,8318bd1,8318bd1,8318bd1,8318bd1,8318bd1,e837f9f,8318bd1,e837f9f,e837f9f..9e86cae
--- a/drivers/media/video/tvmixer.c
+++ b/drivers/media/video/tvmixer.c
@@@@@@@@@@@@@ -227,11 -227,15 -227,17 -227,17 -227,17 -227,17 -227,17 -227,17 -227,15 -227,17 -227,15 -227,15 +227,11 @@@@@@@@@@@@@ static int tvmixer_release(struct inod
}
static struct i2c_driver driver = {
-----------#ifdef I2C_PEC
------ - .owner = THIS_MODULE,
------ - #endif
------ - .name = "tv card mixer driver",
++++++ + .driver = {
- - -- .name = "tv card mixer driver",
+++++++++++ .name = "tvmixer",
++++++ + },
- - --#else
- - -- .name = "tv card mixer driver",
- - --#endif
.id = I2C_DRIVERID_TVMIXER,
------ - #ifdef I2C_DF_DUMMY
------ - .flags = I2C_DF_DUMMY,
------ - #else
------ - .flags = I2C_DF_NOTIFY,
.detach_adapter = tvmixer_adapters,
------ - #endif
.attach_adapter = tvmixer_adapters,
.detach_client = tvmixer_clients,
};
diff --cc drivers/media/video/tvp5150.c
index fad9ea0,a60442e,97431e2,81e6d44,97431e2,81e6d44,81e6d44,81e6d44,a60442e,97431e2,a60442e,a60442e..fad9ea0
--- a/drivers/media/video/tvp5150.c
+++ b/drivers/media/video/tvp5150.c
@@@@@@@@@@@@@ -29,16 -28,11 -28,11 -28,11 -28,11 -28,11 -28,11 -28,11 -28,11 -28,11 -28,11 -28,11 +29,16 @@@@@@@@@@@@@ static int debug = 0
module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0-1)");
-----------#define dprintk(num, format, args...) \
+++++++++++#define tvp5150_info(fmt, arg...) do { \
+++++++++++ printk(KERN_INFO "%s %d-%04x: " fmt, c->driver->driver.name, \
+++++++++++ i2c_adapter_id(c->adapter), c->addr , ## arg); } while (0)
+++++++++++#define tvp5150_dbg(num, fmt, arg...) \
do { \
if (debug >= num) \
-- - ---- printk(format, ##args); \
- --- printk(format , ##args); \
----------- } while (0)
+++++++++++ printk(KERN_DEBUG "%s debug %d-%04x: " fmt,\
+++++++++++ c->driver->driver.name, \
+++++++++++ i2c_adapter_id(c->adapter), \
+++++++++++ c->addr , ## arg); } while (0)
/* supported controls */
static struct v4l2_queryctrl tvp5150_qctrl[] = {
@@@@@@@@@@@@@ -465,319 -445,36 -445,36 -445,36 -445,36 -445,36 -445,36 -445,36 -445,36 -445,36 -445,36 -445,36 +465,319 @@@@@@@@@@@@@ static inline void tvp5150_selmux(struc
tvp5150_write(c, TVP5150_VD_IN_SRC_SEL_1, input);
};
-----------static inline void tvp5150_reset(struct i2c_client *c)
+++++++++++struct i2c_reg_value {
+++++++++++ unsigned char reg;
+++++++++++ unsigned char value;
+++++++++++};
+++++++++++
+++++++++++/* Default values as sugested at TVP5150AM1 datasheet */
+++++++++++static const struct i2c_reg_value tvp5150_init_default[] = {
+++++++++++ { /* 0x00 */
+++++++++++ TVP5150_VD_IN_SRC_SEL_1,0x00
+++++++++++ },
+++++++++++ { /* 0x01 */
+++++++++++ TVP5150_ANAL_CHL_CTL,0x15
+++++++++++ },
+++++++++++ { /* 0x02 */
+++++++++++ TVP5150_OP_MODE_CTL,0x00
+++++++++++ },
+++++++++++ { /* 0x03 */
+++++++++++ TVP5150_MISC_CTL,0x01
+++++++++++ },
+++++++++++ { /* 0x06 */
+++++++++++ TVP5150_COLOR_KIL_THSH_CTL,0x10
+++++++++++ },
+++++++++++ { /* 0x07 */
+++++++++++ TVP5150_LUMA_PROC_CTL_1,0x60
+++++++++++ },
+++++++++++ { /* 0x08 */
+++++++++++ TVP5150_LUMA_PROC_CTL_2,0x00
+++++++++++ },
+++++++++++ { /* 0x09 */
+++++++++++ TVP5150_BRIGHT_CTL,0x80
+++++++++++ },
+++++++++++ { /* 0x0a */
+++++++++++ TVP5150_SATURATION_CTL,0x80
+++++++++++ },
+++++++++++ { /* 0x0b */
+++++++++++ TVP5150_HUE_CTL,0x00
+++++++++++ },
+++++++++++ { /* 0x0c */
+++++++++++ TVP5150_CONTRAST_CTL,0x80
+++++++++++ },
+++++++++++ { /* 0x0d */
+++++++++++ TVP5150_DATA_RATE_SEL,0x47
+++++++++++ },
+++++++++++ { /* 0x0e */
+++++++++++ TVP5150_LUMA_PROC_CTL_3,0x00
+++++++++++ },
+++++++++++ { /* 0x0f */
+++++++++++ TVP5150_CONF_SHARED_PIN,0x08
+++++++++++ },
+++++++++++ { /* 0x11 */
+++++++++++ TVP5150_ACT_VD_CROP_ST_MSB,0x00
+++++++++++ },
+++++++++++ { /* 0x12 */
+++++++++++ TVP5150_ACT_VD_CROP_ST_LSB,0x00
+++++++++++ },
+++++++++++ { /* 0x13 */
+++++++++++ TVP5150_ACT_VD_CROP_STP_MSB,0x00
+++++++++++ },
+++++++++++ { /* 0x14 */
+++++++++++ TVP5150_ACT_VD_CROP_STP_LSB,0x00
+++++++++++ },
+++++++++++ { /* 0x15 */
+++++++++++ TVP5150_GENLOCK,0x01
+++++++++++ },
+++++++++++ { /* 0x16 */
+++++++++++ TVP5150_HORIZ_SYNC_START,0x80
+++++++++++ },
+++++++++++ { /* 0x18 */
+++++++++++ TVP5150_VERT_BLANKING_START,0x00
+++++++++++ },
+++++++++++ { /* 0x19 */
+++++++++++ TVP5150_VERT_BLANKING_STOP,0x00
+++++++++++ },
+++++++++++ { /* 0x1a */
+++++++++++ TVP5150_CHROMA_PROC_CTL_1,0x0c
+++++++++++ },
+++++++++++ { /* 0x1b */
+++++++++++ TVP5150_CHROMA_PROC_CTL_2,0x14
+++++++++++ },
+++++++++++ { /* 0x1c */
+++++++++++ TVP5150_INT_RESET_REG_B,0x00
+++++++++++ },
+++++++++++ { /* 0x1d */
+++++++++++ TVP5150_INT_ENABLE_REG_B,0x00
+++++++++++ },
+++++++++++ { /* 0x1e */
+++++++++++ TVP5150_INTT_CONFIG_REG_B,0x00
+++++++++++ },
+++++++++++ { /* 0x28 */
+++++++++++ TVP5150_VIDEO_STD,0x00
+++++++++++ },
+++++++++++ { /* 0x2e */
+++++++++++ TVP5150_MACROVISION_ON_CTR,0x0f
+++++++++++ },
+++++++++++ { /* 0x2f */
+++++++++++ TVP5150_MACROVISION_OFF_CTR,0x01
+++++++++++ },
+++++++++++ { /* 0xbb */
+++++++++++ TVP5150_TELETEXT_FIL_ENA,0x00
+++++++++++ },
+++++++++++ { /* 0xc0 */
+++++++++++ TVP5150_INT_STATUS_REG_A,0x00
+++++++++++ },
+++++++++++ { /* 0xc1 */
+++++++++++ TVP5150_INT_ENABLE_REG_A,0x00
+++++++++++ },
+++++++++++ { /* 0xc2 */
+++++++++++ TVP5150_INT_CONF,0x04
+++++++++++ },
+++++++++++ { /* 0xc8 */
+++++++++++ TVP5150_FIFO_INT_THRESHOLD,0x80
+++++++++++ },
+++++++++++ { /* 0xc9 */
+++++++++++ TVP5150_FIFO_RESET,0x00
+++++++++++ },
+++++++++++ { /* 0xca */
+++++++++++ TVP5150_LINE_NUMBER_INT,0x00
+++++++++++ },
+++++++++++ { /* 0xcb */
+++++++++++ TVP5150_PIX_ALIGN_REG_LOW,0x4e
+++++++++++ },
+++++++++++ { /* 0xcc */
+++++++++++ TVP5150_PIX_ALIGN_REG_HIGH,0x00
+++++++++++ },
+++++++++++ { /* 0xcd */
+++++++++++ TVP5150_FIFO_OUT_CTRL,0x01
+++++++++++ },
+++++++++++ { /* 0xcf */
+++++++++++ TVP5150_FULL_FIELD_ENA_1,0x00
+++++++++++ },
+++++++++++ { /* 0xd0 */
+++++++++++ TVP5150_FULL_FIELD_ENA_2,0x00
+++++++++++ },
+++++++++++ { /* 0xfc */
+++++++++++ TVP5150_FULL_FIELD_MODE_REG,0x7f
+++++++++++ },
+++++++++++ { /* end of data */
+++++++++++ 0xff,0xff
+++++++++++ }
+++++++++++};
+++++++++++
+++++++++++/* Default values as sugested at TVP5150AM1 datasheet */
+++++++++++static const struct i2c_reg_value tvp5150_init_enable[] = {
+++++++++++ {
+++++++++++ TVP5150_CONF_SHARED_PIN, 2
+++++++++++ },{ /* Automatic offset and AGC enabled */
+++++++++++ TVP5150_ANAL_CHL_CTL, 0x15
+++++++++++ },{ /* Activate YCrCb output 0x9 or 0xd ? */
+++++++++++ TVP5150_MISC_CTL, 0x6f
+++++++++++ },{ /* Activates video std autodetection for all standards */
+++++++++++ TVP5150_AUTOSW_MSK, 0x0
+++++++++++ },{ /* Default format: 0x47. For 4:2:2: 0x40 */
+++++++++++ TVP5150_DATA_RATE_SEL, 0x47
+++++++++++ },{
+++++++++++ TVP5150_CHROMA_PROC_CTL_1, 0x0c
+++++++++++ },{
+++++++++++ TVP5150_CHROMA_PROC_CTL_2, 0x54
+++++++++++ },{ /* Non documented, but initialized on WinTV USB2 */
+++++++++++ 0x27, 0x20
+++++++++++ },{
+++++++++++ 0xff,0xff
+++++++++++ }
+++++++++++};
+++++++++++
+++++++++++struct i2c_vbi_ram_value {
+++++++++++ u16 reg;
+++++++++++ unsigned char values[26];
+++++++++++};
+++++++++++
+++++++++++static struct i2c_vbi_ram_value vbi_ram_default[] =
{
----------- struct tvp5150 *decoder = i2c_get_clientdata(c);
+++++++++++ {0x010, /* WST SECAM 6 */
+++++++++++ { 0xaa, 0xaa, 0xff, 0xff , 0xe7, 0x2e, 0x20, 0x26, 0xe6, 0xb4, 0x0e, 0x0, 0x0, 0x0, 0x10, 0x0 }
+++++++++++ },
+++++++++++ {0x030, /* WST PAL B 6 */
+++++++++++ { 0xaa, 0xaa, 0xff, 0xff , 0x27, 0x2e, 0x20, 0x2b, 0xa6, 0x72, 0x10, 0x0, 0x0, 0x0, 0x10, 0x0 }
+++++++++++ },
+++++++++++ {0x050, /* WST PAL C 6 */
+++++++++++ { 0xaa, 0xaa, 0xff, 0xff , 0xe7, 0x2e, 0x20, 0x22, 0xa6, 0x98, 0x0d, 0x0, 0x0, 0x0, 0x10, 0x0 }
+++++++++++ },
+++++++++++ {0x070, /* WST NTSC 6 */
+++++++++++ { 0xaa, 0xaa, 0xff, 0xff , 0x27, 0x2e, 0x20, 0x23, 0x69, 0x93, 0x0d, 0x0, 0x0, 0x0, 0x10, 0x0 }
+++++++++++ },
+++++++++++ {0x090, /* NABTS, NTSC 6 */
+++++++++++ { 0xaa, 0xaa, 0xff, 0xff , 0xe7, 0x2e, 0x20, 0x22, 0x69, 0x93, 0x0d, 0x0, 0x0, 0x0, 0x15, 0x0 }
+++++++++++ },
+++++++++++ {0x0b0, /* NABTS, NTSC-J 6 */
+++++++++++ { 0xaa, 0xaa, 0xff, 0xff , 0xa7, 0x2e, 0x20, 0x23, 0x69, 0x93, 0x0d, 0x0, 0x0, 0x0, 0x10, 0x0 }
+++++++++++ },
+++++++++++ {0x0d0, /* CC, PAL/SECAM 6 */
+++++++++++ { 0xaa, 0x2a, 0xff, 0x3f , 0x04, 0x51, 0x6e, 0x02, 0xa6, 0x7b, 0x09, 0x0, 0x0, 0x0, 0x27, 0x0 }
+++++++++++ },
+++++++++++ {0x0f0, /* CC, NTSC 6 */
+++++++++++ { 0xaa, 0x2a, 0xff, 0x3f , 0x04, 0x51, 0x6e, 0x02, 0x69, 0x8c, 0x09, 0x0, 0x0, 0x0, 0x27, 0x0 }
+++++++++++ },
+++++++++++ {0x110, /* WSS, PAL/SECAM 6 */
+++++++++++ { 0x5b, 0x55, 0xc5, 0xff , 0x0, 0x71, 0x6e, 0x42, 0xa6, 0xcd, 0x0f, 0x0, 0x0, 0x0, 0x3a, 0x0 }
+++++++++++ },
+++++++++++ {0x130, /* WSS, NTSC C */
+++++++++++ { 0x38, 0x00, 0x3f, 0x00 , 0x0, 0x71, 0x6e, 0x43, 0x69, 0x7c, 0x08, 0x0, 0x0, 0x0, 0x39, 0x0 }
+++++++++++ },
+++++++++++ {0x150, /* VITC, PAL/SECAM 6 */
+++++++++++ { 0x0, 0x0, 0x0, 0x0 , 0x0, 0x8f, 0x6d, 0x49, 0xa6, 0x85, 0x08, 0x0, 0x0, 0x0, 0x4c, 0x0 }
+++++++++++ },
+++++++++++ {0x170, /* VITC, NTSC 6 */
+++++++++++ { 0x0, 0x0, 0x0, 0x0 , 0x0, 0x8f, 0x6d, 0x49, 0x69, 0x94, 0x08, 0x0, 0x0, 0x0, 0x4c, 0x0 }
+++++++++++ },
+++++++++++ { (u16)-1 }
+++++++++++};
----------- tvp5150_write(c, TVP5150_CONF_SHARED_PIN, 2);
+++++++++++static int tvp5150_write_inittab(struct i2c_client *c,
+++++++++++ const struct i2c_reg_value *regs)
+++++++++++{
+++++++++++ while (regs->reg != 0xff) {
+++++++++++ tvp5150_write(c, regs->reg, regs->value);
+++++++++++ regs++;
+++++++++++ }
+++++++++++ return 0;
+++++++++++}
----------- /* Automatic offset and AGC enabled */
----------- tvp5150_write(c, TVP5150_ANAL_CHL_CTL, 0x15);
+++++++++++static int tvp5150_vdp_init(struct i2c_client *c,
+++++++++++ const struct i2c_vbi_ram_value *regs)
+++++++++++{
+++++++++++ unsigned int i;
----------- /* Normal Operation */
-----------// tvp5150_write(c, TVP5150_OP_MODE_CTL, 0x00);
+++++++++++ /* Disable Full Field */
+++++++++++ tvp5150_write(c, TVP5150_FULL_FIELD_ENA_1, 0);
----------- /* Activate YCrCb output 0x9 or 0xd ? */
----------- tvp5150_write(c, TVP5150_MISC_CTL, 0x6f);
+++++++++++ /* Before programming, Line mode should be at 0xff */
+++++++++++ for (i=TVP5150_FULL_FIELD_ENA_2; i<=TVP5150_LINE_MODE_REG_44; i++)
+++++++++++ tvp5150_write(c, i, 0xff);
----------- /* Activates video std autodetection for all standards */
----------- tvp5150_write(c, TVP5150_AUTOSW_MSK, 0x0);
+++++++++++ /* Load Ram Table */
+++++++++++ while (regs->reg != (u16)-1 ) {
+++++++++++ tvp5150_write(c, TVP5150_CONF_RAM_ADDR_HIGH,regs->reg>>8);
+++++++++++ tvp5150_write(c, TVP5150_CONF_RAM_ADDR_LOW,regs->reg);
----------- /* Default format: 0x47, 4:2:2: 0x40 */
----------- tvp5150_write(c, TVP5150_DATA_RATE_SEL, 0x47);
+++++++++++ for (i=0;i<16;i++)
+++++++++++ tvp5150_write(c, TVP5150_VDP_CONF_RAM_DATA,regs->values[i]);
----------- tvp5150_selmux(c, decoder->input);
+++++++++++ regs++;
+++++++++++ }
+++++++++++ return 0;
+++++++++++}
+ + ++++ ++
- - - tvp5150_write(c, TVP5150_CHROMA_PROC_CTL_1, 0x0c);
- - - tvp5150_write(c, TVP5150_CHROMA_PROC_CTL_2, 0x54);
+++++++++++static int tvp5150_set_std(struct i2c_client *c, v4l2_std_id std)
+++++++++++{
+++++++++++ struct tvp5150 *decoder = i2c_get_clientdata(c);
+++++++++++ int fmt=0;
+++++++++++
+++++++++++ decoder->norm=std;
+++++++++++
+++++++++++ /* First tests should be against specific std */
+++++++++++
+++++++++++ if (std == V4L2_STD_ALL) {
+++++++++++ fmt=0; /* Autodetect mode */
+++++++++++ } else if (std & V4L2_STD_NTSC_443) {
+++++++++++ fmt=0xa;
+++++++++++ } else if (std & V4L2_STD_PAL_M) {
+++++++++++ fmt=0x6;
+++++++++++ } else if (std & (V4L2_STD_PAL_N| V4L2_STD_PAL_Nc)) {
+++++++++++ fmt=0x8;
+++++++++++ } else {
+++++++++++ /* Then, test against generic ones */
+++++++++++ if (std & V4L2_STD_NTSC) {
+++++++++++ fmt=0x2;
+++++++++++ } else if (std & V4L2_STD_PAL) {
+++++++++++ fmt=0x4;
+++++++++++ } else if (std & V4L2_STD_SECAM) {
+++++++++++ fmt=0xc;
+++++++++++ }
+++++++++++ }
+ + ++++ ++
- - - tvp5150_write(c, 0x27, 0x20); /* ?????????? */
+++++++++++ tvp5150_dbg(1,"Set video std register to %d.\n",fmt);
+++++++++++ tvp5150_write(c, TVP5150_VIDEO_STD, fmt);
+ +++
- - -- tvp5150_write(c, TVP5150_CHROMA_PROC_CTL_1, 0x0c);
- - -- tvp5150_write(c, TVP5150_CHROMA_PROC_CTL_2, 0x54);
- - - tvp5150_write(c, TVP5150_VIDEO_STD, 0x0); /* Auto switch */
+++++++++++ return 0;
+++++++++++}
+ +++
- - -- tvp5150_write(c, 0x27, 0x20); /* ?????????? */
+++++++++++static inline void tvp5150_reset(struct i2c_client *c)
+++++++++++{
+++++++++++ u8 type, ver_656, msb_id, lsb_id, msb_rom, lsb_rom;
+++++++++++ struct tvp5150 *decoder = i2c_get_clientdata(c);
++++++ +
- - -- tvp5150_write(c, TVP5150_VIDEO_STD, 0x0); /* Auto switch */
+++++++++++ type=tvp5150_read(c,TVP5150_AUTOSW_MSK);
+++++++++++ msb_id=tvp5150_read(c,TVP5150_MSB_DEV_ID);
+++++++++++ lsb_id=tvp5150_read(c,TVP5150_LSB_DEV_ID);
+++++++++++ msb_rom=tvp5150_read(c,TVP5150_ROM_MAJOR_VER);
+++++++++++ lsb_rom=tvp5150_read(c,TVP5150_ROM_MINOR_VER);
+++++++++++
+++++++++++ if (type==0xdc) {
+++++++++++ ver_656=tvp5150_read(c,TVP5150_REV_SELECT);
+++++++++++ tvp5150_info("tvp%02x%02xam1 detected 656 version is %d.\n",msb_id, lsb_id,ver_656);
+++++++++++ } else if (type==0xfc) {
+++++++++++ tvp5150_info("tvp%02x%02xa detected.\n",msb_id, lsb_id);
+++++++++++ } else {
+++++++++++ tvp5150_info("unknown tvp%02x%02x chip detected(%d).\n",msb_id,lsb_id,type);
+++++++++++ }
+++++++++++ tvp5150_info("Rom ver is %d.%d\n",msb_rom,lsb_rom);
+ + +
- --- tvp5150_write(c, TVP5150_CHROMA_PROC_CTL_1, 0x0c);
- --- tvp5150_write(c, TVP5150_CHROMA_PROC_CTL_2, 0x54);
+++++++++++ /* Initializes TVP5150 to its default values */
+++++++++++ tvp5150_write_inittab(c, tvp5150_init_default);
++ + ++++
- --- tvp5150_write(c, 0x27, 0x20); /* ?????????? */
+++++++++++ /* Initializes VDP registers */
+++++++++++ tvp5150_vdp_init(c, vbi_ram_default);
+++++++++++
+++++++++++ /* Selects decoder input */
+++++++++++ tvp5150_selmux(c, decoder->input);
++ + ++++
- --- tvp5150_write(c, TVP5150_VIDEO_STD, 0x0); /* Auto switch */
+++++++++++ /* Initializes TVP5150 to stream enabled values */
+++++++++++ tvp5150_write_inittab(c, tvp5150_init_enable);
++ + ++++
+++++++++++ /* Initialize image preferences */
tvp5150_write(c, TVP5150_BRIGHT_CTL, decoder->bright >> 8);
tvp5150_write(c, TVP5150_CONTRAST_CTL, decoder->contrast >> 8);
tvp5150_write(c, TVP5150_SATURATION_CTL, decoder->contrast >> 8);
@@@@@@@@@@@@@ -839,44 -536,12 -536,12 -536,12 -536,12 -536,12 -536,12 -536,12 -536,12 -536,12 -536,12 -536,12 +839,44 @@@@@@@@@@@@@ static int tvp5150_command(struct i2c_c
switch (cmd) {
case 0:
+++++++++++ case VIDIOC_INT_RESET:
case DECODER_INIT:
----------- tvp5150_reset(client);
+++++++++++ tvp5150_reset(c);
+++++++++++ break;
+++++++++++ case VIDIOC_S_STD:
+++++++++++ if (decoder->norm == *(v4l2_std_id *)arg)
+++++++++++ break;
+++++++++++ return tvp5150_set_std(c, *(v4l2_std_id *)arg);
+++++++++++ case VIDIOC_G_STD:
+++++++++++ *(v4l2_std_id *)arg = decoder->norm;
+ + ++++ ++ break;
+ + ++++ ++
+++++++++++#ifdef CONFIG_VIDEO_ADV_DEBUG
+++++++++++ case VIDIOC_INT_G_REGISTER:
+++++++++++ {
+++++++++++ struct v4l2_register *reg = arg;
+++++++++++
+++++++++++ if (reg->i2c_id != I2C_DRIVERID_TVP5150)
+++++++++++ return -EINVAL;
+++++++++++ reg->val = tvp5150_read(c, reg->reg & 0xff);
++ + ++++ break;
+++++++++++ }
+++++++++++
+++++++++++ case VIDIOC_INT_S_REGISTER:
+++++++++++ {
+++++++++++ struct v4l2_register *reg = arg;
+++++++++++
+++++++++++ if (reg->i2c_id != I2C_DRIVERID_TVP5150)
+++++++++++ return -EINVAL;
+++++++++++ if (!capable(CAP_SYS_ADMIN))
+++++++++++ return -EPERM;
+++++++++++ tvp5150_write(c, reg->reg & 0xff, reg->val & 0xff);
++++++ + break;
+++++++++++ }
+++++++++++#endif
+ + +
case DECODER_DUMP:
----------- dump_reg(client);
+++++++++++ dump_reg(c);
break;
case DECODER_GET_CAPABILITIES:
@@@@@@@@@@@@@ -1098,7 -768,7 -769,7 -769,8 -769,7 -769,8 -769,8 -769,8 -768,7 -769,7 -768,7 -768,7 +1098,7 @@@@@@@@@@@@@ static int tvp5150_detect_client(struc
}
if (debug > 1)
----------- dump_reg(client);
- ---
+++++++++++ dump_reg(c);
return 0;
}
@@@@@@@@@@@@@ -1134,10 -800,12 -801,12 -802,12 -801,12 -802,12 -802,12 -802,12 -800,12 -801,12 -800,12 -800,12 +1134,10 @@@@@@@@@@@@@ static int tvp5150_detach_client(struc
/* ----------------------------------------------------------------------- */
static struct i2c_driver driver = {
------ - .owner = THIS_MODULE,
------ - .name = "tvp5150",
------ -
------ - /* FIXME */
------ - .id = I2C_DRIVERID_SAA7110,
------ - .flags = I2C_DF_NOTIFY,
++++++ + .driver = {
++++++ + .name = "tvp5150",
++++++ + },
- - --
- - -- /* FIXME */
- - -- .id = I2C_DRIVERID_SAA7110,
+++++++++++ .id = I2C_DRIVERID_TVP5150,
.attach_adapter = tvp5150_attach_adapter,
.detach_client = tvp5150_detach_client,
diff --cc drivers/media/video/videodev.c
index 078880e,6de5b00,6de5b00,83c49f9,6de5b00,83c49f9,83c49f9,83c49f9,6de5b00,6de5b00,6de5b00,6de5b00..078880e
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@@@@@@@@@@@@ -78,11 -81,11 -81,11 -81,11 -81,11 -81,11 -81,11 -81,11 -81,11 -81,11 -81,11 -81,11 +78,11 @@@@@@@@@@@@@ static struct class video_class =
};
/*
- --- * Active devices
+ +++ * Active devices
*/
- ---
+ +++
static struct video_device *video_device[VIDEO_NUM_DEVICES];
-----------static DECLARE_MUTEX(videodev_lock);
+++++++++++static DEFINE_MUTEX(videodev_lock);
struct video_device* video_devdata(struct file *file)
{
@@@@@@@@@@@@@ -98,18 -101,18 -101,18 -101,18 -101,18 -101,18 -101,18 -101,18 -101,18 -101,18 -101,18 -101,18 +98,18 @@@@@@@@@@@@@ static int video_open(struct inode *ino
int err = 0;
struct video_device *vfl;
struct file_operations *old_fops;
- ---
+ +++
if(minor>=VIDEO_NUM_DEVICES)
return -ENODEV;
----------- down(&videodev_lock);
+++++++++++ mutex_lock(&videodev_lock);
vfl=video_device[minor];
if(vfl==NULL) {
----------- up(&videodev_lock);
+++++++++++ mutex_unlock(&videodev_lock);
request_module("char-major-%d-%d", VIDEO_MAJOR, minor);
----------- down(&videodev_lock);
+++++++++++ mutex_lock(&videodev_lock);
vfl=video_device[minor];
if (vfl==NULL) {
----------- up(&videodev_lock);
+++++++++++ mutex_unlock(&videodev_lock);
return -ENODEV;
}
}
@@@@@@@@@@@@@ -358,10 -360,10 -360,10 -360,10 -360,10 -360,10 -360,10 -360,10 -360,10 -360,10 -360,10 -360,10 +358,10 @@@@@@@@@@@@@ int video_register_device(struct video_
* This unregisters the passed device and deassigns the minor
* number. Future open calls will be met with errors.
*/
- ---
+ +++
void video_unregister_device(struct video_device *vfd)
{
----------- down(&videodev_lock);
+++++++++++ mutex_lock(&videodev_lock);
if(video_device[vfd->minor]!=vfd)
panic("videodev: bad unregister");
diff --cc drivers/media/video/wm8775.c
index 8cb64f8,bbfd55c,a6936ad,a6936ad,a6936ad,a6936ad,a6936ad,a6936ad,bbfd55c,a6936ad,bbfd55c,bbfd55c..8cb64f8
--- a/drivers/media/video/wm8775.c
+++ b/drivers/media/video/wm8775.c
@@@@@@@@@@@@@ -38,6 -39,14 -39,14 -39,14 -39,14 -39,14 -39,14 -39,14 -39,14 -39,14 -39,14 -39,14 +38,6 @@@@@@@@@@@@@ MODULE_DESCRIPTION("wm8775 driver")
MODULE_AUTHOR("Ulf Eklund, Hans Verkuil");
MODULE_LICENSE("GPL");
-----------#define wm8775_err(fmt, arg...) do { \
- - -- printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------#define wm8775_info(fmt, arg...) do { \
- - -- printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->driver.name, \
------ - printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \
----------- i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
-----------
-----------
static unsigned short normal_i2c[] = { 0x36 >> 1, I2C_CLIENT_END };
@@@@@@@@@@@@@ -173,9 -167,10 -167,11 -167,11 -167,11 -167,11 -167,11 -167,11 -167,10 -167,11 -167,10 -167,10 +173,9 @@@@@@@@@@@@@ static int wm8775_attach(struct i2c_ada
client->addr = address;
client->adapter = adapter;
client->driver = &i2c_driver;
------ - client->flags = I2C_CLIENT_ALLOW_USE;
snprintf(client->name, sizeof(client->name) - 1, "wm8775");
----------- wm8775_info("chip found @ 0x%x (%s)\n", address << 1, adapter->name);
+++++++++++ v4l_info(client, "chip found @ 0x%x (%s)\n", address << 1, adapter->name);
state = kmalloc(sizeof(struct wm8775_state), GFP_KERNEL);
if (state == NULL) {
@@@@@@@@@@@@@ -233,13 -232,15 -233,15 -233,15 -233,15 -233,15 -233,15 -233,15 -232,15 -233,15 -232,15 -232,15 +233,13 @@@@@@@@@@@@@ static int wm8775_detach(struct i2c_cli
/* i2c implementation */
static struct i2c_driver i2c_driver = {
------ - .name = "wm8775",
------ -
------ - .id = I2C_DRIVERID_WM8775,
------ - .flags = I2C_DF_NOTIFY,
------ -
++++++ + .driver = {
++++++ + .name = "wm8775",
++++++ + },
- - --
- - -- .id = I2C_DRIVERID_WM8775,
- - --
+++++++++++ .id = I2C_DRIVERID_WM8775,
.attach_adapter = wm8775_probe,
----------- .detach_client = wm8775_detach,
----------- .command = wm8775_command,
------ - .owner = THIS_MODULE,
+++++++++++ .detach_client = wm8775_detach,
+++++++++++ .command = wm8775_command,
};
diff --cc drivers/message/fusion/lsi/mpi_log_fc.h
index dc98d46,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..dc98d46
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/message/fusion/lsi/mpi_log_fc.h
+++ b/drivers/message/fusion/lsi/mpi_log_fc.h
diff --cc drivers/message/fusion/lsi/mpi_log_sas.h
index 9259d1a,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..9259d1a
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/message/fusion/lsi/mpi_log_sas.h
+++ b/drivers/message/fusion/lsi/mpi_log_sas.h
diff --cc drivers/message/fusion/mptbase.c
index d890b2b,5378360,4262a22,65c2ec5,4262a22,65c2ec5,65c2ec5,65c2ec5,5378360,4262a22,5378360,5378360..d890b2b
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@@@@@@@@@@@@ -1243,9 -1245,7 -1245,7 -1186,6 -1245,7 -1186,6 -1186,6 -1186,6 -1245,7 -1245,7 -1245,7 -1245,7 +1243,9 @@@@@@@@@@@@@ mpt_attach(struct pci_dev *pdev, const
ioc->pcidev = pdev;
ioc->diagPending = 0;
spin_lock_init(&ioc->diagLock);
+++++++++++ spin_lock_init(&ioc->fc_rescan_work_lock);
+++++++++++ spin_lock_init(&ioc->fc_rport_lock);
+ +++ spin_lock_init(&ioc->initializing_hba_lock);
/* Initialize the event logging.
*/
@@@@@@@@@@@@@ -1378,13 -1374,9 -1374,9 -1314,9 -1374,9 -1314,9 -1314,9 -1314,9 -1374,9 -1374,9 -1374,9 -1374,9 +1378,13 @@@@@@@@@@@@@
ioc->bus_type = FC;
ioc->errata_flag_1064 = 1;
}
+++++++++++ else if (pdev->device == MPI_MANUFACTPAGE_DEVICEID_FC949E) {
+++++++++++ ioc->prod_name = "LSIFC949E";
+++++++++++ ioc->bus_type = FC;
+++++++++++ }
else if (pdev->device == MPI_MANUFACTPAGE_DEVID_53C1030) {
ioc->prod_name = "LSI53C1030";
------ - ioc->bus_type = SCSI;
++++++ + ioc->bus_type = SPI;
/* 1030 Chip Fix. Disable Split transactions
* for PCIX. Set MOST bits to zero if Rev < C0( = 8).
*/
@@@@@@@@@@@@@ -6382,8 -6357,7 -6357,7 -6298,6 -6357,7 -6298,6 -6298,6 -6298,6 -6357,7 -6357,7 -6357,7 -6357,7 +6382,8 @@@@@@@@@@@@@ EXPORT_SYMBOL(mpt_read_ioc_pg_3)
EXPORT_SYMBOL(mpt_alloc_fw_memory);
EXPORT_SYMBOL(mpt_free_fw_memory);
EXPORT_SYMBOL(mptbase_sas_persist_operation);
+ +++ EXPORT_SYMBOL(mpt_alt_ioc_wait);
+++++++++++EXPORT_SYMBOL(mptbase_GetFcPortPage0);
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
diff --cc drivers/message/fusion/mptbase.h
index 47053ac,6c48d1f,bac8eb4,5f5b3fb,bac8eb4,5f5b3fb,5f5b3fb,5f5b3fb,6c48d1f,bac8eb4,6c48d1f,6c48d1f..47053ac
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@@@@@@@@@@@@ -76,8 -76,8 -76,8 -76,8 -76,8 -76,8 -76,8 -76,8 -76,8 -76,8 -76,8 -76,8 +76,8 @@@@@@@@@@@@@
#define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR
#endif
- - --#define MPT_LINUX_VERSION_COMMON "3.03.05"
- - --#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.05"
------ - #define MPT_LINUX_VERSION_COMMON "3.03.04"
------ - #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.04"
+++++++++++#define MPT_LINUX_VERSION_COMMON "3.03.06"
+++++++++++#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.06"
#define WHAT_MAGIC_STRING "@" "(" "#" ")"
#define show_mptmod_ver(s,ver) \
@@@@@@@@@@@@@ -1024,8 -999,7 -1003,7 -1001,6 -1003,7 -1001,6 -1001,6 -1001,6 -999,7 -1003,7 -999,7 -999,7 +1024,8 @@@@@@@@@@@@@ extern void mpt_free_fw_memory(MPT_ADA
extern int mpt_findImVolumes(MPT_ADAPTER *ioc);
extern int mpt_read_ioc_pg_3(MPT_ADAPTER *ioc);
extern int mptbase_sas_persist_operation(MPT_ADAPTER *ioc, u8 persist_opcode);
+++++++++++extern int mptbase_GetFcPortPage0(MPT_ADAPTER *ioc, int portnum);
+ +++ extern int mpt_alt_ioc_wait(MPT_ADAPTER *ioc);
/*
* Public data decl's...
diff --cc drivers/message/fusion/mptfc.c
index b102c76,ba61e18,a628be9,a628be9,a628be9,a628be9,a628be9,a628be9,ba61e18,a628be9,ba61e18,ba61e18..b102c76
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@@@@@@@@@@@@ -93,24 -83,17 -83,14 -83,14 -83,14 -83,14 -83,14 -83,14 -83,17 -83,14 -83,17 -83,17 +93,24 @@@@@@@@@@@@@ static int mptfcDoneCtx = -1
static int mptfcTaskCtx = -1;
static int mptfcInternalCtx = -1; /* Used only for internal commands */
+++++++++++int mptfc_slave_alloc(struct scsi_device *device);
+++++++++++static int mptfc_qcmd(struct scsi_cmnd *SCpnt,
+++++++++++ void (*done)(struct scsi_cmnd *));
+++++++++++
+++++++++++static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout);
+++++++++++static void __devexit mptfc_remove(struct pci_dev *pdev);
+++++++++++
static struct scsi_host_template mptfc_driver_template = {
++++++ + .module = THIS_MODULE,
.proc_name = "mptfc",
.proc_info = mptscsih_proc_info,
.name = "MPT FC Host",
.info = mptscsih_info,
----------- .queuecommand = mptscsih_qcmd,
------ - .slave_alloc = mptscsih_slave_alloc,
+++++++++++ .queuecommand = mptfc_qcmd,
++++++ + .target_alloc = mptscsih_target_alloc,
- - -- .slave_alloc = mptscsih_slave_alloc,
+++++++++++ .slave_alloc = mptfc_slave_alloc,
.slave_configure = mptscsih_slave_configure,
++++++ + .target_destroy = mptscsih_target_destroy,
.slave_destroy = mptscsih_slave_destroy,
.change_queue_depth = mptscsih_change_queue_depth,
.eh_abort_handler = mptscsih_abort,
@@@@@@@@@@@@@ -678,12 -203,10 -198,9 -198,9 -198,9 -198,9 -198,9 -198,9 -203,10 -198,9 -203,10 -203,10 +678,12 @@@@@@@@@@@@@ mptfc_probe(struct pci_dev *pdev, cons
printk(MYIOC_s_WARN_FMT
"Unable to register controller with SCSI subsystem\n",
ioc->name);
------ - return -1;
++++++ + error = -1;
++++++ + goto out_mptfc_probe;
}
+++++++++++ INIT_WORK(&ioc->fc_rescan_work, mptfc_rescan_devices,(void *)ioc);
+++++++++++
spin_lock_irqsave(&ioc->FreeQlock, flags);
/* Attach the SCSI Host to the IOC structure
@@@@@@@@@@@@@ -745,27 -268,36 -262,36 -262,36 -262,36 -262,36 -262,36 -262,36 -268,36 -262,36 -268,36 -268,36 +745,27 @@@@@@@@@@@@@
/* SCSI needs scsi_cmnd lookup table!
* (with size equal to req_depth*PtrSz!)
*/
----------- sz = ioc->req_depth * sizeof(void *);
----------- mem = kmalloc(sz, GFP_ATOMIC);
----------- if (mem == NULL) {
+++++++++++ hd->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC);
+++++++++++ if (!hd->ScsiLookup) {
error = -ENOMEM;
------ - goto mptfc_probe_failed;
++++++ + goto out_mptfc_probe;
}
----------- memset(mem, 0, sz);
----------- hd->ScsiLookup = (struct scsi_cmnd **) mem;
-----------
----------- dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n",
----------- ioc->name, hd->ScsiLookup, sz));
+++++++++++ dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p\n",
+++++++++++ ioc->name, hd->ScsiLookup));
/* Allocate memory for the device structures.
* A non-Null pointer at an offset
* indicates a device exists.
* max_id = 1 + maximum id (hosts.h)
*/
----------- sz = sh->max_id * sizeof(void *);
----------- mem = kmalloc(sz, GFP_ATOMIC);
----------- if (mem == NULL) {
+++++++++++ hd->Targets = kcalloc(sh->max_id, sizeof(void *), GFP_ATOMIC);
+++++++++++ if (!hd->Targets) {
error = -ENOMEM;
------ - goto mptfc_probe_failed;
++++++ + goto out_mptfc_probe;
}
----------- memset(mem, 0, sz);
- - -- hd->Targets = (VirtTarget **) mem;
------ - hd->Targets = (VirtDevice **) mem;
-----------
----------- dprintk((KERN_INFO
- - -- " vdev @ %p, sz=%d\n", hd->Targets, sz));
------ - " Targets @ %p, sz=%d\n", hd->Targets, sz));
+++++++++++ dprintk((KERN_INFO " vdev @ %p\n", hd->Targets));
/* Clear the TM flags
*/
@@@@@@@@@@@@@ -805,17 -336,13 -330,13 -330,13 -330,13 -330,13 -330,13 -330,13 -336,13 -330,13 -336,13 -336,13 +805,17 @@@@@@@@@@@@@
if(error) {
dprintk((KERN_ERR MYNAM
"scsi_add_host failed\n"));
------ - goto mptfc_probe_failed;
++++++ + goto out_mptfc_probe;
++++++ + }
++++++ +
- - -- scsi_scan_host(sh);
+++++++++++ for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) {
+++++++++++ mptfc_init_host_attr(ioc,ii);
+++++++++++ mptfc_GetFcDevPage0(ioc,ii,mptfc_register_dev);
+ + ++ }
+ + ++
------ - scsi_scan_host(sh);
return 0;
------ - mptfc_probe_failed:
++++++ + out_mptfc_probe:
mptscsih_remove(pdev);
return error;
diff --cc drivers/message/fusion/mptsas.c
index 5a06d8d,17e9757,e0a8bb8,e0a8bb8,e0a8bb8,e0a8bb8,e0a8bb8,e0a8bb8,17e9757,e0a8bb8,17e9757,17e9757..5a06d8d
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@@@@@@@@@@@@ -253,48 -234,37 -234,33 -234,33 -234,33 -234,33 -234,33 -234,33 -234,37 -234,33 -234,37 -234,37 +253,48 @@@@@@@@@@@@@ mptsas_slave_alloc(struct scsi_device *
MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata;
struct sas_rphy *rphy;
struct mptsas_portinfo *p;
++++++ + VirtTarget *vtarget;
VirtDevice *vdev;
------ - uint target = device->id;
++++++ + struct scsi_target *starget;
int i;
------ - if ((vdev = hd->Targets[target]) != NULL)
------ - goto out;
------ -
----------- vdev = kmalloc(sizeof(VirtDevice), GFP_KERNEL);
+++++++++++ vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
if (!vdev) {
printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n",
hd->ioc->name, sizeof(VirtDevice));
return -ENOMEM;
}
------ -
----------- memset(vdev, 0, sizeof(VirtDevice));
------ - vdev->tflags = MPT_TARGET_FLAGS_Q_YES|MPT_TARGET_FLAGS_VALID_INQUIRY;
vdev->ioc_id = hd->ioc->id;
++++++ + sdev->hostdata = vdev;
++++++ + starget = scsi_target(sdev);
++++++ + vtarget = starget->hostdata;
++++++ + vdev->vtarget = vtarget;
++++++ + if (vtarget->num_luns == 0) {
++++++ + vtarget->tflags = MPT_TARGET_FLAGS_Q_YES|MPT_TARGET_FLAGS_VALID_INQUIRY;
++++++ + hd->Targets[sdev->id] = vtarget;
++++++ + }
------ - rphy = dev_to_rphy(device->sdev_target->dev.parent);
+++++++++++ /*
+++++++++++ RAID volumes placed beyond the last expected port.
+++++++++++ */
+++++++++++ if (sdev->channel == hd->ioc->num_ports) {
+++++++++++ vdev->target_id = sdev->id;
+++++++++++ vdev->bus_id = 0;
+++++++++++ vdev->lun = 0;
+++++++++++ goto out;
+++++++++++ }
+++++++++++
++++++ + rphy = dev_to_rphy(sdev->sdev_target->dev.parent);
+++++++++++ mutex_lock(&hd->ioc->sas_topology_mutex);
list_for_each_entry(p, &hd->ioc->sas_topology, list) {
for (i = 0; i < p->num_phys; i++) {
if (p->phy_info[i].attached.sas_address ==
rphy->identify.sas_address) {
vdev->target_id =
----------- p->phy_info[i].attached.target;
----------- vdev->bus_id = p->phy_info[i].attached.bus;
------ - hd->Targets[device->id] = vdev;
+++++++++++ p->phy_info[i].attached.id;
+++++++++++ vdev->bus_id = p->phy_info[i].attached.channel;
++++++ + vdev->lun = sdev->lun;
+++++++++++ mutex_unlock(&hd->ioc->sas_topology_mutex);
goto out;
}
}
@@@@@@@@@@@@@ -313,54 -282,18 -276,15 -276,15 -276,15 -276,15 -276,15 -276,15 -282,18 -276,15 -282,18 -282,18 +313,54 @@@@@@@@@@@@@
return 0;
}
+++++++++++static void
+++++++++++mptsas_slave_destroy(struct scsi_device *sdev)
+++++++++++{
+++++++++++ struct Scsi_Host *host = sdev->host;
+++++++++++ MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata;
+++++++++++ struct sas_rphy *rphy;
+++++++++++ struct mptsas_portinfo *p;
+++++++++++ int i;
+++++++++++
+++++++++++ /*
+++++++++++ * Handle hotplug removal case.
+++++++++++ * We need to clear out attached data structure.
+++++++++++ */
+++++++++++ rphy = dev_to_rphy(sdev->sdev_target->dev.parent);
+++++++++++
+++++++++++ mutex_lock(&hd->ioc->sas_topology_mutex);
+++++++++++ list_for_each_entry(p, &hd->ioc->sas_topology, list) {
+++++++++++ for (i = 0; i < p->num_phys; i++) {
+++++++++++ if (p->phy_info[i].attached.sas_address ==
+++++++++++ rphy->identify.sas_address) {
+++++++++++ memset(&p->phy_info[i].attached, 0,
+++++++++++ sizeof(struct mptsas_devinfo));
+++++++++++ p->phy_info[i].rphy = NULL;
+++++++++++ goto out;
+++++++++++ }
+++++++++++ }
+++++++++++ }
+++++++++++
+++++++++++ out:
+++++++++++ mutex_unlock(&hd->ioc->sas_topology_mutex);
+++++++++++ /*
+++++++++++ * TODO: Issue target reset to flush firmware outstanding commands.
+++++++++++ */
+++++++++++ mptscsih_slave_destroy(sdev);
+++++++++++}
+++++++++++
static struct scsi_host_template mptsas_driver_template = {
++++++ + .module = THIS_MODULE,
.proc_name = "mptsas",
.proc_info = mptscsih_proc_info,
.name = "MPT SPI Host",
.info = mptscsih_info,
.queuecommand = mptscsih_qcmd,
++++++ + .target_alloc = mptscsih_target_alloc,
.slave_alloc = mptsas_slave_alloc,
.slave_configure = mptscsih_slave_configure,
------ - .slave_destroy = mptscsih_slave_destroy,
++++++ + .target_destroy = mptscsih_target_destroy,
- - -- .slave_destroy = mptscsih_slave_destroy,
+++++++++++ .slave_destroy = mptsas_slave_destroy,
.change_queue_depth = mptscsih_change_queue_depth,
.eh_abort_handler = mptscsih_abort,
.eh_device_reset_handler = mptscsih_dev_reset,
@@@@@@@@@@@@@ -1061,11 -994,7 -985,8 -985,8 -985,8 -985,8 -985,8 -985,8 -994,7 -985,8 -994,7 -994,7 +1061,11 @@@@@@@@@@@@@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc
if (error)
goto out_free_port_info;
+++++++++++ ioc->num_ports = port_info->num_phys;
+++++++++++ mutex_lock(&ioc->sas_topology_mutex);
list_add_tail(&port_info->list, &ioc->sas_topology);
+++++++++++ mutex_unlock(&ioc->sas_topology_mutex);
+ + ++
for (i = 0; i < port_info->num_phys; i++) {
mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i],
(MPI_SAS_PHY_PGAD_FORM_PHY_NUMBER <<
@@@@@@@@@@@@@ -1525,27 -1244,36 -1233,36 -1233,36 -1233,36 -1233,36 -1233,36 -1233,36 -1244,36 -1233,36 -1244,36 -1244,36 +1525,27 @@@@@@@@@@@@@ mptsas_probe(struct pci_dev *pdev, cons
/* SCSI needs scsi_cmnd lookup table!
* (with size equal to req_depth*PtrSz!)
*/
----------- sz = ioc->req_depth * sizeof(void *);
----------- mem = kmalloc(sz, GFP_ATOMIC);
----------- if (mem == NULL) {
+++++++++++ hd->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC);
+++++++++++ if (!hd->ScsiLookup) {
error = -ENOMEM;
------ - goto mptsas_probe_failed;
++++++ + goto out_mptsas_probe;
}
----------- memset(mem, 0, sz);
----------- hd->ScsiLookup = (struct scsi_cmnd **) mem;
-----------
----------- dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n",
----------- ioc->name, hd->ScsiLookup, sz));
+++++++++++ dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p\n",
+++++++++++ ioc->name, hd->ScsiLookup));
/* Allocate memory for the device structures.
* A non-Null pointer at an offset
* indicates a device exists.
* max_id = 1 + maximum id (hosts.h)
*/
----------- sz = sh->max_id * sizeof(void *);
----------- mem = kmalloc(sz, GFP_ATOMIC);
----------- if (mem == NULL) {
+++++++++++ hd->Targets = kcalloc(sh->max_id, sizeof(void *), GFP_ATOMIC);
+++++++++++ if (!hd->Targets) {
error = -ENOMEM;
------ - goto mptsas_probe_failed;
++++++ + goto out_mptsas_probe;
}
----------- memset(mem, 0, sz);
- - -- hd->Targets = (VirtTarget **) mem;
------ - hd->Targets = (VirtDevice **) mem;
-----------
----------- dprintk((KERN_INFO
- - -- " vtarget @ %p, sz=%d\n", hd->Targets, sz));
------ - " Targets @ %p, sz=%d\n", hd->Targets, sz));
+++++++++++ dprintk((KERN_INFO " vtarget @ %p\n", hd->Targets));
/* Clear the TM flags
*/
@@@@@@@@@@@@@ -1596,23 -1324,9 -1313,9 -1313,9 -1313,9 -1313,9 -1313,9 -1313,9 -1324,9 -1313,9 -1324,9 -1324,9 +1596,23 @@@@@@@@@@@@@
mptsas_scan_sas_topology(ioc);
+++++++++++ /*
+++++++++++ Reporting RAID volumes.
+++++++++++ */
+++++++++++ if (!ioc->raid_data.pIocPg2)
+++++++++++ return 0;
+++++++++++ if (!ioc->raid_data.pIocPg2->NumActiveVolumes)
+++++++++++ return 0;
+++++++++++ for (ii=0;ii<ioc->raid_data.pIocPg2->NumActiveVolumes;ii++) {
+++++++++++ scsi_add_device(sh,
+++++++++++ ioc->num_ports,
+++++++++++ ioc->raid_data.pIocPg2->RaidVolume[ii].VolumeID,
+++++++++++ 0);
+++++++++++ }
+++++++++++
return 0;
------ - mptsas_probe_failed:
++++++ + out_mptsas_probe:
mptscsih_remove(pdev);
return error;
diff --cc drivers/message/fusion/mptscsih.c
index cdac557,93a16fa,b7b9846,4330ed0,b7b9846,4330ed0,4330ed0,4330ed0,93a16fa,b7b9846,93a16fa,93a16fa..cdac557
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@@@@@@@@@@@@ -893,9 -893,8 -892,9 -892,9 -892,9 -892,9 -892,9 -892,9 -893,8 -892,9 -893,8 -893,8 +893,9 @@@@@@@@@@@@@ mptscsih_flush_running_cmds(MPT_SCSI_HO
* when a lun is disable by mid-layer.
* Do NOT access the referenced scsi_cmnd structure or
* members. Will cause either a paging or NULL ptr error.
------ - * @hd: Pointer to a SCSI HOST structure
------ - * @target: target id
------ - * @lun: lun
+++++++++++ * (BUT, BUT, BUT, the code does reference it! - mdr)
++++++ + * @hd: Pointer to a SCSI HOST structure
++++++ + * @vdevice: per device private data
*
* Returns: None.
*
@@@@@@@@@@@@@ -2155,70 -2154,72 -2151,51 -2151,51 -2151,51 -2151,51 -2151,51 -2151,51 -2154,72 -2151,51 -2154,72 -2154,72 +2155,70 @@@@@@@@@@@@@ mptscsih_bios_param(struct scsi_device
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
* OS entry point to allow host driver to alloc memory
++++++ + * for each scsi target. Called once per device the bus scan.
++++++ + * Return non-zero if allocation fails.
++++++ + */
++++++ + int
++++++ + mptscsih_target_alloc(struct scsi_target *starget)
++++++ + {
++++++ + VirtTarget *vtarget;
++++++ +
- - -- vtarget = kmalloc(sizeof(VirtTarget), GFP_KERNEL);
+++++++++++ vtarget = kzalloc(sizeof(VirtTarget), GFP_KERNEL);
++++++ + if (!vtarget)
++++++ + return -ENOMEM;
- - -- memset(vtarget, 0, sizeof(VirtTarget));
++++++ + starget->hostdata = vtarget;
++++++ + return 0;
++++++ + }
++++++ +
++++++ + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
++++++ + /*
++++++ + * OS entry point to allow host driver to alloc memory
* for each scsi device. Called once per device the bus scan.
* Return non-zero if allocation fails.
------ - * Init memory once per id (not LUN).
*/
int
------ - mptscsih_slave_alloc(struct scsi_device *device)
++++++ + mptscsih_slave_alloc(struct scsi_device *sdev)
{
------ - struct Scsi_Host *host = device->host;
++++++ + struct Scsi_Host *host = sdev->host;
MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata;
++++++ + VirtTarget *vtarget;
VirtDevice *vdev;
------ - uint target = device->id;
------ -
------ - if (hd == NULL)
------ - return -ENODEV;
++++++ + struct scsi_target *starget;
------ - if ((vdev = hd->Targets[target]) != NULL)
------ - goto out;
------ -
----------- vdev = kmalloc(sizeof(VirtDevice), GFP_KERNEL);
+++++++++++ vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
if (!vdev) {
printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n",
hd->ioc->name, sizeof(VirtDevice));
return -ENOMEM;
}
----------- memset(vdev, 0, sizeof(VirtDevice));
------ - vdev->tflags = MPT_TARGET_FLAGS_Q_YES;
vdev->ioc_id = hd->ioc->id;
------ - vdev->target_id = device->id;
------ - vdev->bus_id = device->channel;
------ - vdev->raidVolume = 0;
------ - hd->Targets[device->id] = vdev;
------ - if (hd->ioc->bus_type == SCSI) {
------ - if (hd->ioc->raid_data.isRaid & (1 << device->id)) {
------ - vdev->raidVolume = 1;
------ - ddvtprintk((KERN_INFO
------ - "RAID Volume @ id %d\n", device->id));
++++++ + vdev->target_id = sdev->id;
++++++ + vdev->bus_id = sdev->channel;
++++++ + vdev->lun = sdev->lun;
++++++ + sdev->hostdata = vdev;
++++++ +
++++++ + starget = scsi_target(sdev);
++++++ + vtarget = starget->hostdata;
++++++ + vdev->vtarget = vtarget;
++++++ +
++++++ + if (vtarget->num_luns == 0) {
++++++ + hd->Targets[sdev->id] = vtarget;
++++++ + vtarget->ioc_id = hd->ioc->id;
++++++ + vtarget->tflags = MPT_TARGET_FLAGS_Q_YES;
++++++ + vtarget->target_id = sdev->id;
++++++ + vtarget->bus_id = sdev->channel;
++++++ + if (hd->ioc->bus_type == SPI) {
++++++ + if (hd->ioc->raid_data.isRaid & (1 << sdev->id)) {
++++++ + vtarget->raidVolume = 1;
++++++ + ddvtprintk((KERN_INFO
++++++ + "RAID Volume @ id %d\n", sdev->id));
++++++ + }
++++++ + } else {
++++++ + vtarget->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY;
}
------ - } else {
------ - vdev->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY;
}
------ -
------ - out:
------ - vdev->num_luns++;
------ - device->hostdata = vdev;
++++++ + vtarget->num_luns++;
return 0;
}
@@@@@@@@@@@@@ -2558,9 -2559,9 -2532,9 -2532,9 -2532,9 -2532,9 -2532,9 -2532,9 -2559,9 -2532,9 -2559,9 -2559,9 +2558,9 @@@@@@@@@@@@@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, in
hd->cmdPtr = NULL;
}
----------- /* 7. Set flag to force DV and re-read IOC Page 3
+++++++++++ /* 7. SPI: Set flag to force DV and re-read IOC Page 3
*/
------ - if (ioc->bus_type == SCSI) {
++++++ + if (ioc->bus_type == SPI) {
ioc->spi_data.forceDv = MPT_SCSICFG_NEED_DV | MPT_SCSICFG_RELOAD_IOC_PG3;
ddvtprintk(("Set reload IOC Pg3 Flag\n"));
}
@@@@@@@@@@@@@ -2719,68 -2699,68 -2674,75 -2674,75 -2674,75 -2674,75 -2674,75 -2674,75 -2699,68 -2674,75 -2699,68 -2699,68 +2719,68 @@@@@@@@@@@@@ mptscsih_initTarget(MPT_SCSI_HOST *hd,
if (data[0] & 0xe0)
return;
------ - if ((vdev = hd->Targets[target_id]) == NULL) {
++++++ + if (vtarget == NULL)
return;
------ - }
------ - lun_index = (lun >> 5); /* 32 luns per lun_index */
------ - indexed_lun = (lun % 32);
------ - vdev->luns[lun_index] |= (1 << indexed_lun);
------ -
------ - if (hd->ioc->bus_type == SCSI) {
------ - if ((data[0] == TYPE_PROCESSOR) && (hd->ioc->spi_data.Saf_Te)) {
------ - /* Treat all Processors as SAF-TE if
------ - * command line option is set */
------ - vdev->tflags |= MPT_TARGET_FLAGS_SAF_TE_ISSUED;
------ - mptscsih_writeIOCPage4(hd, target_id, bus_id);
------ - }else if ((data[0] == TYPE_PROCESSOR) &&
------ - !(vdev->tflags & MPT_TARGET_FLAGS_SAF_TE_ISSUED )) {
------ - if ( dlen > 49 ) {
------ - vdev->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY;
------ - if ( data[44] == 'S' &&
------ - data[45] == 'A' &&
------ - data[46] == 'F' &&
------ - data[47] == '-' &&
------ - data[48] == 'T' &&
------ - data[49] == 'E' ) {
------ - vdev->tflags |= MPT_TARGET_FLAGS_SAF_TE_ISSUED;
------ - mptscsih_writeIOCPage4(hd, target_id, bus_id);
------ - }
++++++ + if (data)
++++++ + vtarget->type = data[0];
++++++ +
++++++ + if (hd->ioc->bus_type != SPI)
++++++ + return;
++++++ +
++++++ + if ((data[0] == TYPE_PROCESSOR) && (hd->ioc->spi_data.Saf_Te)) {
++++++ + /* Treat all Processors as SAF-TE if
++++++ + * command line option is set */
++++++ + vtarget->tflags |= MPT_TARGET_FLAGS_SAF_TE_ISSUED;
++++++ + mptscsih_writeIOCPage4(hd, vtarget->target_id, vtarget->bus_id);
++++++ + }else if ((data[0] == TYPE_PROCESSOR) &&
++++++ + !(vtarget->tflags & MPT_TARGET_FLAGS_SAF_TE_ISSUED )) {
++++++ + if ( dlen > 49 ) {
++++++ + vtarget->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY;
++++++ + if ( data[44] == 'S' &&
++++++ + data[45] == 'A' &&
++++++ + data[46] == 'F' &&
++++++ + data[47] == '-' &&
++++++ + data[48] == 'T' &&
++++++ + data[49] == 'E' ) {
++++++ + vtarget->tflags |= MPT_TARGET_FLAGS_SAF_TE_ISSUED;
++++++ + mptscsih_writeIOCPage4(hd, vtarget->target_id, vtarget->bus_id);
}
}
------ - if (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY)) {
------ - if ( dlen > 8 ) {
------ - memcpy (vdev->inq_data, data, 8);
------ - } else {
------ - memcpy (vdev->inq_data, data, dlen);
------ - }
++++++ + }
++++++ + if (!(vtarget->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY)) {
++++++ + inq_len = dlen < 8 ? dlen : 8;
++++++ + memcpy (vtarget->inq_data, data, inq_len);
++++++ + /* If have not done DV, set the DV flag.
++++++ + */
++++++ + pSpi = &hd->ioc->spi_data;
++++++ + if ((data[0] == TYPE_TAPE) || (data[0] == TYPE_PROCESSOR)) {
++++++ + if (pSpi->dvStatus[vtarget->target_id] & MPT_SCSICFG_DV_NOT_DONE)
++++++ + pSpi->dvStatus[vtarget->target_id] |= MPT_SCSICFG_NEED_DV;
++++++ + }
++++++ + vtarget->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY;
------ - /* If have not done DV, set the DV flag.
++++++ + data_56 = 0x0F; /* Default to full capabilities if Inq data length is < 57 */
++++++ + if (dlen > 56) {
++++++ + if ( (!(vtarget->tflags & MPT_TARGET_FLAGS_VALID_56))) {
++++++ + /* Update the target capabilities
*/
------ - pSpi = &hd->ioc->spi_data;
------ - if ((data[0] == TYPE_TAPE) || (data[0] == TYPE_PROCESSOR)) {
------ - if (pSpi->dvStatus[target_id] & MPT_SCSICFG_DV_NOT_DONE)
------ - pSpi->dvStatus[target_id] |= MPT_SCSICFG_NEED_DV;
- --- }
- ---
- --- vdev->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY;
- ---
- ---
- --- data_56 = 0x0F; /* Default to full capabilities if Inq data length is < 57 */
- --- if (dlen > 56) {
- --- if ( (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_56))) {
- --- /* Update the target capabilities
- --- */
- --- data_56 = data[56];
- --- vdev->tflags |= MPT_TARGET_FLAGS_VALID_56;
- --- }
++++++ + data_56 = data[56];
++++++ + vtarget->tflags |= MPT_TARGET_FLAGS_VALID_56;
}
- - -
- - - vdev->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY;
- - -
- - -
- - - data_56 = 0x0F; /* Default to full capabilities if Inq data length is < 57 */
- - - if (dlen > 56) {
- - - if ( (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_56))) {
- - - /* Update the target capabilities
- - - */
- - - data_56 = data[56];
- - - vdev->tflags |= MPT_TARGET_FLAGS_VALID_56;
- - - }
- - - }
------ - mptscsih_setTargetNegoParms(hd, vdev, data_56);
------ - } else {
------ - /* Initial Inquiry may not request enough data bytes to
------ - * obtain byte 57. DV will; if target doesn't return
------ - * at least 57 bytes, data[56] will be zero. */
------ - if (dlen > 56) {
------ - if ( (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_56))) {
------ - /* Update the target capabilities
------ - */
------ - data_56 = data[56];
------ - vdev->tflags |= MPT_TARGET_FLAGS_VALID_56;
------ - mptscsih_setTargetNegoParms(hd, vdev, data_56);
------ - }
++++++ + }
++++++ + mptscsih_setTargetNegoParms(hd, vtarget, data_56);
++++++ + } else {
++++++ + /* Initial Inquiry may not request enough data bytes to
++++++ + * obtain byte 57. DV will; if target doesn't return
++++++ + * at least 57 bytes, data[56] will be zero. */
++++++ + if (dlen > 56) {
++++++ + if ( (!(vtarget->tflags & MPT_TARGET_FLAGS_VALID_56))) {
++++++ + /* Update the target capabilities
++++++ + */
++++++ + data_56 = data[56];
++++++ + vtarget->tflags |= MPT_TARGET_FLAGS_VALID_56;
++++++ + mptscsih_setTargetNegoParms(hd, vtarget, data_56);
}
}
}
@@@@@@@@@@@@@ -3916,75 -3896,77 -4014,39 -4014,39 -4014,39 -4014,39 -4014,39 -4014,39 -3896,77 -4014,39 -3896,77 -3896,77 +3916,75 @@@@@@@@@@@@@ mptscsih_negotiate_to_asyn_narrow(MPT_S
pcfg1Data->RequestedParameters = cpu_to_le32(requested);
pcfg1Data->Reserved = 0;
pcfg1Data->Configuration = cpu_to_le32(configuration);
------ - cfg.pageAddr = (bus<<8) | id;
++++++ + cfg.pageAddr = (vtarget->bus_id<<8) | id;
mpt_config(hd->ioc, &cfg);
}
++++++ + } else {
++++++ + flags = vtarget->negoFlags;
++++++ + mptscsih_setDevicePage1Flags(0, MPT_ASYNC, 0, &requested,
++++++ + &configuration, flags);
++++++ + dnegoprintk(("syncronize cache: id=%d width=0 factor=MPT_ASYNC "
++++++ + "offset=0 negoFlags=%x request=%x config=%x\n",
++++++ + vtarget->target_id, flags, requested, configuration));
++++++ + pcfg1Data->RequestedParameters = cpu_to_le32(requested);
++++++ + pcfg1Data->Reserved = 0;
++++++ + pcfg1Data->Configuration = cpu_to_le32(configuration);
++++++ + cfg.pageAddr = (vtarget->bus_id<<8) | vtarget->target_id;
++++++ + mpt_config(hd->ioc, &cfg);
++++++ + }
------ - /* If target Ptr NULL or if this target is NOT a disk, skip.
------ - */
------ - if ((pTarget) && (pTarget->inq_data[0] == TYPE_DISK)){
------ - for (lun=0; lun <= MPT_LAST_LUN; lun++) {
------ - /* If LUN present, issue the command
------ - */
------ - lun_index = (lun >> 5); /* 32 luns per lun_index */
------ - indexed_lun = (lun % 32);
------ - if (pTarget->luns[lun_index] & (1<<indexed_lun)) {
------ - iocmd.lun = lun;
------ - (void) mptscsih_do_cmd(hd, &iocmd);
------ - }
------ - }
------ - }
++++++ + if (pcfg1Data)
++++++ + pci_free_consistent(ioc->pcidev, header.PageLength * 4, pcfg1Data, cfg1_dma_addr);
++++++ + }
------ - /* get next relevant device */
------ - id++;
++++++ + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
++++++ + /**
++++++ + * mptscsih_synchronize_cache - Send SYNCHRONIZE_CACHE to all disks.
++++++ + * @hd: Pointer to a SCSI HOST structure
++++++ + * @vtarget: per device private data
++++++ + * @lun: lun
++++++ + *
++++++ + * Uses the ISR, but with special processing.
++++++ + * MUST be single-threaded.
++++++ + *
++++++ + */
++++++ + static void
++++++ + mptscsih_synchronize_cache(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
++++++ + {
++++++ + INTERNAL_CMD iocmd;
------ - if (id == hostId)
------ - id++;
++++++ + /* Following parameters will not change
++++++ + * in this routine.
++++++ + */
++++++ + iocmd.cmd = SYNCHRONIZE_CACHE;
++++++ + iocmd.flags = 0;
++++++ + iocmd.physDiskNum = -1;
++++++ + iocmd.data = NULL;
++++++ + iocmd.data_dma = -1;
++++++ + iocmd.size = 0;
++++++ + iocmd.rsvd = iocmd.rsvd2 = 0;
++++++ + iocmd.bus = vdevice->bus_id;
++++++ + iocmd.id = vdevice->target_id;
++++++ + iocmd.lun = (u8)vdevice->lun;
------ - if (id > max_id) {
------ - id = 0;
------ - bus++;
------ - }
------ - }
++++++ + if ((vdevice->vtarget->type & TYPE_DISK) &&
++++++ + (vdevice->configured_lun))
++++++ + mptscsih_do_cmd(hd, &iocmd);
++++++ + }
++++++ +
++++++ + /* Search IOC page 3 to determine if this is hidden physical disk
++++++ + */
- - --/* Search IOC page 3 to determine if this is hidden physical disk
- - -- */
++++++ + static int
++++++ + mptscsih_is_phys_disk(MPT_ADAPTER *ioc, int id)
++++++ + {
++++++ + int i;
+ +++
- - - if (pcfg1Data) {
- - - pci_free_consistent(ioc->pcidev, header1.PageLength * 4, pcfg1Data, cfg1_dma_addr);
++++++ + if (!ioc->raid_data.isRaid || !ioc->raid_data.pIocPg3)
++++++ + return 0;
+ + +
- --- if (pcfg1Data) {
- --- pci_free_consistent(ioc->pcidev, header1.PageLength * 4, pcfg1Data, cfg1_dma_addr);
++++++ + for (i = 0; i < ioc->raid_data.pIocPg3->NumPhysDisks; i++) {
++++++ + if (id == ioc->raid_data.pIocPg3->PhysDisk[i].PhysDiskID)
++++++ + return 1;
}
return 0;
diff --cc drivers/message/fusion/mptspi.c
index 7dce292,ce332a6,5c0e307,5c0e307,5c0e307,5c0e307,5c0e307,5c0e307,ce332a6,5c0e307,ce332a6,ce332a6..7dce292
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@@@@@@@@@@@@ -287,27 -288,36 -282,36 -282,36 -282,36 -282,36 -282,36 -282,36 -288,36 -282,36 -288,36 -288,36 +287,27 @@@@@@@@@@@@@ mptspi_probe(struct pci_dev *pdev, cons
/* SCSI needs scsi_cmnd lookup table!
* (with size equal to req_depth*PtrSz!)
*/
----------- sz = ioc->req_depth * sizeof(void *);
----------- mem = kmalloc(sz, GFP_ATOMIC);
----------- if (mem == NULL) {
+++++++++++ hd->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC);
+++++++++++ if (!hd->ScsiLookup) {
error = -ENOMEM;
------ - goto mptspi_probe_failed;
++++++ + goto out_mptspi_probe;
}
----------- memset(mem, 0, sz);
----------- hd->ScsiLookup = (struct scsi_cmnd **) mem;
-----------
----------- dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p, sz=%d\n",
----------- ioc->name, hd->ScsiLookup, sz));
+++++++++++ dprintk((MYIOC_s_INFO_FMT "ScsiLookup @ %p\n",
+++++++++++ ioc->name, hd->ScsiLookup));
/* Allocate memory for the device structures.
* A non-Null pointer at an offset
* indicates a device exists.
* max_id = 1 + maximum id (hosts.h)
*/
----------- sz = sh->max_id * sizeof(void *);
----------- mem = kmalloc(sz, GFP_ATOMIC);
----------- if (mem == NULL) {
+++++++++++ hd->Targets = kcalloc(sh->max_id, sizeof(void *), GFP_ATOMIC);
+++++++++++ if (!hd->Targets) {
error = -ENOMEM;
------ - goto mptspi_probe_failed;
++++++ + goto out_mptspi_probe;
}
----------- memset(mem, 0, sz);
- - -- hd->Targets = (VirtTarget **) mem;
------ - hd->Targets = (VirtDevice **) mem;
-----------
----------- dprintk((KERN_INFO
- - -- " vdev @ %p, sz=%d\n", hd->Targets, sz));
------ - " Targets @ %p, sz=%d\n", hd->Targets, sz));
+++++++++++ dprintk((KERN_INFO " vdev @ %p\n", hd->Targets));
/* Clear the TM flags
*/
diff --cc drivers/mmc/mmc_block.c
index 5b014c3,8e380c1,d91fcf7,d91fcf7,abcf191,d91fcf7,d91fcf7,d91fcf7,8e380c1,d91fcf7,8e380c1,8e380c1..5b014c3
--- a/drivers/mmc/mmc_block.c
+++ b/drivers/mmc/mmc_block.c
@@@@@@@@@@@@@ -304,121 -310,64 -310,59 -310,59 -310,64 -310,59 -310,59 -310,59 -310,64 -310,59 -310,64 -310,64 +304,121 @@@@@@@@@@@@@ static struct mmc_blk_data *mmc_blk_all
__set_bit(devidx, dev_use);
md = kmalloc(sizeof(struct mmc_blk_data), GFP_KERNEL);
----------- if (md) {
----------- memset(md, 0, sizeof(struct mmc_blk_data));
+++++++++++ if (!md) {
+++++++++++ ret = -ENOMEM;
+++++++++++ goto out;
+++++++++++ }
----------- md->disk = alloc_disk(1 << MMC_SHIFT);
----------- if (md->disk == NULL) {
----------- kfree(md);
----------- md = ERR_PTR(-ENOMEM);
----------- goto out;
----------- }
+++++++++++ memset(md, 0, sizeof(struct mmc_blk_data));
----------- spin_lock_init(&md->lock);
----------- md->usage = 1;
+++++++++++ /*
+++++++++++ * Set the read-only status based on the supported commands
+++++++++++ * and the write protect switch.
+++++++++++ */
+++++++++++ md->read_only = mmc_blk_readonly(card);
----------- ret = mmc_init_queue(&md->queue, card, &md->lock);
----------- if (ret) {
----------- put_disk(md->disk);
----------- kfree(md);
----------- md = ERR_PTR(ret);
----------- goto out;
+++++++++++ /*
+++++++++++ * Figure out a workable block size. MMC cards have:
+++++++++++ * - two block sizes, one for read and one for write.
+++++++++++ * - may support partial reads and/or writes
+++++++++++ * (allows block sizes smaller than specified)
+++++++++++ */
+++++++++++ md->block_bits = card->csd.read_blkbits;
+++++++++++ if (card->csd.write_blkbits != card->csd.read_blkbits) {
+++++++++++ if (card->csd.write_blkbits < card->csd.read_blkbits &&
+++++++++++ card->csd.read_partial) {
+++++++++++ /*
+++++++++++ * write block size is smaller than read block
+++++++++++ * size, but we support partial reads, so choose
+++++++++++ * the smaller write block size.
+++++++++++ */
+++++++++++ md->block_bits = card->csd.write_blkbits;
+++++++++++ } else if (card->csd.write_blkbits > card->csd.read_blkbits &&
+++++++++++ card->csd.write_partial) {
+++++++++++ /*
+++++++++++ * read block size is smaller than write block
+++++++++++ * size, but we support partial writes. Use read
+++++++++++ * block size.
+++++++++++ */
+++++++++++ } else {
+++++++++++ /*
+++++++++++ * We don't support this configuration for writes.
+++++++++++ */
+++++++++++ printk(KERN_ERR "%s: unable to select block size for "
+++++++++++ "writing (rb%u wb%u rp%u wp%u)\n",
+++++++++++ md->disk->disk_name,
+++++++++++ 1 << card->csd.read_blkbits,
+++++++++++ 1 << card->csd.write_blkbits,
+++++++++++ card->csd.read_partial,
+++++++++++ card->csd.write_partial);
+++++++++++ md->read_only = 1;
}
----------- md->queue.prep_fn = mmc_blk_prep_rq;
----------- md->queue.issue_fn = mmc_blk_issue_rq;
----------- md->queue.data = md;
+++++++++++ }
----------- md->disk->major = major;
----------- md->disk->first_minor = devidx << MMC_SHIFT;
----------- md->disk->fops = &mmc_bdops;
----------- md->disk->private_data = md;
----------- md->disk->queue = md->queue.queue;
----------- md->disk->driverfs_dev = &card->dev;
+++++++++++ /*
+++++++++++ * Refuse to allow block sizes smaller than 512 bytes.
+++++++++++ */
+++++++++++ if (md->block_bits < 9) {
+++++++++++ printk(KERN_ERR "%s: unable to support block size %u\n",
+++++++++++ mmc_card_id(card), 1 << md->block_bits);
+++++++++++ ret = -EINVAL;
+++++++++++ goto err_kfree;
+++++++++++ }
----------- /*
----------- * As discussed on lkml, GENHD_FL_REMOVABLE should:
----------- *
----------- * - be set for removable media with permanent block devices
----------- * - be unset for removable block devices with permanent media
----------- *
----------- * Since MMC block devices clearly fall under the second
----------- * case, we do not set GENHD_FL_REMOVABLE. Userspace
----------- * should use the block device creation/destruction hotplug
----------- * messages to tell when the card is present.
----------- */
+++++++++++ md->disk = alloc_disk(1 << MMC_SHIFT);
+++++++++++ if (md->disk == NULL) {
+++++++++++ ret = -ENOMEM;
+++++++++++ goto err_kfree;
+++++++++++ }
----------- sprintf(md->disk->disk_name, "mmcblk%d", devidx);
----------- sprintf(md->disk->devfs_name, "mmc/blk%d", devidx);
+++++++++++ spin_lock_init(&md->lock);
+++++++++++ md->usage = 1;
----------- md->block_bits = card->csd.read_blkbits;
+++++++++++ ret = mmc_init_queue(&md->queue, card, &md->lock);
+++++++++++ if (ret)
+++++++++++ goto err_putdisk;
----------- blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits);
-- --- - set_capacity(md->disk, card->csd.capacity);
-- --- - }
-- --- - out:
+++++++++++ md->queue.prep_fn = mmc_blk_prep_rq;
+++++++++++ md->queue.issue_fn = mmc_blk_issue_rq;
+++++++++++ md->queue.data = md;
++ +++ +
- - - -- /*
- - - -- * The CSD capacity field is in units of read_blkbits.
- - - -- * set_capacity takes units of 512 bytes.
- - - -- */
- - - -- set_capacity(md->disk, card->csd.capacity << (card->csd.read_blkbits - 9));
- - - -- }
- - - -- out:
+++++++++++ md->disk->major = major;
+++++++++++ md->disk->first_minor = devidx << MMC_SHIFT;
+++++++++++ md->disk->fops = &mmc_bdops;
+++++++++++ md->disk->private_data = md;
+++++++++++ md->disk->queue = md->queue.queue;
+++++++++++ md->disk->driverfs_dev = &card->dev;
+++++++++++
+++++++++++ /*
+++++++++++ * As discussed on lkml, GENHD_FL_REMOVABLE should:
+++++++++++ *
+++++++++++ * - be set for removable media with permanent block devices
+++++++++++ * - be unset for removable block devices with permanent media
+++++++++++ *
+++++++++++ * Since MMC block devices clearly fall under the second
+++++++++++ * case, we do not set GENHD_FL_REMOVABLE. Userspace
+++++++++++ * should use the block device creation/destruction hotplug
+++++++++++ * messages to tell when the card is present.
+++++++++++ */
+++++++++++
+++++++++++ sprintf(md->disk->disk_name, "mmcblk%d", devidx);
+++++++++++ sprintf(md->disk->devfs_name, "mmc/blk%d", devidx);
+++++++++++
+++++++++++ blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits);
+++++++++++
+++++++++++ /*
+++++++++++ * The CSD capacity field is in units of read_blkbits.
+++++++++++ * set_capacity takes units of 512 bytes.
+++++++++++ */
+++++++++++ set_capacity(md->disk, card->csd.capacity << (card->csd.read_blkbits - 9));
return md;
+++++++++++
+++++++++++ err_putdisk:
+++++++++++ put_disk(md->disk);
+++++++++++ err_kfree:
+++++++++++ kfree(md);
+++++++++++ out:
+++++++++++ return ERR_PTR(ret);
}
static int
@@@@@@@@@@@@@ -462,10 -417,9 -412,10 -412,10 -417,9 -412,10 -412,10 -412,10 -417,9 -412,10 -417,9 -417,9 +462,10 @@@@@@@@@@@@@ static int mmc_blk_probe(struct mmc_car
if (err)
goto out;
- - - -- printk(KERN_INFO "%s: %s %s %luKiB %s\n",
-- --- - printk(KERN_INFO "%s: %s %s %dKiB %s\n",
+++++++++++ printk(KERN_INFO "%s: %s %s %lluKiB %s\n",
md->disk->disk_name, mmc_card_id(card), mmc_card_name(card),
- - - -- get_capacity(md->disk) >> 1, mmc_blk_readonly(card)?"(ro)":"");
-- --- - (card->csd.capacity << card->csd.read_blkbits) / 1024,
-- --- - mmc_blk_readonly(card)?"(ro)":"");
+++++++++++ (unsigned long long)(get_capacity(md->disk) >> 1),
+++++++++++ md->read_only ? "(ro)" : "");
mmc_set_drvdata(card, md);
add_disk(md->disk);
diff --cc drivers/mmc/mmc_sysfs.c
index a2a35fd,ec70166,3f4a66c,3f4a66c,3f4a66c,3f4a66c,3f4a66c,3f4a66c,ec70166,3f4a66c,ec70166,ec70166..a2a35fd
--- a/drivers/mmc/mmc_sysfs.c
+++ b/drivers/mmc/mmc_sysfs.c
@@@@@@@@@@@@@ -136,7 -136,17 -136,17 -136,17 -136,17 -136,17 -136,17 -136,17 -136,17 -136,17 -136,17 -136,17 +136,7 @@@@@@@@@@@@@ static int mmc_bus_resume(struct devic
return ret;
}
-----------static struct bus_type mmc_bus_type = {
----------- .name = "mmc",
----------- .dev_attrs = mmc_dev_attrs,
----------- .match = mmc_bus_match,
- - -- .uevent = mmc_bus_uevent,
------ - .hotplug = mmc_bus_hotplug,
----------- .suspend = mmc_bus_suspend,
----------- .resume = mmc_bus_resume,
-----------};
-----------
-----------
-----------static int mmc_drv_probe(struct device *dev)
+++++++++++static int mmc_bus_probe(struct device *dev)
{
struct mmc_driver *drv = to_mmc_driver(dev->driver);
struct mmc_card *card = dev_to_mmc_card(dev);
diff --cc drivers/mtd/devices/m25p80.c
index d5f2408,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..d5f2408
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
diff --cc drivers/mtd/devices/mtd_dataflash.c
index 155737e,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..155737e
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
diff --cc drivers/mtd/maps/epxa10db-flash.c
index 0000000,265b079,265b079,265b079,265b079,265b079,265b079,265b079,265b079,265b079,265b079,265b079..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/mtd/maps/epxa10db-flash.c
+++ /dev/null
diff --cc drivers/mtd/onenand/generic.c
index af06a80,45c077d,48cce43,48cce43,45c077d,48cce43,48cce43,48cce43,45c077d,45c077d,45c077d,45c077d..af06a80
--- a/drivers/mtd/onenand/generic.c
+++ b/drivers/mtd/onenand/generic.c
@@@@@@@@@@@@@ -12,10 -12,9 -12,9 -12,9 -12,9 -12,9 -12,9 -12,9 -12,9 -12,9 -12,9 -12,9 +12,10 @@@@@@@@@@@@@
* This is a device driver for the OneNAND flash for generic boards.
*/
-- --- #include <linux/device.h>
#include <linux/module.h>
#include <linux/init.h>
+++++++++++#include <linux/slab.h>
++ +++ #include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>
#include <linux/mtd/partitions.h>
diff --cc drivers/net/Kconfig
index 626508a,e2fa29b,ebd7313,ebd7313,ebd7313,ebd7313,ebd7313,ebd7313,e2fa29b,ebd7313,e2fa29b,e2fa29b..626508a
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@@@@@@@@@@@@ -1915,17 -1901,8 -1901,6 -1901,6 -1901,6 -1901,6 -1901,6 -1901,6 -1901,8 -1901,6 -1901,8 -1901,8 +1915,17 @@@@@@@@@@@@@ config E1000_NAP
If in doubt, say N.
+++++++++++config E1000_DISABLE_PACKET_SPLIT
+++++++++++ bool "Disable Packet Split for PCI express adapters"
+++++++++++ depends on E1000
+++++++++++ help
+++++++++++ Say Y here if you want to use the legacy receive path for PCI express
+++++++++++ hadware.
+++++++++++
+++++++++++ If in doubt, say N.
+++++++++++
++++++ + source "drivers/net/ixp2000/Kconfig"
++++++ +
config MYRI_SBUS
tristate "MyriCOM Gigabit Ethernet support"
depends on SBUS
diff --cc drivers/net/arm/ether00.c
index 0000000,4f1f4e3,4f1f4e3,4f1f4e3,4f1f4e3,4f1f4e3,4f1f4e3,4f1f4e3,4f1f4e3,4f1f4e3,4f1f4e3,4f1f4e3..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/net/arm/ether00.c
+++ /dev/null
diff --cc drivers/net/bonding/bond_sysfs.c
index 32d13da,32d13da,0000000,0000000,0000000,0000000,0000000,0000000,32d13da,0000000,32d13da,32d13da..32d13da
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
diff --cc drivers/net/bonding/bonding.h
index 3dd78d0,015c7f1,1433e91,1433e91,1433e91,1433e91,1433e91,1433e91,015c7f1,1433e91,015c7f1,015c7f1..3dd78d0
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@@@@@@@@@@@@ -22,8 -22,8 -40,8 -40,8 -40,8 -40,8 -40,8 -40,8 -22,8 -40,8 -22,8 -22,8 +22,8 @@@@@@@@@@@@@
#include "bond_3ad.h"
#include "bond_alb.h"
- - --#define DRV_VERSION "3.0.0"
- - --#define DRV_RELDATE "November 8, 2005"
------ - #define DRV_VERSION "2.6.5"
------ - #define DRV_RELDATE "November 4, 2005"
+++++++++++#define DRV_VERSION "3.0.1"
+++++++++++#define DRV_RELDATE "January 9, 2006"
#define DRV_NAME "bonding"
#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"
diff --cc drivers/net/e1000/e1000.h
index 27c7730,e02e9ba,3f653a9,3f653a9,3f653a9,3f653a9,3f653a9,3f653a9,e02e9ba,3f653a9,e02e9ba,e02e9ba..27c7730
--- a/drivers/net/e1000/e1000.h
+++ b/drivers/net/e1000/e1000.h
@@@@@@@@@@@@@ -198,12 -191,10 -191,8 -191,8 -191,8 -191,8 -191,8 -191,8 -191,10 -191,8 -191,10 -191,10 +198,12 @@@@@@@@@@@@@ struct e1000_tx_ring
spinlock_t tx_lock;
uint16_t tdh;
uint16_t tdt;
----------- uint64_t pkt;
++++++ +
++++++ + boolean_t last_tx_tso;
++++++ +
+++++++++++#ifdef CONFIG_E1000_MQ
+++++++++++ struct e1000_queue_stats tx_stats;
+++++++++++#endif
};
struct e1000_rx_ring {
diff --cc drivers/net/e1000/e1000_ethtool.c
index 5cedc81,c88f1a3,8eae8ba,8eae8ba,8eae8ba,8eae8ba,8eae8ba,8eae8ba,c88f1a3,8eae8ba,c88f1a3,c88f1a3..5cedc81
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@@@@@@@@@@@@ -586,24 -567,24 -565,7 -565,7 -565,7 -565,7 -565,7 -565,7 -567,24 -565,7 -567,24 -567,24 +586,24 @@@@@@@@@@@@@ e1000_get_drvinfo(struct net_device *ne
strncpy(drvinfo->driver, e1000_driver_name, 32);
strncpy(drvinfo->version, e1000_driver_version, 32);
- - --
- - -- /* EEPROM image version # is reported as firware version # for
------ - strncpy(drvinfo->fw_version, "N/A", 32);
+++++++++++
+++++++++++ /* EEPROM image version # is reported as firmware version # for
++++++ + * 8257{1|2|3} controllers */
++++++ + e1000_read_eeprom(&adapter->hw, 5, 1, &eeprom_data);
++++++ + switch (adapter->hw.mac_type) {
++++++ + case e1000_82571:
++++++ + case e1000_82572:
++++++ + case e1000_82573:
- - -- sprintf(firmware_version, "%d.%d-%d",
+++++++++++ sprintf(firmware_version, "%d.%d-%d",
++++++ + (eeprom_data & 0xF000) >> 12,
++++++ + (eeprom_data & 0x0FF0) >> 4,
++++++ + eeprom_data & 0x000F);
++++++ + break;
++++++ + default:
- - -- sprintf(firmware_version, "n/a");
+++++++++++ sprintf(firmware_version, "N/A");
++++++ + }
++++++ +
++++++ + strncpy(drvinfo->fw_version, firmware_version, 32);
strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 32);
drvinfo->n_stats = E1000_STATS_LEN;
drvinfo->testinfo_len = E1000_TEST_LEN;
@@@@@@@@@@@@@ -998,20 -979,21 -960,13 -960,13 -960,13 -960,13 -960,13 -960,13 -979,21 -960,13 -979,21 -979,21 +998,20 @@@@@@@@@@@@@ e1000_free_desc_rings(struct e1000_adap
}
}
- - -- if(txdr->desc) {
------ - if(txdr->desc)
+++++++++++ if (txdr->desc) {
pci_free_consistent(pdev, txdr->size, txdr->desc, txdr->dma);
------ - if(rxdr->desc)
++++++ + txdr->desc = NULL;
++++++ + }
- - -- if(rxdr->desc) {
+++++++++++ if (rxdr->desc) {
pci_free_consistent(pdev, rxdr->size, rxdr->desc, rxdr->dma);
++++++ + rxdr->desc = NULL;
++++++ + }
kfree(txdr->buffer_info);
++++++ + txdr->buffer_info = NULL;
- - --
kfree(rxdr->buffer_info);
++++++ + rxdr->buffer_info = NULL;
++++++ +
return;
}
@@@@@@@@@@@@@ -1345,33 -1327,33 -1300,22 -1300,22 -1300,22 -1300,22 -1300,22 -1300,22 -1327,33 -1300,22 -1327,33 -1327,33 +1345,33 @@@@@@@@@@@@@ e1000_set_phy_loopback(struct e1000_ada
static int
e1000_setup_loopback_test(struct e1000_adapter *adapter)
{
- - -- uint32_t rctl;
++++++ + struct e1000_hw *hw = &adapter->hw;
+ + ++ uint32_t rctl;
------ - if(adapter->hw.media_type == e1000_media_type_fiber ||
------ - adapter->hw.media_type == e1000_media_type_internal_serdes) {
------ - if(adapter->hw.mac_type == e1000_82545 ||
------ - adapter->hw.mac_type == e1000_82546 ||
------ - adapter->hw.mac_type == e1000_82545_rev_3 ||
------ - adapter->hw.mac_type == e1000_82546_rev_3)
++++++ + if (hw->media_type == e1000_media_type_fiber ||
- - -- hw->media_type == e1000_media_type_internal_serdes) {
+++++++++++ hw->media_type == e1000_media_type_internal_serdes) {
++++++ + switch (hw->mac_type) {
++++++ + case e1000_82545:
++++++ + case e1000_82546:
++++++ + case e1000_82545_rev_3:
++++++ + case e1000_82546_rev_3:
return e1000_set_phy_loopback(adapter);
------ - else {
------ - rctl = E1000_READ_REG(&adapter->hw, RCTL);
++++++ + break;
++++++ + case e1000_82571:
++++++ + case e1000_82572:
++++++ + #define E1000_SERDES_LB_ON 0x410
++++++ + e1000_set_phy_loopback(adapter);
++++++ + E1000_WRITE_REG(hw, SCTL, E1000_SERDES_LB_ON);
++++++ + msec_delay(10);
++++++ + return 0;
++++++ + break;
++++++ + default:
++++++ + rctl = E1000_READ_REG(hw, RCTL);
rctl |= E1000_RCTL_LBM_TCVR;
------ - E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
++++++ + E1000_WRITE_REG(hw, RCTL, rctl);
return 0;
}
------ - } else if(adapter->hw.media_type == e1000_media_type_copper)
++++++ + } else if (hw->media_type == e1000_media_type_copper)
return e1000_set_phy_loopback(adapter);
return 7;
@@@@@@@@@@@@@ -1380,38 -1362,38 -1324,27 -1324,27 -1324,27 -1324,27 -1324,27 -1324,27 -1362,38 -1324,27 -1362,38 -1362,38 +1380,38 @@@@@@@@@@@@@
static void
e1000_loopback_cleanup(struct e1000_adapter *adapter)
{
+++++++++++ struct e1000_hw *hw = &adapter->hw;
uint32_t rctl;
uint16_t phy_reg;
- - -- struct e1000_hw *hw = &adapter->hw;
----------- rctl = E1000_READ_REG(&adapter->hw, RCTL);
+++++++++++ rctl = E1000_READ_REG(hw, RCTL);
rctl &= ~(E1000_RCTL_LBM_TCVR | E1000_RCTL_LBM_MAC);
----------- E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
+++++++++++ E1000_WRITE_REG(hw, RCTL, rctl);
------ - if(adapter->hw.media_type == e1000_media_type_copper ||
------ - ((adapter->hw.media_type == e1000_media_type_fiber ||
------ - adapter->hw.media_type == e1000_media_type_internal_serdes) &&
------ - (adapter->hw.mac_type == e1000_82545 ||
------ - adapter->hw.mac_type == e1000_82546 ||
------ - adapter->hw.mac_type == e1000_82545_rev_3 ||
------ - adapter->hw.mac_type == e1000_82546_rev_3))) {
------ - adapter->hw.autoneg = TRUE;
------ - e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &phy_reg);
------ - if(phy_reg & MII_CR_LOOPBACK) {
++++++ + switch (hw->mac_type) {
++++++ + case e1000_82571:
++++++ + case e1000_82572:
++++++ + if (hw->media_type == e1000_media_type_fiber ||
- - -- hw->media_type == e1000_media_type_internal_serdes){
+++++++++++ hw->media_type == e1000_media_type_internal_serdes) {
++++++ + #define E1000_SERDES_LB_OFF 0x400
++++++ + E1000_WRITE_REG(hw, SCTL, E1000_SERDES_LB_OFF);
++++++ + msec_delay(10);
++++++ + break;
++++++ + }
- - -- /* fall thru for Cu adapters */
+++++++++++ /* Fall Through */
++++++ + case e1000_82545:
++++++ + case e1000_82546:
++++++ + case e1000_82545_rev_3:
++++++ + case e1000_82546_rev_3:
++++++ + default:
++++++ + hw->autoneg = TRUE;
++++++ + e1000_read_phy_reg(hw, PHY_CTRL, &phy_reg);
++++++ + if (phy_reg & MII_CR_LOOPBACK) {
phy_reg &= ~MII_CR_LOOPBACK;
------ - e1000_write_phy_reg(&adapter->hw, PHY_CTRL, phy_reg);
------ - e1000_phy_reset(&adapter->hw);
++++++ + e1000_write_phy_reg(hw, PHY_CTRL, phy_reg);
++++++ + e1000_phy_reset(hw);
}
++++++ + break;
}
}
@@@@@@@@@@@@@ -1506,25 -1488,14 -1439,12 -1439,12 -1439,12 -1439,12 -1439,12 -1439,12 -1488,14 -1439,12 -1488,14 -1488,14 +1506,25 @@@@@@@@@@@@@ e1000_run_loopback_test(struct e1000_ad
static int
e1000_loopback_test(struct e1000_adapter *adapter, uint64_t *data)
{
----------- if((*data = e1000_setup_desc_rings(adapter))) goto err_loopback;
- - -- if((*data = e1000_setup_loopback_test(adapter)))
- - -- goto err_loopback_setup;
------ - if((*data = e1000_setup_loopback_test(adapter))) goto err_loopback;
+++++++++++ /* PHY loopback cannot be performed if SoL/IDER
+++++++++++ * sessions are active */
+++++++++++ if (e1000_check_phy_reset_block(&adapter->hw)) {
+++++++++++ DPRINTK(DRV, ERR, "Cannot do PHY loopback test "
+++++++++++ "when SoL/IDER is active.\n");
+++++++++++ *data = 0;
+++++++++++ goto out;
+++++++++++ }
+++++++++++
+++++++++++ if ((*data = e1000_setup_desc_rings(adapter)))
+++++++++++ goto out;
+++++++++++ if ((*data = e1000_setup_loopback_test(adapter)))
+++++++++++ goto err_loopback;
*data = e1000_run_loopback_test(adapter);
e1000_loopback_cleanup(adapter);
- - --err_loopback_setup:
----------- e1000_free_desc_rings(adapter);
+++++++++++
err_loopback:
+++++++++++ e1000_free_desc_rings(adapter);
+++++++++++out:
return *data;
}
@@@@@@@@@@@@@ -1752,21 -1721,21 -1670,13 -1670,13 -1670,13 -1670,13 -1670,13 -1670,13 -1721,21 -1670,13 -1721,21 -1721,21 +1752,21 @@@@@@@@@@@@@ e1000_phys_id(struct net_device *netdev
mod_timer(&adapter->blink_timer, jiffies);
msleep_interruptible(data * 1000);
del_timer_sync(&adapter->blink_timer);
----------- }
- - -- else if(adapter->hw.mac_type < e1000_82573) {
------ - else {
----------- E1000_WRITE_REG(&adapter->hw, LEDCTL, (E1000_LEDCTL_LED2_BLINK_RATE |
- - -- E1000_LEDCTL_LED0_BLINK | E1000_LEDCTL_LED2_BLINK |
------ - E1000_LEDCTL_LED1_BLINK | E1000_LEDCTL_LED2_BLINK |
----------- (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) |
- - -- (E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED0_MODE_SHIFT) |
- - -- (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED1_MODE_SHIFT)));
------ - (E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED1_MODE_SHIFT) |
------ - (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED0_MODE_SHIFT)));
+++++++++++ } else if (adapter->hw.mac_type < e1000_82573) {
+++++++++++ E1000_WRITE_REG(&adapter->hw, LEDCTL,
+++++++++++ (E1000_LEDCTL_LED2_BLINK_RATE |
+++++++++++ E1000_LEDCTL_LED0_BLINK | E1000_LEDCTL_LED2_BLINK |
+++++++++++ (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) |
+++++++++++ (E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED0_MODE_SHIFT) |
+++++++++++ (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED1_MODE_SHIFT)));
++++++ + msleep_interruptible(data * 1000);
- - -- }
- - -- else {
- - -- E1000_WRITE_REG(&adapter->hw, LEDCTL, (E1000_LEDCTL_LED2_BLINK_RATE |
- - -- E1000_LEDCTL_LED1_BLINK | E1000_LEDCTL_LED2_BLINK |
- - -- (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) |
- - -- (E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED1_MODE_SHIFT) |
- - -- (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED0_MODE_SHIFT)));
+++++++++++ } else {
+++++++++++ E1000_WRITE_REG(&adapter->hw, LEDCTL,
+++++++++++ (E1000_LEDCTL_LED2_BLINK_RATE |
+++++++++++ E1000_LEDCTL_LED1_BLINK | E1000_LEDCTL_LED2_BLINK |
+++++++++++ (E1000_LEDCTL_MODE_LED_ON << E1000_LEDCTL_LED2_MODE_SHIFT) |
+++++++++++ (E1000_LEDCTL_MODE_LINK_ACTIVITY << E1000_LEDCTL_LED1_MODE_SHIFT) |
+++++++++++ (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED0_MODE_SHIFT)));
msleep_interruptible(data * 1000);
}
diff --cc drivers/net/e1000/e1000_hw.c
index beeec0f,136fc03,a267c52,a267c52,a267c52,a267c52,a267c52,a267c52,136fc03,a267c52,136fc03,136fc03..beeec0f
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@@@@@@@@@@@@ -3000,17 -2979,15 -2966,9 -2966,9 -2966,9 -2966,9 -2966,9 -2966,9 -2979,15 -2966,9 -2979,15 -2979,15 +3000,17 @@@@@@@@@@@@@ e1000_phy_hw_reset(struct e1000_hw *hw
ctrl = E1000_READ_REG(hw, CTRL);
E1000_WRITE_REG(hw, CTRL, ctrl | E1000_CTRL_PHY_RST);
E1000_WRITE_FLUSH(hw);
------ - msec_delay(10);
++++++ +
++++++ + if (hw->mac_type < e1000_82571)
++++++ + msec_delay(10);
+++++++++++ else
+++++++++++ udelay(100);
++++++ +
E1000_WRITE_REG(hw, CTRL, ctrl);
E1000_WRITE_FLUSH(hw);
++++++ +
++++++ + if (hw->mac_type >= e1000_82571)
++++++ + msec_delay(10);
} else {
/* Read the Extended Device Control Register, assert the PHY_RESET_DIR
* bit to put the PHY into reset. Then, take it out of reset.
diff --cc drivers/net/e1000/e1000_hw.h
index f1219dd,7caa357,76ce128,76ce128,76ce128,76ce128,76ce128,76ce128,7caa357,76ce128,7caa357,7caa357..f1219dd
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@@@@@@@@@@@@ -1959,23 -1954,6 -1951,7 -1951,7 -1951,7 -1951,7 -1951,7 -1951,7 -1954,6 -1951,7 -1954,6 -1954,6 +1959,23 @@@@@@@@@@@@@ struct e1000_host_command_info
#define E1000_MDALIGN 4096
------ - #define E1000_GCR_BEM32 0x00400000
+++++++++++/* PCI-Ex registers */
+++++++++++
+++++++++++/* PCI-Ex Control Register */
+++++++++++#define E1000_GCR_RXD_NO_SNOOP 0x00000001
+++++++++++#define E1000_GCR_RXDSCW_NO_SNOOP 0x00000002
+++++++++++#define E1000_GCR_RXDSCR_NO_SNOOP 0x00000004
+++++++++++#define E1000_GCR_TXD_NO_SNOOP 0x00000008
+++++++++++#define E1000_GCR_TXDSCW_NO_SNOOP 0x00000010
+++++++++++#define E1000_GCR_TXDSCR_NO_SNOOP 0x00000020
+++++++++++
+++++++++++#define PCI_EX_NO_SNOOP_ALL (E1000_GCR_RXD_NO_SNOOP | \
+++++++++++ E1000_GCR_RXDSCW_NO_SNOOP | \
+++++++++++ E1000_GCR_RXDSCR_NO_SNOOP | \
+++++++++++ E1000_GCR TXD_NO_SNOOP | \
+++++++++++ E1000_GCR_TXDSCW_NO_SNOOP | \
+++++++++++ E1000_GCR_TXDSCR_NO_SNOOP)
+++++++++++
#define E1000_GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
/* Function Active and Power State to MNG */
#define E1000_FACTPS_FUNC0_POWER_STATE_MASK 0x00000003
diff --cc drivers/net/e1000/e1000_main.c
index 31e3329,438a931,e0ae248,8b207f0,e0ae248,8b207f0,8b207f0,8b207f0,438a931,e0ae248,438a931,438a931..31e3329
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@@@@@@@@@@@@ -853,8 -711,9 -711,8 -711,8 -711,8 -711,8 -711,8 -711,8 -711,9 -711,8 -711,9 -711,9 +853,8 @@@@@@@@@@@@@ e1000_probe(struct pci_dev *pdev
break;
case e1000_82546:
case e1000_82546_rev_3:
------ - if((E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_FUNC_1)
------ - && (adapter->hw.media_type == e1000_media_type_copper)) {
++++++ + case e1000_82571:
- - -- if((E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_FUNC_1)
- - -- && (adapter->hw.media_type == e1000_media_type_copper)) {
+++++++++++ if (E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_FUNC_1){
e1000_read_eeprom(&adapter->hw,
EEPROM_INIT_CONTROL3_PORT_B, 1, &eeprom_data);
break;
@@@@@@@@@@@@@ -1987,7 -1813,7 -1813,12 -1813,12 -1813,12 -1813,12 -1813,12 -1813,12 -1813,7 -1813,12 -1813,7 -1813,7 +1987,7 @@@@@@@@@@@@@ e1000_clean_tx_ring(struct e1000_adapte
/* Free all the Tx ring sk_buffs */
------ - if (likely(tx_ring->previous_buffer_info.skb != NULL)) {
------ - e1000_unmap_and_free_tx_resource(adapter,
------ - &tx_ring->previous_buffer_info);
------ - }
------ -
----------- for(i = 0; i < tx_ring->count; i++) {
+++++++++++ for (i = 0; i < tx_ring->count; i++) {
buffer_info = &tx_ring->buffer_info[i];
e1000_unmap_and_free_tx_resource(adapter, buffer_info);
}
@@@@@@@@@@@@@ -2643,19 -2433,19 -2437,9 -2437,9 -2437,9 -2437,9 -2437,9 -2437,9 -2433,19 -2437,9 -2433,19 -2433,19 +2643,19 @@@@@@@@@@@@@ e1000_tx_map(struct e1000_adapter *adap
buffer_info = &tx_ring->buffer_info[i];
size = min(len, max_per_txd);
#ifdef NETIF_F_TSO
++++++ + /* Workaround for Controller erratum --
++++++ + * descriptor for non-tso packet in a linear SKB that follows a
++++++ + * tso gets written back prematurely before the data is fully
++++++ + * DMAd to the controller */
++++++ + if (!skb->data_len && tx_ring->last_tx_tso &&
++++++ + !skb_shinfo(skb)->tso_size) {
++++++ + tx_ring->last_tx_tso = 0;
++++++ + size -= 4;
++++++ + }
++++++ +
/* Workaround for premature desc write-backs
* in TSO mode. Append 4-byte sentinel desc */
----------- if(unlikely(mss && !nr_frags && size == len && size > 8))
+++++++++++ if (unlikely(mss && !nr_frags && size == len && size > 8))
size -= 4;
#endif
/* work-around for errata 10 and it applies
@@@@@@@@@@@@@ -2837,16 -2627,16 -2621,16 -2621,28 -2621,16 -2621,28 -2621,28 -2621,28 -2627,16 -2621,16 -2627,16 -2627,16 +2837,16 @@@@@@@@@@@@@ e1000_transfer_dhcp_info(struct e1000_a
E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT)) )
return 0;
}
-- - ---- if ((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) {
- --- if(htons(ETH_P_IP) == skb->protocol) {
- --- const struct iphdr *ip = skb->nh.iph;
- --- if(IPPROTO_UDP == ip->protocol) {
- --- struct udphdr *udp = (struct udphdr *)(skb->h.uh);
- --- if(ntohs(udp->dest) == 67) {
- --- offset = (uint8_t *)udp + 8 - skb->data;
- --- length = skb->len - offset;
- ---
- --- return e1000_mng_write_dhcp_info(hw,
- --- (uint8_t *)udp + 8, length);
- --- }
- --- }
- --- } else if((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) {
+++++++++++ if ((skb->len > MINIMUM_DHCP_PACKET_SIZE) && (!skb->protocol)) {
struct ethhdr *eth = (struct ethhdr *) skb->data;
----------- if((htons(ETH_P_IP) == eth->h_proto)) {
----------- const struct iphdr *ip =
+++++++++++ if ((htons(ETH_P_IP) == eth->h_proto)) {
+++++++++++ const struct iphdr *ip =
(struct iphdr *)((uint8_t *)skb->data+14);
----------- if(IPPROTO_UDP == ip->protocol) {
----------- struct udphdr *udp =
----------- (struct udphdr *)((uint8_t *)ip +
+++++++++++ if (IPPROTO_UDP == ip->protocol) {
+++++++++++ struct udphdr *udp =
+++++++++++ (struct udphdr *)((uint8_t *)ip +
(ip->ihl << 2));
----------- if(ntohs(udp->dest) == 67) {
+++++++++++ if (ntohs(udp->dest) == 67) {
offset = (uint8_t *)udp + 8 - skb->data;
length = skb->len - offset;
@@@@@@@@@@@@@ -2925,26 -2696,26 -2690,18 -2702,18 -2690,18 -2702,18 -2702,18 -2702,18 -2696,26 -2690,18 -2696,26 -2696,26 +2925,26 @@@@@@@@@@@@@ e1000_xmit_frame(struct sk_buff *skb, s
count++;
count++;
#else
----------- if(skb->ip_summed == CHECKSUM_HW)
+++++++++++ if (skb->ip_summed == CHECKSUM_HW)
++++++ + count++;
++++++ + #endif
++++++ +
++++++ + #ifdef NETIF_F_TSO
++++++ + /* Controller Erratum workaround */
++++++ + if (!skb->data_len && tx_ring->last_tx_tso &&
++++++ + !skb_shinfo(skb)->tso_size)
count++;
#endif
++++++ +
count += TXD_USE_COUNT(len, max_txd_pwr);
----------- if(adapter->pcix_82544)
+++++++++++ if (adapter->pcix_82544)
count++;
----------- /* work-around for errata 10 and it applies to all controllers
+++++++++++ /* work-around for errata 10 and it applies to all controllers
* in PCI-X mode, so add one more descriptor to the count
*/
----------- if(unlikely((adapter->hw.bus_type == e1000_bus_type_pcix) &&
+++++++++++ if (unlikely((adapter->hw.bus_type == e1000_bus_type_pcix) &&
(len > 2015)))
count++;
@@@@@@@@@@@@@ -3077,57 -2868,56 -2853,56 -2865,56 -2853,56 -2865,56 -2865,56 -2865,56 -2868,56 -2853,56 -2868,56 -2868,56 +3077,57 @@@@@@@@@@@@@ e1000_change_mtu(struct net_device *net
struct e1000_adapter *adapter = netdev_priv(netdev);
int max_frame = new_mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE;
----------- if((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) ||
----------- (max_frame > MAX_JUMBO_FRAME_SIZE)) {
----------- DPRINTK(PROBE, ERR, "Invalid MTU setting\n");
----------- return -EINVAL;
----------- }
-----------
-----------#define MAX_STD_JUMBO_FRAME_SIZE 9234
----------- /* might want this to be bigger enum check... */
----------- /* 82571 controllers limit jumbo frame size to 10500 bytes */
----------- if ((adapter->hw.mac_type == e1000_82571 ||
----------- adapter->hw.mac_type == e1000_82572) &&
----------- max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
----------- DPRINTK(PROBE, ERR, "MTU > 9216 bytes not supported "
----------- "on 82571 and 82572 controllers.\n");
- - -- return -EINVAL;
- - -- }
- - --
- - -- if(adapter->hw.mac_type == e1000_82573 &&
- - -- max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) {
- - -- DPRINTK(PROBE, ERR, "Jumbo Frames not supported "
- - -- "on 82573\n");
+++++++++++ if ((max_frame < MINIMUM_ETHERNET_FRAME_SIZE) ||
+++++++++++ (max_frame > MAX_JUMBO_FRAME_SIZE)) {
+++++++++++ DPRINTK(PROBE, ERR, "Invalid MTU setting\n");
return -EINVAL;
}
------ - if(adapter->hw.mac_type == e1000_82573 &&
------ - max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) {
------ - DPRINTK(PROBE, ERR, "Jumbo Frames not supported "
------ - "on 82573\n");
------ - return -EINVAL;
------ - }
------ -
----------- if(adapter->hw.mac_type > e1000_82547_rev_2) {
----------- adapter->rx_buffer_len = max_frame;
----------- E1000_ROUNDUP(adapter->rx_buffer_len, 1024);
----------- } else {
----------- if(unlikely((adapter->hw.mac_type < e1000_82543) &&
----------- (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE))) {
----------- DPRINTK(PROBE, ERR, "Jumbo Frames not supported "
----------- "on 82542\n");
+++++++++++ /* Adapter-specific max frame size limits. */
+++++++++++ switch (adapter->hw.mac_type) {
+++++++++++ case e1000_82542_rev2_0:
+++++++++++ case e1000_82542_rev2_1:
+++++++++++ case e1000_82573:
+++++++++++ if (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE) {
+++++++++++ DPRINTK(PROBE, ERR, "Jumbo Frames not supported.\n");
+ + ++ return -EINVAL;
------ -
------ - } else {
------ - if(max_frame <= E1000_RXBUFFER_2048) {
------ - adapter->rx_buffer_len = E1000_RXBUFFER_2048;
------ - } else if(max_frame <= E1000_RXBUFFER_4096) {
------ - adapter->rx_buffer_len = E1000_RXBUFFER_4096;
------ - } else if(max_frame <= E1000_RXBUFFER_8192) {
------ - adapter->rx_buffer_len = E1000_RXBUFFER_8192;
------ - } else if(max_frame <= E1000_RXBUFFER_16384) {
------ - adapter->rx_buffer_len = E1000_RXBUFFER_16384;
------ - }
+ + ++ }
+++++++++++ break;
+++++++++++ case e1000_82571:
+++++++++++ case e1000_82572:
+++++++++++#define MAX_STD_JUMBO_FRAME_SIZE 9234
+++++++++++ if (max_frame > MAX_STD_JUMBO_FRAME_SIZE) {
+++++++++++ DPRINTK(PROBE, ERR, "MTU > 9216 not supported.\n");
++++++ + return -EINVAL;
- - --
- - -- } else {
- - -- if(max_frame <= E1000_RXBUFFER_2048) {
- - -- adapter->rx_buffer_len = E1000_RXBUFFER_2048;
- - -- } else if(max_frame <= E1000_RXBUFFER_4096) {
- - -- adapter->rx_buffer_len = E1000_RXBUFFER_4096;
- - -- } else if(max_frame <= E1000_RXBUFFER_8192) {
- - -- adapter->rx_buffer_len = E1000_RXBUFFER_8192;
- - -- } else if(max_frame <= E1000_RXBUFFER_16384) {
- - -- adapter->rx_buffer_len = E1000_RXBUFFER_16384;
- - -- }
++++++ + }
+++++++++++ break;
+++++++++++ default:
+++++++++++ /* Capable of supporting up to MAX_JUMBO_FRAME_SIZE limit. */
+++++++++++ break;
}
+++++++++++ /* since the driver code now supports splitting a packet across
+++++++++++ * multiple descriptors, most of the fifo related limitations on
+++++++++++ * jumbo frame traffic have gone away.
+++++++++++ * simply use 2k descriptors for everything.
+++++++++++ *
+++++++++++ * NOTE: dev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN
+++++++++++ * means we reserve 2 more, this pushes us to allocate from the next
+++++++++++ * larger slab size
+++++++++++ * i.e. RXBUFFER_2048 --> size-4096 slab */
+++++++++++
+++++++++++ /* recent hardware supports 1KB granularity */
+++++++++++ if (adapter->hw.mac_type > e1000_82547_rev_2) {
+++++++++++ adapter->rx_buffer_len =
+++++++++++ ((max_frame < E1000_RXBUFFER_2048) ?
+++++++++++ max_frame : E1000_RXBUFFER_2048);
+++++++++++ E1000_ROUNDUP(adapter->rx_buffer_len, 1024);
+++++++++++ } else
+++++++++++ adapter->rx_buffer_len = E1000_RXBUFFER_2048;
+++++++++++
netdev->mtu = new_mtu;
----------- if(netif_running(netdev)) {
+++++++++++ if (netif_running(netdev)) {
e1000_down(adapter);
e1000_up(adapter);
}
@@@@@@@@@@@@@ -3475,24 -3242,22 -3227,47 -3239,47 -3227,47 -3239,47 -3239,47 -3239,47 -3242,22 -3227,47 -3242,22 -3242,22 +3475,24 @@@@@@@@@@@@@ e1000_clean_tx_irq(struct e1000_adapte
eop_desc = E1000_TX_DESC(*tx_ring, eop);
while (eop_desc->upper.data & cpu_to_le32(E1000_TXD_STAT_DD)) {
------ - /* Premature writeback of Tx descriptors clear (free buffers
------ - * and unmap pci_mapping) previous_buffer_info */
------ - if (likely(tx_ring->previous_buffer_info.skb != NULL)) {
------ - e1000_unmap_and_free_tx_resource(adapter,
------ - &tx_ring->previous_buffer_info);
------ - }
------ -
----------- for(cleaned = FALSE; !cleaned; ) {
+++++++++++ for (cleaned = FALSE; !cleaned; ) {
tx_desc = E1000_TX_DESC(*tx_ring, i);
buffer_info = &tx_ring->buffer_info[i];
cleaned = (i == eop);
------ - #ifdef NETIF_F_TSO
------ - if (!(netdev->features & NETIF_F_TSO)) {
------ - #endif
------ - e1000_unmap_and_free_tx_resource(adapter,
------ - buffer_info);
------ - #ifdef NETIF_F_TSO
------ - } else {
------ - if (cleaned) {
------ - memcpy(&tx_ring->previous_buffer_info,
------ - buffer_info,
------ - sizeof(struct e1000_buffer));
------ - memset(buffer_info, 0,
------ - sizeof(struct e1000_buffer));
------ - } else {
------ - e1000_unmap_and_free_tx_resource(
------ - adapter, buffer_info);
------ - }
------ - }
+++++++++++#ifdef CONFIG_E1000_MQ
+++++++++++ tx_ring->tx_stats.bytes += buffer_info->length;
+ + ++#endif
++++++ + e1000_unmap_and_free_tx_resource(adapter, buffer_info);
+++++++++++ memset(tx_desc, 0, sizeof(struct e1000_tx_desc));
----------- tx_desc->buffer_addr = 0;
----------- tx_desc->lower.data = 0;
----------- tx_desc->upper.data = 0;
-----------
----------- if(unlikely(++i == tx_ring->count)) i = 0;
+++++++++++ if (unlikely(++i == tx_ring->count)) i = 0;
}
----------- tx_ring->pkt++;
-----------
+++++++++++#ifdef CONFIG_E1000_MQ
+++++++++++ tx_ring->tx_stats.packets++;
+++++++++++#endif
+++++++++++
eop = tx_ring->buffer_info[i].next_to_watch;
eop_desc = E1000_TX_DESC(*tx_ring, eop);
}
@@@@@@@@@@@@@ -3634,17 -3398,8 -3414,8 -3426,8 -3414,8 -3426,8 -3426,8 -3426,8 -3398,8 -3414,8 -3398,8 -3398,8 +3634,17 @@@@@@@@@@@@@ e1000_clean_rx_irq(struct e1000_adapte
break;
(*work_done)++;
#endif
----------- cleaned = TRUE;
+++++++++++ status = rx_desc->status;
+++++++++++ skb = buffer_info->skb;
+++++++++++ buffer_info->skb = NULL;
+ + ++++ ++
+++++++++++ if (++i == rx_ring->count) i = 0;
+++++++++++ next_rxd = E1000_RX_DESC(*rx_ring, i);
+++++++++++ next_buffer = &rx_ring->buffer_info[i];
+++++++++++ next_skb = next_buffer->skb;
+ + +
+++++++++++ cleaned = TRUE;
+++++++++++ cleaned_count++;
pci_unmap_single(pdev,
buffer_info->dma,
buffer_info->length,
@@@@@@@@@@@@@ -3955,18 -3629,11 -3645,11 -3657,11 -3645,11 -3657,11 -3657,11 -3657,11 -3629,11 -3645,11 -3629,11 -3629,11 +3955,18 @@@@@@@@@@@@@ e1000_alloc_rx_buffers(struct e1000_ada
i = rx_ring->next_to_use;
buffer_info = &rx_ring->buffer_info[i];
----------- while(!buffer_info->skb) {
----------- skb = dev_alloc_skb(bufsz);
+++++++++++ while (cleaned_count--) {
+++++++++++ if (!(skb = buffer_info->skb))
+++++++++++ skb = dev_alloc_skb(bufsz);
+++++++++++ else {
+++++++++++ skb_trim(skb, 0);
+++++++++++ goto map_skb;
+++++++++++ }
++ + ++++
- --- if(unlikely(!skb)) {
+ +++
-- - ---- if(unlikely(!skb)) {
+++++++++++ if (unlikely(!skb)) {
/* Better luck next round */
+++++++++++ adapter->alloc_rx_buff_failed++;
break;
}
diff --cc drivers/net/forcedeth.c
index 3682ec6,c39344a,525624f,525624f,c39344a,525624f,525624f,525624f,c39344a,c39344a,c39344a,c39344a..3682ec6
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@@@@@@@@@@@@ -100,8 -100,7 -100,6 -100,6 -100,7 -100,6 -100,6 -100,6 -100,7 -100,7 -100,7 -100,7 +100,8 @@@@@@@@@@@@@
* 0.45: 18 Sep 2005: Remove nv_stop/start_rx from every link check
* 0.46: 20 Oct 2005: Add irq optimization modes.
* 0.47: 26 Oct 2005: Add phyaddr 0 in phy scan.
++ +++ * 0.48: 24 Dec 2005: Disable TSO, bugfix for pci_map_single
+++++++++++ * 0.49: 10 Dec 2005: Fix tso for large buffers.
*
* Known bugs:
* We suspect that on some hardware no TX done interrupts are generated.
@@@@@@@@@@@@@ -113,7 -112,7 -111,7 -111,7 -112,7 -111,7 -111,7 -111,7 -112,7 -112,7 -112,7 -112,7 +113,7 @@@@@@@@@@@@@
* DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
* superfluous timer interrupts from the nic.
*/
- - ----#define FORCEDETH_VERSION "0.48"
-- --- #define FORCEDETH_VERSION "0.47"
+++++++++++#define FORCEDETH_VERSION "0.49"
#define DRV_NAME "forcedeth"
#include <linux/module.h>
diff --cc drivers/net/gianfar_sysfs.c
index 51ef181,10d34cb,0000000,0000000,0000000,0000000,0000000,0000000,10d34cb,0000000,10d34cb,10d34cb..51ef181
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/gianfar_sysfs.c
+++ b/drivers/net/gianfar_sysfs.c
@@@@@@@@@@@@@ -1,311 -1,311 -1,0 -1,0 -1,0 -1,0 -1,0 -1,0 -1,311 -1,0 -1,311 -1,311 +1,311 @@@@@@@@@@@@@
++++++ + /*
++++++ + * drivers/net/gianfar_sysfs.c
++++++ + *
++++++ + * Gianfar Ethernet Driver
++++++ + * This driver is designed for the non-CPM ethernet controllers
++++++ + * on the 85xx and 83xx family of integrated processors
++++++ + * Based on 8260_io/fcc_enet.c
++++++ + *
++++++ + * Author: Andy Fleming
- - -- * Maintainer: Kumar Gala (kumar.gala@freescale.com)
+++++++++++ * Maintainer: Kumar Gala (galak@kernel.crashing.org)
++++++ + *
++++++ + * Copyright (c) 2002-2005 Freescale Semiconductor, Inc.
++++++ + *
++++++ + * This program is free software; you can redistribute it and/or modify it
++++++ + * under the terms of the GNU General Public License as published by the
++++++ + * Free Software Foundation; either version 2 of the License, or (at your
++++++ + * option) any later version.
++++++ + *
++++++ + * Sysfs file creation and management
++++++ + */
++++++ +
++++++ + #include <linux/config.h>
++++++ + #include <linux/kernel.h>
++++++ + #include <linux/sched.h>
++++++ + #include <linux/string.h>
++++++ + #include <linux/errno.h>
++++++ + #include <linux/unistd.h>
++++++ + #include <linux/slab.h>
++++++ + #include <linux/init.h>
++++++ + #include <linux/delay.h>
++++++ + #include <linux/etherdevice.h>
++++++ + #include <linux/spinlock.h>
++++++ + #include <linux/mm.h>
++++++ + #include <linux/device.h>
++++++ +
++++++ + #include <asm/uaccess.h>
++++++ + #include <linux/module.h>
++++++ + #include <linux/version.h>
++++++ +
++++++ + #include "gianfar.h"
++++++ +
++++++ + #define GFAR_ATTR(_name) \
++++++ + static ssize_t gfar_show_##_name(struct class_device *cdev, char *buf); \
++++++ + static ssize_t gfar_set_##_name(struct class_device *cdev, \
++++++ + const char *buf, size_t count); \
++++++ + static CLASS_DEVICE_ATTR(_name, 0644, gfar_show_##_name, gfar_set_##_name)
++++++ +
++++++ + #define GFAR_CREATE_FILE(_dev, _name) \
++++++ + class_device_create_file(&_dev->class_dev, &class_device_attr_##_name)
++++++ +
++++++ + GFAR_ATTR(bd_stash);
++++++ + GFAR_ATTR(rx_stash_size);
++++++ + GFAR_ATTR(rx_stash_index);
++++++ + GFAR_ATTR(fifo_threshold);
++++++ + GFAR_ATTR(fifo_starve);
++++++ + GFAR_ATTR(fifo_starve_off);
++++++ +
++++++ + #define to_net_dev(cd) container_of(cd, struct net_device, class_dev)
++++++ +
++++++ + static ssize_t gfar_show_bd_stash(struct class_device *cdev, char *buf)
++++++ + {
++++++ + struct net_device *dev = to_net_dev(cdev);
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ +
++++++ + return sprintf(buf, "%s\n", priv->bd_stash_en? "on" : "off");
++++++ + }
++++++ +
++++++ + static ssize_t gfar_set_bd_stash(struct class_device *cdev,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct net_device *dev = to_net_dev(cdev);
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ + int new_setting = 0;
++++++ + u32 temp;
++++++ + unsigned long flags;
++++++ +
++++++ + /* Find out the new setting */
++++++ + if (!strncmp("on", buf, count-1) || !strncmp("1", buf, count-1))
++++++ + new_setting = 1;
++++++ + else if (!strncmp("off", buf, count-1) || !strncmp("0", buf, count-1))
++++++ + new_setting = 0;
++++++ + else
++++++ + return count;
++++++ +
++++++ + spin_lock_irqsave(&priv->lock, flags);
++++++ +
++++++ + /* Set the new stashing value */
++++++ + priv->bd_stash_en = new_setting;
++++++ +
++++++ + temp = gfar_read(&priv->regs->attr);
++++++ +
++++++ + if (new_setting)
++++++ + temp |= ATTR_BDSTASH;
++++++ + else
++++++ + temp &= ~(ATTR_BDSTASH);
++++++ +
++++++ + gfar_write(&priv->regs->attr, temp);
++++++ +
++++++ + spin_unlock_irqrestore(&priv->lock, flags);
++++++ +
++++++ + return count;
++++++ + }
++++++ +
++++++ + static ssize_t gfar_show_rx_stash_size(struct class_device *cdev, char *buf)
++++++ + {
++++++ + struct net_device *dev = to_net_dev(cdev);
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ +
++++++ + return sprintf(buf, "%d\n", priv->rx_stash_size);
++++++ + }
++++++ +
++++++ + static ssize_t gfar_set_rx_stash_size(struct class_device *cdev,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct net_device *dev = to_net_dev(cdev);
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ + unsigned int length = simple_strtoul(buf, NULL, 0);
++++++ + u32 temp;
++++++ + unsigned long flags;
++++++ +
++++++ + spin_lock_irqsave(&priv->lock, flags);
++++++ + if (length > priv->rx_buffer_size)
++++++ + return count;
++++++ +
++++++ + if (length == priv->rx_stash_size)
++++++ + return count;
++++++ +
++++++ + priv->rx_stash_size = length;
++++++ +
++++++ + temp = gfar_read(&priv->regs->attreli);
++++++ + temp &= ~ATTRELI_EL_MASK;
++++++ + temp |= ATTRELI_EL(length);
++++++ + gfar_write(&priv->regs->attreli, temp);
++++++ +
++++++ + /* Turn stashing on/off as appropriate */
++++++ + temp = gfar_read(&priv->regs->attr);
++++++ +
++++++ + if (length)
++++++ + temp |= ATTR_BUFSTASH;
++++++ + else
++++++ + temp &= ~(ATTR_BUFSTASH);
++++++ +
++++++ + gfar_write(&priv->regs->attr, temp);
++++++ +
++++++ + spin_unlock_irqrestore(&priv->lock, flags);
++++++ +
++++++ + return count;
++++++ + }
++++++ +
++++++ +
++++++ + /* Stashing will only be enabled when rx_stash_size != 0 */
++++++ + static ssize_t gfar_show_rx_stash_index(struct class_device *cdev, char *buf)
++++++ + {
++++++ + struct net_device *dev = to_net_dev(cdev);
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ +
++++++ + return sprintf(buf, "%d\n", priv->rx_stash_index);
++++++ + }
++++++ +
++++++ + static ssize_t gfar_set_rx_stash_index(struct class_device *cdev,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct net_device *dev = to_net_dev(cdev);
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ + unsigned short index = simple_strtoul(buf, NULL, 0);
++++++ + u32 temp;
++++++ + unsigned long flags;
++++++ +
++++++ + spin_lock_irqsave(&priv->lock, flags);
++++++ + if (index > priv->rx_stash_size)
++++++ + return count;
++++++ +
++++++ + if (index == priv->rx_stash_index)
++++++ + return count;
++++++ +
++++++ + priv->rx_stash_index = index;
++++++ +
++++++ + temp = gfar_read(&priv->regs->attreli);
++++++ + temp &= ~ATTRELI_EI_MASK;
++++++ + temp |= ATTRELI_EI(index);
++++++ + gfar_write(&priv->regs->attreli, flags);
++++++ +
++++++ + spin_unlock_irqrestore(&priv->lock, flags);
++++++ +
++++++ + return count;
++++++ + }
++++++ +
++++++ + static ssize_t gfar_show_fifo_threshold(struct class_device *cdev, char *buf)
++++++ + {
++++++ + struct net_device *dev = to_net_dev(cdev);
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ +
++++++ + return sprintf(buf, "%d\n", priv->fifo_threshold);
++++++ + }
++++++ +
++++++ + static ssize_t gfar_set_fifo_threshold(struct class_device *cdev,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct net_device *dev = to_net_dev(cdev);
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ + unsigned int length = simple_strtoul(buf, NULL, 0);
++++++ + u32 temp;
++++++ + unsigned long flags;
++++++ +
++++++ + if (length > GFAR_MAX_FIFO_THRESHOLD)
++++++ + return count;
++++++ +
++++++ + spin_lock_irqsave(&priv->lock, flags);
++++++ +
++++++ + priv->fifo_threshold = length;
++++++ +
++++++ + temp = gfar_read(&priv->regs->fifo_tx_thr);
++++++ + temp &= ~FIFO_TX_THR_MASK;
++++++ + temp |= length;
++++++ + gfar_write(&priv->regs->fifo_tx_thr, temp);
++++++ +
++++++ + spin_unlock_irqrestore(&priv->lock, flags);
++++++ +
++++++ + return count;
++++++ + }
++++++ +
++++++ + static ssize_t gfar_show_fifo_starve(struct class_device *cdev, char *buf)
++++++ + {
++++++ + struct net_device *dev = to_net_dev(cdev);
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ +
++++++ + return sprintf(buf, "%d\n", priv->fifo_starve);
++++++ + }
++++++ +
++++++ +
++++++ + static ssize_t gfar_set_fifo_starve(struct class_device *cdev,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct net_device *dev = to_net_dev(cdev);
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ + unsigned int num = simple_strtoul(buf, NULL, 0);
++++++ + u32 temp;
++++++ + unsigned long flags;
++++++ +
++++++ + if (num > GFAR_MAX_FIFO_STARVE)
++++++ + return count;
++++++ +
++++++ + spin_lock_irqsave(&priv->lock, flags);
++++++ +
++++++ + priv->fifo_starve = num;
++++++ +
++++++ + temp = gfar_read(&priv->regs->fifo_tx_starve);
++++++ + temp &= ~FIFO_TX_STARVE_MASK;
++++++ + temp |= num;
++++++ + gfar_write(&priv->regs->fifo_tx_starve, temp);
++++++ +
++++++ + spin_unlock_irqrestore(&priv->lock, flags);
++++++ +
++++++ + return count;
++++++ + }
++++++ +
++++++ + static ssize_t gfar_show_fifo_starve_off(struct class_device *cdev, char *buf)
++++++ + {
++++++ + struct net_device *dev = to_net_dev(cdev);
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ +
++++++ + return sprintf(buf, "%d\n", priv->fifo_starve_off);
++++++ + }
++++++ +
++++++ + static ssize_t gfar_set_fifo_starve_off(struct class_device *cdev,
++++++ + const char *buf, size_t count)
++++++ + {
++++++ + struct net_device *dev = to_net_dev(cdev);
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ + unsigned int num = simple_strtoul(buf, NULL, 0);
++++++ + u32 temp;
++++++ + unsigned long flags;
++++++ +
++++++ + if (num > GFAR_MAX_FIFO_STARVE_OFF)
++++++ + return count;
++++++ +
++++++ + spin_lock_irqsave(&priv->lock, flags);
++++++ +
++++++ + priv->fifo_starve_off = num;
++++++ +
++++++ + temp = gfar_read(&priv->regs->fifo_tx_starve_shutoff);
++++++ + temp &= ~FIFO_TX_STARVE_OFF_MASK;
++++++ + temp |= num;
++++++ + gfar_write(&priv->regs->fifo_tx_starve_shutoff, temp);
++++++ +
++++++ + spin_unlock_irqrestore(&priv->lock, flags);
++++++ +
++++++ + return count;
++++++ + }
++++++ +
++++++ + void gfar_init_sysfs(struct net_device *dev)
++++++ + {
++++++ + struct gfar_private *priv = netdev_priv(dev);
++++++ +
++++++ + /* Initialize the default values */
++++++ + priv->rx_stash_size = DEFAULT_STASH_LENGTH;
++++++ + priv->rx_stash_index = DEFAULT_STASH_INDEX;
++++++ + priv->fifo_threshold = DEFAULT_FIFO_TX_THR;
++++++ + priv->fifo_starve = DEFAULT_FIFO_TX_STARVE;
++++++ + priv->fifo_starve_off = DEFAULT_FIFO_TX_STARVE_OFF;
++++++ + priv->bd_stash_en = DEFAULT_BD_STASH;
++++++ +
++++++ + /* Create our sysfs files */
++++++ + GFAR_CREATE_FILE(dev, bd_stash);
++++++ + GFAR_CREATE_FILE(dev, rx_stash_size);
++++++ + GFAR_CREATE_FILE(dev, rx_stash_index);
++++++ + GFAR_CREATE_FILE(dev, fifo_threshold);
++++++ + GFAR_CREATE_FILE(dev, fifo_starve);
++++++ + GFAR_CREATE_FILE(dev, fifo_starve_off);
++++++ +
++++++ + }
diff --cc drivers/net/ibm_emac/ibm_emac_core.c
index 591c586,1da8a66,1da8a66,eb7d694,1da8a66,eb7d694,eb7d694,eb7d694,1da8a66,1da8a66,1da8a66,1da8a66..591c586
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@@@@@@@@@@@@ -408,8 -408,8 -408,8 -394,7 -408,8 -394,7 -394,7 -394,7 -408,8 -408,8 -408,8 -408,8 +408,8 @@@@@@@@@@@@@ static int emac_configure(struct ocp_en
/* Mode register */
r = EMAC_MR1_BASE(emac_opb_mhz()) | EMAC_MR1_VLE | EMAC_MR1_IST;
if (dev->phy.duplex == DUPLEX_FULL)
----------- r |= EMAC_MR1_FDE;
+++++++++++ r |= EMAC_MR1_FDE | EMAC_MR1_MWSW_001;
+ +++ dev->stop_timeout = STOP_TIMEOUT_10;
switch (dev->phy.speed) {
case SPEED_1000:
if (emac_phy_gpcs(dev->phy.mode)) {
diff --cc drivers/net/ifb.c
index 1b69925,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..1b69925
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
diff --cc drivers/net/irda/sir_core.c
index 0000000,a49f910,a49f910,a49f910,a49f910,a49f910,a49f910,a49f910,a49f910,a49f910,a49f910,a49f910..0000000
deleted file mode 000000,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644,100644
--- a/drivers/net/irda/sir_core.c
+++ /dev/null
diff --cc drivers/net/ixp2000/Kconfig
index 2fec241,2fec241,0000000,0000000,0000000,0000000,0000000,0000000,2fec241,0000000,2fec241,2fec241..2fec241
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/Kconfig
+++ b/drivers/net/ixp2000/Kconfig
diff --cc drivers/net/ixp2000/Makefile
index fd38351,fd38351,0000000,0000000,0000000,0000000,0000000,0000000,fd38351,0000000,fd38351,fd38351..fd38351
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/Makefile
+++ b/drivers/net/ixp2000/Makefile
diff --cc drivers/net/ixp2000/caleb.c
index 3595e10,3595e10,0000000,0000000,0000000,0000000,0000000,0000000,3595e10,0000000,3595e10,3595e10..3595e10
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/caleb.c
+++ b/drivers/net/ixp2000/caleb.c
diff --cc drivers/net/ixp2000/caleb.h
index e93a1ef,e93a1ef,0000000,0000000,0000000,0000000,0000000,0000000,e93a1ef,0000000,e93a1ef,e93a1ef..e93a1ef
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/caleb.h
+++ b/drivers/net/ixp2000/caleb.h
diff --cc drivers/net/ixp2000/enp2611.c
index d82651a,d82651a,0000000,0000000,0000000,0000000,0000000,0000000,d82651a,0000000,d82651a,d82651a..d82651a
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/enp2611.c
+++ b/drivers/net/ixp2000/enp2611.c
diff --cc drivers/net/ixp2000/ixp2400-msf.c
index 48a3a89,48a3a89,0000000,0000000,0000000,0000000,0000000,0000000,48a3a89,0000000,48a3a89,48a3a89..48a3a89
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/ixp2400-msf.c
+++ b/drivers/net/ixp2000/ixp2400-msf.c
diff --cc drivers/net/ixp2000/ixp2400-msf.h
index 3ac1af2,3ac1af2,0000000,0000000,0000000,0000000,0000000,0000000,3ac1af2,0000000,3ac1af2,3ac1af2..3ac1af2
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/ixp2400-msf.h
+++ b/drivers/net/ixp2000/ixp2400-msf.h
diff --cc drivers/net/ixp2000/ixp2400_rx.uc
index 42a73e3,42a73e3,0000000,0000000,0000000,0000000,0000000,0000000,42a73e3,0000000,42a73e3,42a73e3..42a73e3
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/ixp2400_rx.uc
+++ b/drivers/net/ixp2000/ixp2400_rx.uc
diff --cc drivers/net/ixp2000/ixp2400_rx.ucode
index e8aee2f,e8aee2f,0000000,0000000,0000000,0000000,0000000,0000000,e8aee2f,0000000,e8aee2f,e8aee2f..e8aee2f
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/ixp2400_rx.ucode
+++ b/drivers/net/ixp2000/ixp2400_rx.ucode
diff --cc drivers/net/ixp2000/ixp2400_tx.uc
index d090d18,d090d18,0000000,0000000,0000000,0000000,0000000,0000000,d090d18,0000000,d090d18,d090d18..d090d18
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/ixp2400_tx.uc
+++ b/drivers/net/ixp2000/ixp2400_tx.uc
diff --cc drivers/net/ixp2000/ixp2400_tx.ucode
index a433e24,a433e24,0000000,0000000,0000000,0000000,0000000,0000000,a433e24,0000000,a433e24,a433e24..a433e24
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/ixp2400_tx.ucode
+++ b/drivers/net/ixp2000/ixp2400_tx.ucode
diff --cc drivers/net/ixp2000/ixpdev.c
index 09f03f4,09f03f4,0000000,0000000,0000000,0000000,0000000,0000000,09f03f4,0000000,09f03f4,09f03f4..09f03f4
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/ixpdev.c
+++ b/drivers/net/ixp2000/ixpdev.c
diff --cc drivers/net/ixp2000/ixpdev.h
index bd686cb,bd686cb,0000000,0000000,0000000,0000000,0000000,0000000,bd686cb,0000000,bd686cb,bd686cb..bd686cb
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/ixpdev.h
+++ b/drivers/net/ixp2000/ixpdev.h
diff --cc drivers/net/ixp2000/ixpdev_priv.h
index 86aa08e,86aa08e,0000000,0000000,0000000,0000000,0000000,0000000,86aa08e,0000000,86aa08e,86aa08e..86aa08e
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/ixpdev_priv.h
+++ b/drivers/net/ixp2000/ixpdev_priv.h
diff --cc drivers/net/ixp2000/pm3386.c
index 5c7ab75,5c7ab75,0000000,0000000,0000000,0000000,0000000,0000000,5c7ab75,0000000,5c7ab75,5c7ab75..5c7ab75
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/pm3386.c
+++ b/drivers/net/ixp2000/pm3386.c
diff --cc drivers/net/ixp2000/pm3386.h
index fe92bb0,fe92bb0,0000000,0000000,0000000,0000000,0000000,0000000,fe92bb0,0000000,fe92bb0,fe92bb0..fe92bb0
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/ixp2000/pm3386.h
+++ b/drivers/net/ixp2000/pm3386.h
diff --cc drivers/net/s2io.c
index 89c4678,89c4678,e57df8d,e57df8d,669dd52,e57df8d,e57df8d,e57df8d,89c4678,669dd52,89c4678,89c4678..89c4678
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@@@@@@@@@@@@ -3542,40 -3542,40 -3554,10 -3554,10 -3554,10 -3554,10 -3554,10 -3554,10 -3542,40 -3554,10 -3542,40 -3542,40 +3542,40 @@@@@@@@@@@@@ static int s2io_xmit(struct sk_buff *sk
txdp->Control_2 |= TXD_VLAN_TAG(vlan_tag);
}
------ - txdp->Control_1 |= (TXD_BUFFER0_SIZE(frg_len) |
------ - TXD_GATHER_CODE_FIRST);
------ - txdp->Control_1 |= TXD_LIST_OWN_XENA;
++++++ + frg_len = skb->len - skb->data_len;
++++++ + if (skb_shinfo(skb)->ufo_size) {
++++++ + int ufo_size;
++++++ +
++++++ + ufo_size = skb_shinfo(skb)->ufo_size;
++++++ + ufo_size &= ~7;
++++++ + txdp->Control_1 |= TXD_UFO_EN;
++++++ + txdp->Control_1 |= TXD_UFO_MSS(ufo_size);
++++++ + txdp->Control_1 |= TXD_BUFFER0_SIZE(8);
++++++ + #ifdef __BIG_ENDIAN
++++++ + sp->ufo_in_band_v[put_off] =
++++++ + (u64)skb_shinfo(skb)->ip6_frag_id;
++++++ + #else
++++++ + sp->ufo_in_band_v[put_off] =
++++++ + (u64)skb_shinfo(skb)->ip6_frag_id << 32;
++++++ + #endif
++++++ + txdp->Host_Control = (unsigned long)sp->ufo_in_band_v;
++++++ + txdp->Buffer_Pointer = pci_map_single(sp->pdev,
++++++ + sp->ufo_in_band_v,
++++++ + sizeof(u64), PCI_DMA_TODEVICE);
++++++ + txdp++;
++++++ + txdp->Control_1 = 0;
++++++ + txdp->Control_2 = 0;
++++++ + }
++ +++
++++++ + txdp->Buffer_Pointer = pci_map_single
++++++ + (sp->pdev, skb->data, frg_len, PCI_DMA_TODEVICE);
++++++ + txdp->Host_Control = (unsigned long) skb;
++++++ + txdp->Control_1 |= TXD_BUFFER0_SIZE(frg_len);
+ +
++++++ + if (skb_shinfo(skb)->ufo_size)
++++++ + txdp->Control_1 |= TXD_UFO_EN;
++++++ +
++++++ + frg_cnt = skb_shinfo(skb)->nr_frags;
/* For fragmented SKB. */
for (i = 0; i < frg_cnt; i++) {
skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
diff --cc drivers/net/sk98lin/Makefile
index afd900d,afd900d,7653d6e,6783039,7653d6e,6783039,6783039,6783039,afd900d,7653d6e,afd900d,afd900d..afd900d
--- a/drivers/net/sk98lin/Makefile
+++ b/drivers/net/sk98lin/Makefile
@@@@@@@@@@@@@ -26,7 -26,7 -26,8 -26,9 -26,8 -26,9 -26,9 -26,9 -26,7 -26,8 -26,7 -26,7 +26,7 @@@@@@@@@@@@@ sk98lin-objs :=
skrlmt.o \
sktimer.o \
skvpd.o \
------ - skxmac2.o \
- - - skproc.o
- --- skproc.o \
- --- skcsum.o
++++++ + skxmac2.o
# DBGDEF = \
# -DDEBUG
diff --cc drivers/net/sk98lin/skcsum.c
index 0000000,0000000,0000000,38a6e7a,0000000,38a6e7a,38a6e7a,38a6e7a,0000000,0000000,0000000,0000000..0000000
deleted file mode 000000,000000,000000,100644,000000,100644,100644,100644,000000,000000,000000,000000
--- a/drivers/net/sk98lin/skcsum.c
+++ /dev/null
diff --cc drivers/net/sk98lin/skethtool.c
index 4265ed9,4265ed9,b71769a,fb63995,b71769a,fb63995,fb63995,fb63995,4265ed9,b71769a,4265ed9,4265ed9..4265ed9
--- a/drivers/net/sk98lin/skethtool.c
+++ b/drivers/net/sk98lin/skethtool.c
@@@@@@@@@@@@@ -591,12 -591,12 -549,6 -549,4 -549,6 -549,4 -549,4 -549,4 -591,12 -549,6 -591,12 -591,12 +591,12 @@@@@@@@@@@@@ struct ethtool_ops SkGeEthtoolOps =
.phys_id = locateDevice,
.get_pauseparam = getPauseParams,
.set_pauseparam = setPauseParams,
+ +++ .get_link = ethtool_op_get_link,
+ +++ .get_perm_addr = ethtool_op_get_perm_addr,
++++++ + .get_sg = ethtool_op_get_sg,
++++++ + .set_sg = setScatterGather,
++++++ + .get_tx_csum = ethtool_op_get_tx_csum,
++++++ + .set_tx_csum = setTxCsum,
++++++ + .get_rx_csum = getRxCsum,
++++++ + .set_rx_csum = setRxCsum,
};
diff --cc drivers/net/sk98lin/skge.c
index a5f2b1e,9a76ac1,ae73439,b18c92c,ae73439,b18c92c,b18c92c,b18c92c,9a76ac1,ae73439,9a76ac1,9a76ac1..a5f2b1e
--- a/drivers/net/sk98lin/skge.c
+++ b/drivers/net/sk98lin/skge.c
@@@@@@@@@@@@@ -111,8 -111,8 -110,9 -111,8 -110,9 -111,8 -111,8 -111,8 -111,8 -110,9 -111,8 -111,8 +111,8 @@@@@@@@@@@@@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
------ - #include <linux/proc_fs.h>
#include <linux/dma-mapping.h>
+ +++ #include <linux/ip.h>
#include "h/skdrv1st.h"
#include "h/skdrv2nd.h"
@@@@@@@@@@@@@ -295,9 -294,14 -296,14 -296,14 -296,14 -296,14 -296,14 -296,14 -294,14 -296,14 -294,14 -294,14 +295,9 @@@@@@@@@@@@@ static __devinit int SkGeInitPCI(SK_AC
dev->mem_start = pci_resource_start (pdev, 0);
pci_set_master(pdev);
- - -- if (pci_request_regions(pdev, "sk98lin") != 0) {
------ - if (pci_request_regions(pdev, pAC->Name) != 0) {
----------- retval = 2;
----------- goto out_disable;
----------- }
+++++++++++ retval = pci_request_regions(pdev, "sk98lin");
+++++++++++ if (retval)
+++++++++++ goto out;
#ifdef SK_BIG_ENDIAN
/*
@@@@@@@@@@@@@ -590,9 -596,9 -598,9 -598,14 -598,9 -598,14 -598,14 -598,14 -596,9 -598,9 -596,9 -596,9 +590,9 @@@@@@@@@@@@@ SK_BOOL DualNet
/* Alloc memory for this board (Mem for RxD/TxD) : */
if(!BoardAllocMem(pAC)) {
printk("No memory for descriptor rings.\n");
----------- return(-EAGAIN);
+++++++++++ return -ENOMEM;
}
- --- SkCsSetReceiveFlags(pAC,
- --- SKCS_PROTO_IP | SKCS_PROTO_TCP | SKCS_PROTO_UDP,
- --- &pAC->CsOfs1, &pAC->CsOfs2, 0);
- --- pAC->CsOfs = (pAC->CsOfs2 << 16) | pAC->CsOfs1;
- ---
BoardInitMem(pAC);
/* tschilling: New common function with minimum size check. */
DualNet = SK_FALSE;
@@@@@@@@@@@@@ -2154,15 -2162,15 -2166,16 -2206,69 -2166,16 -2206,69 -2206,69 -2206,69 -2162,15 -2166,16 -2162,15 -2162,15 +2154,15 @@@@@@@@@@@@@ rx_start
/* set length in message */
skb_put(pMsg, FrameLength);
- --- /* hardware checksum */
- --- Type = ntohs(*((short*)&pMsg->data[12]));
+ +++ } /* frame > SK_COPY_TRESHOLD */
#ifdef USE_SK_RX_CHECKSUM
- --- if (Type == 0x800) {
- --- Csum1=le16_to_cpu(pRxd->TcpSums & 0xffff);
- --- Csum2=le16_to_cpu((pRxd->TcpSums >> 16) & 0xffff);
- --- IpFrameLength = (int) ntohs((unsigned short)
- --- ((unsigned short *) pMsg->data)[8]);
- ---
- --- /*
- --- * Test: If frame is padded, a check is not possible!
- --- * Frame not padded? Length difference must be 14 (0xe)!
- --- */
- --- if ((FrameLength - IpFrameLength) != 0xe) {
- --- /* Frame padded => TCP offload not possible! */
- --- pMsg->ip_summed = CHECKSUM_NONE;
- --- } else {
- --- /* Frame not padded => TCP offload! */
- --- if ((((Csum1 & 0xfffe) && (Csum2 & 0xfffe)) &&
- --- (pAC->GIni.GIChipId == CHIP_ID_GENESIS)) ||
- --- (pAC->ChipsetType)) {
- --- Result = SkCsGetReceiveInfo(pAC,
- --- &pMsg->data[14],
- --- Csum1, Csum2, pRxPort->PortIndex);
- --- if (Result ==
- --- SKCS_STATUS_IP_FRAGMENT ||
- --- Result ==
- --- SKCS_STATUS_IP_CSUM_OK ||
- --- Result ==
- --- SKCS_STATUS_TCP_CSUM_OK ||
- --- Result ==
- --- SKCS_STATUS_UDP_CSUM_OK) {
- --- pMsg->ip_summed =
- --- CHECKSUM_UNNECESSARY;
- --- }
- --- else if (Result ==
- --- SKCS_STATUS_TCP_CSUM_ERROR ||
- --- Result ==
- --- SKCS_STATUS_UDP_CSUM_ERROR ||
- --- Result ==
- --- SKCS_STATUS_IP_CSUM_ERROR_UDP ||
- --- Result ==
- --- SKCS_STATUS_IP_CSUM_ERROR_TCP ||
- --- Result ==
- --- SKCS_STATUS_IP_CSUM_ERROR ) {
- --- /* HW Checksum error */
- --- SK_DBG_MSG(NULL, SK_DBGMOD_DRV,
- --- SK_DBGCAT_DRV_RX_PROGRESS,
- --- ("skge: CRC error. Frame dropped!\n"));
- --- goto rx_failed;
- --- } else {
- --- pMsg->ip_summed =
- --- CHECKSUM_NONE;
- --- }
- --- }/* checksumControl calculation valid */
- --- } /* Frame length check */
- --- } /* IP frame */
+ +++ pMsg->csum = pRxd->TcpSums & 0xffff;
+ +++ pMsg->ip_summed = CHECKSUM_HW;
#else
- --- pMsg->ip_summed = CHECKSUM_NONE;
+ +++ pMsg->ip_summed = CHECKSUM_NONE;
#endif
- --- } /* frame > SK_COPY_TRESHOLD */
- ---
+ +++
- - -
SK_DBG_MSG(NULL, SK_DBGMOD_DRV, 1,("V"));
ForRlmt = SK_RLMT_RX_PROTOCOL;
#if 0
@@@@@@@@@@@@@ -4768,8 -4776,7 -4815,6 -4908,6 -4815,6 -4908,6 -4908,6 -4908,6 -4776,7 -4815,6 -4776,7 -4776,7 +4768,8 @@@@@@@@@@@@@ static int __devinit skge_probe_one(str
struct net_device *dev = NULL;
static int boards_found = 0;
int error = -ENODEV;
+++++++++++ int using_dac = 0;
++++++ + char DeviceStr[80];
if (pci_enable_device(pdev))
goto out;
@@@@@@@@@@@@@ -4809,18 -4801,18 -4839,21 -4932,21 -4839,21 -4932,21 -4932,21 -4932,21 -4801,18 -4839,21 -4801,18 -4801,18 +4809,18 @@@@@@@@@@@@@
goto out_free_netdev;
}
----------- memset(pNet->pAC, 0, sizeof(SK_AC));
pAC = pNet->pAC;
pAC->PciDev = pdev;
------ - pAC->PciDevId = pdev->device;
++++++ +
pAC->dev[0] = dev;
pAC->dev[1] = dev;
------ - sprintf(pAC->Name, "SysKonnect SK-98xx");
pAC->CheckQueue = SK_FALSE;
------ - pNet->Mtu = 1500;
------ - pNet->Up = 0;
dev->irq = pdev->irq;
+++++++++++
error = SkGeInitPCI(pAC);
if (error) {
- --- printk("SKGE: PCI setup failed: %i\n", error);
+ +++ printk(KERN_ERR "sk98lin: PCI setup failed: %i\n", error);
goto out_free_netdev;
}
@@@@@@@@@@@@@ -4839,39 -4831,33 -4872,24 -4965,24 -4872,24 -4965,24 -4965,24 -4965,24 -4831,33 -4872,24 -4831,33 -4831,33 +4839,39 @@@@@@@@@@@@@
SET_NETDEV_DEV(dev, &pdev->dev);
SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps);
------ - #ifdef SK_ZEROCOPY
------ - #ifdef USE_SK_TX_CHECKSUM
++++++ + /* Use only if yukon hardware */
if (pAC->ChipsetType) {
------ - /* Use only if yukon hardware */
------ - /* SK and ZEROCOPY - fly baby... */
------ - dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
------ - }
++++++ + #ifdef USE_SK_TX_CHECKSUM
++++++ + dev->features |= NETIF_F_IP_CSUM;
+ + + #endif
++++++ + #ifdef SK_ZEROCOPY
++++++ + dev->features |= NETIF_F_SG;
+ +++ #endif
++++++ + #ifdef USE_SK_RX_CHECKSUM
++++++ + pAC->RxPort[0].RxCsum = 1;
#endif
++++++ + }
++++++ +
+++++++++++ if (using_dac)
+++++++++++ dev->features |= NETIF_F_HIGHDMA;
+ + ++
pAC->Index = boards_found++;
----------- if (SkGeBoardInit(dev, pAC))
+++++++++++ error = SkGeBoardInit(dev, pAC);
+++++++++++ if (error)
goto out_free_netdev;
++++++ + /* Read Adapter name from VPD */
++++++ + if (ProductStr(pAC, DeviceStr, sizeof(DeviceStr)) != 0) {
+++++++++++ error = -EIO;
++++++ + printk(KERN_ERR "sk98lin: Could not read VPD data.\n");
++++++ + goto out_free_resources;
++++++ + }
++++++ +
/* Register net device */
----------- if (register_netdev(dev)) {
- --- printk(KERN_ERR "SKGE: Could not register device.\n");
+++++++++++ error = register_netdev(dev);
+++++++++++ if (error) {
+ +++ printk(KERN_ERR "sk98lin: Could not register device.\n");
goto out_free_resources;
}
@@@@@@@@@@@@@ -4889,9 -4875,9 -4908,11 -5001,11 -4908,11 -5001,11 -5001,11 -5001,11 -4875,9 -4908,11 -4875,9 -4875,9 +4889,9 @@@@@@@@@@@@@
SkGeYellowLED(pAC, pAC->IoBase, 1);
- ---
memcpy(&dev->dev_addr, &pAC->Addr.Net[0].CurrentMacAddress, 6);
- ---
- --- SkGeProcCreate(dev);
+ +++ memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
- - - SkGeProcCreate(dev);
- - -
pNet->PortNr = 0;
pNet->NetNr = 0;
@@@@@@@@@@@@@ -4924,40 -4908,32 -4945,30 -5038,29 -4945,30 -5038,29 -5038,29 -5038,29 -4908,32 -4945,30 -4908,32 -4908,32 +4924,40 @@@@@@@@@@@@@
SET_NETDEV_DEV(dev, &pdev->dev);
SET_ETHTOOL_OPS(dev, &SkGeEthtoolOps);
------ - #ifdef SK_ZEROCOPY
------ - #ifdef USE_SK_TX_CHECKSUM
if (pAC->ChipsetType) {
------ - /* SG and ZEROCOPY - fly baby... */
------ - dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
------ - }
++++++ + #ifdef USE_SK_TX_CHECKSUM
++++++ + dev->features |= NETIF_F_IP_CSUM;
+ + + #endif
++++++ + #ifdef SK_ZEROCOPY
++++++ + dev->features |= NETIF_F_SG;
+ +++ #endif
++++++ + #ifdef USE_SK_RX_CHECKSUM
++++++ + pAC->RxPort[1].RxCsum = 1;
#endif
++++++ + }
++++++ +
- - -- if (register_netdev(dev)) {
- - -- printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n");
+++++++++++ if (using_dac)
+++++++++++ dev->features |= NETIF_F_HIGHDMA;
+ + ++
------ - if (register_netdev(dev)) {
- - - printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n");
- --- printk(KERN_ERR "SKGE: Could not register device.\n");
+++++++++++ error = register_netdev(dev);
+++++++++++ if (error) {
+++++++++++ printk(KERN_ERR "sk98lin: Could not register device"
+++++++++++ " for second port. (%d)\n", error);
free_netdev(dev);
----------- pAC->dev[1] = pAC->dev[0];
----------- } else {
------ - SkGeProcCreate(dev);
----------- memcpy(&dev->dev_addr,
----------- &pAC->Addr.Net[1].CurrentMacAddress, 6);
-- - ---- memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
-----------
- - -- printk("%s: %s\n", dev->name, DeviceStr);
------ - printk("%s: %s\n", dev->name, pAC->DeviceStr);
----------- printk(" PrefPort:B RlmtMode:Dual Check Link State\n");
+++++++++++ goto single_port;
}
+++++++++++
+++++++++++ pAC->dev[1] = dev;
+++++++++++ memcpy(&dev->dev_addr,
+++++++++++ &pAC->Addr.Net[1].CurrentMacAddress, 6);
+++++++++++ memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
+++++++++++
+++++++++++ printk("%s: %s\n", dev->name, DeviceStr);
+++++++++++ printk(" PrefPort:B RlmtMode:Dual Check Link State\n");
}
+++++++++++single_port:
+++++++++++
/* Save the hardware revision */
pAC->HWRevision = (((pAC->GIni.GIPciHwRev >> 4) & 0x0F)*10) +
(pAC->GIni.GIPciHwRev & 0x0F);
diff --cc drivers/net/sk98lin/skproc.c
index 0000000,0000000,5cece25,5cece25,5cece25,5cece25,5cece25,5cece25,0000000,5cece25,0000000,0000000..0000000
deleted file mode 000000,000000,100644,100644,100644,100644,100644,100644,000000,100644,000000,000000
--- a/drivers/net/sk98lin/skproc.c
+++ /dev/null
diff --cc drivers/net/sky2.c
index f8b973a,f5d697c,0000000,0000000,0000000,0000000,0000000,0000000,f5d697c,0000000,f5d697c,f5d697c..f8b973a
mode 100644,100644,000000,000000,000000,000000,000000,000000,100644,000000,100644,100644..100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@@@@@@@@@@@@ -1,3315 -1,3262 -1,0 -1,0 -1,0 -1,0 -1,0 -1,0 -1,3262 -1,0 -1,3262 -1,3262 +1,3315 @@@@@@@@@@@@@
++++++ + /*
++++++ + * New driver for Marvell Yukon 2 chipset.
++++++ + * Based on earlier sk98lin, and skge driver.
++++++ + *
++++++ + * This driver intentionally does not support all the features
++++++ + * of the original driver such as link fail-over and link management because
++++++ + * those should be done at higher levels.
++++++ + *
++++++ + * Copyright (C) 2005 Stephen Hemminger <shemminger@osdl.org>
++++++ + *
++++++ + * This program is free software; you can redistribute it and/or modify
++++++ + * it under the terms of the GNU General Public License as published by
++++++ + * the Free Software Foundation; either version 2 of the License, or
++++++ + * (at your option) any later version.
++++++ + *
++++++ + * This program is distributed in the hope that it will be useful,
++++++ + * but WITHOUT ANY WARRANTY; without even the implied warranty of
++++++ + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++++++ + * GNU General Public License for more details.
++++++ + *
++++++ + * You should have received a copy of the GNU General Public License
++++++ + * along with this program; if not, write to the Free Software
++++++ + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++++++ + */
++++++ +
++++++ + /*
++++++ + * TOTEST
++++++ + * - speed setting
++++++ + * - suspend/resume
++++++ + */
++++++ +
++++++ + #include <linux/config.h>
++++++ + #include <linux/crc32.h>
++++++ + #include <linux/kernel.h>
++++++ + #include <linux/version.h>
++++++ + #include <linux/module.h>
++++++ + #include <linux/netdevice.h>
++++++ + #include <linux/dma-mapping.h>
++++++ + #include <linux/etherdevice.h>
++++++ + #include <linux/ethtool.h>
++++++ + #include <linux/pci.h>
++++++ + #include <linux/ip.h>
++++++ + #include <linux/tcp.h>
++++++ + #include <linux/in.h>
++++++ + #include <linux/delay.h>
++++++ + #include <linux/workqueue.h>
++++++ + #include <linux/if_vlan.h>
++++++ + #include <linux/prefetch.h>
++++++ + #include <linux/mii.h>
++++++ +
++++++ + #include <asm/irq.h>
++++++ +
++++++ + #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
++++++ + #define SKY2_VLAN_TAG_USED 1
++++++ + #endif
++++++ +
++++++ + #include "sky2.h"
++++++ +
++++++ + #define DRV_NAME "sky2"
- - --#define DRV_VERSION "0.11"
+++++++++++#define DRV_VERSION "0.13"
++++++ + #define PFX DRV_NAME " "
++++++ +
++++++ + /*
++++++ + * The Yukon II chipset takes 64 bit command blocks (called list elements)
++++++ + * that are organized into three (receive, transmit, status) different rings
++++++ + * similar to Tigon3. A transmit can require several elements;
++++++ + * a receive requires one (or two if using 64 bit dma).
++++++ + */
++++++ +
++++++ + #define is_ec_a1(hw) \
++++++ + unlikely((hw)->chip_id == CHIP_ID_YUKON_EC && \
++++++ + (hw)->chip_rev == CHIP_REV_YU_EC_A1)
++++++ +
++++++ + #define RX_LE_SIZE 512
++++++ + #define RX_LE_BYTES (RX_LE_SIZE*sizeof(struct sky2_rx_le))
++++++ + #define RX_MAX_PENDING (RX_LE_SIZE/2 - 2)
++++++ + #define RX_DEF_PENDING RX_MAX_PENDING
+++++++++++#define RX_SKB_ALIGN 8
++++++ +
++++++ + #define TX_RING_SIZE 512
++++++ + #define TX_DEF_PENDING (TX_RING_SIZE - 1)
++++++ + #define TX_MIN_PENDING 64
++++++ + #define MAX_SKB_TX_LE (4 + 2*MAX_SKB_FRAGS)
++++++ +
++++++ + #define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */
++++++ + #define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le))
++++++ + #define ETH_JUMBO_MTU 9000
++++++ + #define TX_WATCHDOG (5 * HZ)
++++++ + #define NAPI_WEIGHT 64
++++++ + #define PHY_RETRIES 1000
++++++ +
++++++ + static const u32 default_msg =
++++++ + NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK
++++++ + | NETIF_MSG_TIMER | NETIF_MSG_TX_ERR | NETIF_MSG_RX_ERR
- - -- | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN | NETIF_MSG_INTR;
+++++++++++ | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN;
++++++ +
++++++ + static int debug = -1; /* defaults above */
++++++ + module_param(debug, int, 0);
++++++ + MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
++++++ +
++++++ + static int copybreak __read_mostly = 256;
++++++ + module_param(copybreak, int, 0);
++++++ + MODULE_PARM_DESC(copybreak, "Receive copy threshold");
++++++ +
++++++ + static const struct pci_device_id sky2_id_table[] = {
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4340) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4341) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4342) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4343) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4344) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4345) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4346) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4347) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4350) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4351) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4352) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4360) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4361) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4362) },
++++++ + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4363) },
++++++ + { 0 }
++++++ + };
++++++ +
++++++ + MODULE_DEVICE_TABLE(pci, sky2_id_table);
++++++ +
++++++ + /* Avoid conditionals by using array */
++++++ + static const unsigned txqaddr[] = { Q_XA1, Q_XA2 };
++++++ + static const unsigned rxqaddr[] = { Q_R1, Q_R2 };
++++++ +
++++++ + /* This driver supports yukon2 chipset only */
++++++ + static const char *yukon2_name[] = {
++++++ + "XL", /* 0xb3 */
++++++ + "EC Ultra", /* 0xb4 */
++++++ + "UNKNOWN", /* 0xb5 */
++++++ + "EC", /* 0xb6 */
++++++ + "FE", /* 0xb7 */
++++++ + };
++++++ +
++++++ + /* Access to external PHY */
++++++ + static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val)
++++++ + {
++++++ + int i;
++++++ +
++++++ + gma_write16(hw, port, GM_SMI_DATA, val);
++++++ + gma_write16(hw, port, GM_SMI_CTRL,
++++++ + GM_SMI_CT_PHY_AD(PHY_ADDR_MARV) | GM_SMI_CT_REG_AD(reg));
++++++ +
++++++ + for (i = 0; i < PHY_RETRIES; i++) {
++++++ + if (!(gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_BUSY))
++++++ + return 0;
++++++ + udelay(1);
++++++ + }
++++++ +
++++++ + printk(KERN_WARNING PFX "%s: phy write timeout\n", hw->dev[port]->name);
++++++ + return -ETIMEDOUT;
++++++ + }
++++++ +
++++++ + static int __gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg, u16 *val)
++++++ + {
++++++ + int i;
++++++ +
++++++ + gma_write16(hw, port, GM_SMI_CTRL, GM_SMI_CT_PHY_AD(PHY_ADDR_MARV)
++++++ + | GM_SMI_CT_REG_AD(reg) | GM_SMI_CT_OP_RD);
++++++ +
++++++ + for (i = 0; i < PHY_RETRIES; i++) {
++++++ + if (gma_read16(hw, port, GM_SMI_CTRL) & GM_SMI_CT_RD_VAL) {
++++++ + *val = gma_read16(hw, port, GM_SMI_DATA);
++++++ + return 0;
++++++ + }
++++++ +
++++++ + udelay(1);
++++++ + }
++++++ +
++++++ + return -ETIMEDOUT;
++++++ + }
++++++ +
++++++ + static u16 gm_phy_read(struct sky2_hw *hw, unsigned port, u16 reg)
++++++ + {
++++++ + u16 v;
++++++ +
++++++ + if (__gm_phy_read(hw, port, reg, &v) != 0)
++++++ + printk(KERN_WARNING PFX "%s: phy read timeout\n", hw->dev[port]->name);
++++++ + return v;
++++++ + }
++++++ +
++++++ + static int sky2_set_power_state(struct sky2_hw *hw, pci_power_t state)
++++++ + {
++++++ + u16 power_control;
++++++ + u32 reg1;
++++++ + int vaux;
++++++ + int ret = 0;
++++++ +
++++++ + pr_debug("sky2_set_power_state %d\n", state);
++++++ + sky2_write8(hw, B2_TST_CTRL1, TST_CFG_WRITE_ON);
++++++ +
++++++ + pci_read_config_word(hw->pdev, hw->pm_cap + PCI_PM_PMC, &power_control);
++++++ + vaux = (sky2_read8(hw, B0_CTST) & Y2_VAUX_AVAIL) &&
++++++ + (power_control & PCI_PM_CAP_PME_D3co
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment