aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_cs5536.c
diff options
context:
space:
mode:
authorWu Zhangjin <wuzhangjin@gmail.com>2010-12-24 08:39:08 -0500
committerJeff Garzik <jgarzik@redhat.com>2010-12-24 13:33:23 -0500
commit9272dcc232b84ccb027d6861077934055d42764d (patch)
tree5409dd6200065ae89675a6b56faff18066930b2c /drivers/ata/pata_cs5536.c
parent687a993339c4f3a63654746230da3aab8bbdbffd (diff)
pata_cs5536: Add support for non-X86_32 platforms
pata_cs5536 does work on the other platforms(e.g. Loongson, a MIPS variant), so, remove the dependency of X86_32 and fix the building errors under the other platforms via only reserving the X86_32 specific parts for X86_32. pata_amd also supports cs5536 IDE controller, but this one saves about 33k for the compressed kernel image(vmlinuz for MIPS). Signed-off-by: Zhang Le <r0bertz@gentoo.org> Signed-off-by: Chen Jie <chenj@lemote.com> Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_cs5536.c')
-rw-r--r--drivers/ata/pata_cs5536.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/ata/pata_cs5536.c b/drivers/ata/pata_cs5536.c
index 21ee23f89e88..a6e6c963b6ae 100644
--- a/drivers/ata/pata_cs5536.c
+++ b/drivers/ata/pata_cs5536.c
@@ -37,10 +37,20 @@
37#include <linux/delay.h> 37#include <linux/delay.h>
38#include <linux/libata.h> 38#include <linux/libata.h>
39#include <scsi/scsi_host.h> 39#include <scsi/scsi_host.h>
40
41#ifdef CONFIG_X86_32
40#include <asm/msr.h> 42#include <asm/msr.h>
43static int use_msr;
44module_param_named(msr, use_msr, int, 0644);
45MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");
46#else
47#define rdmsr(x, y, z) do { } while (0)
48#define wrmsr(x, y, z) do { } while (0)
49#define use_msr 0
50#endif
41 51
42#define DRV_NAME "pata_cs5536" 52#define DRV_NAME "pata_cs5536"
43#define DRV_VERSION "0.0.7" 53#define DRV_VERSION "0.0.8"
44 54
45enum { 55enum {
46 CFG = 0, 56 CFG = 0,
@@ -75,8 +85,6 @@ enum {
75 IDE_ETC_NODMA = 0x03, 85 IDE_ETC_NODMA = 0x03,
76}; 86};
77 87
78static int use_msr;
79
80static const u32 msr_reg[4] = { 88static const u32 msr_reg[4] = {
81 MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC, 89 MSR_IDE_CFG, MSR_IDE_DTC, MSR_IDE_CAST, MSR_IDE_ETC,
82}; 90};
@@ -88,7 +96,7 @@ static const u8 pci_reg[4] = {
88static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val) 96static inline int cs5536_read(struct pci_dev *pdev, int reg, u32 *val)
89{ 97{
90 if (unlikely(use_msr)) { 98 if (unlikely(use_msr)) {
91 u32 dummy; 99 u32 dummy __maybe_unused;
92 100
93 rdmsr(msr_reg[reg], *val, dummy); 101 rdmsr(msr_reg[reg], *val, dummy);
94 return 0; 102 return 0;
@@ -294,8 +302,6 @@ MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller");
294MODULE_LICENSE("GPL"); 302MODULE_LICENSE("GPL");
295MODULE_DEVICE_TABLE(pci, cs5536); 303MODULE_DEVICE_TABLE(pci, cs5536);
296MODULE_VERSION(DRV_VERSION); 304MODULE_VERSION(DRV_VERSION);
297module_param_named(msr, use_msr, int, 0644);
298MODULE_PARM_DESC(msr, "Force using MSR to configure IDE function (Default: 0)");
299 305
300module_init(cs5536_init); 306module_init(cs5536_init);
301module_exit(cs5536_exit); 307module_exit(cs5536_exit);