aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_sil680.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2011-10-11 14:21:50 -0400
committerJeff Garzik <jgarzik@redhat.com>2011-10-14 12:46:45 -0400
commit7a113d38406cb1056f77bf9a802f2df46409ab05 (patch)
tree9048de8af2d952affb66ec1ea12831237a17d546 /drivers/ata/pata_sil680.c
parent9b8ad4ac790041b40146a3cb7aefe1a5a5db953d (diff)
pata_sil680: minor CodingStyle fixups
Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_sil680.c')
-rw-r--r--drivers/ata/pata_sil680.c58
1 files changed, 33 insertions, 25 deletions
diff --git a/drivers/ata/pata_sil680.c b/drivers/ata/pata_sil680.c
index caa426e6930f..b92eacf8dd3c 100644
--- a/drivers/ata/pata_sil680.c
+++ b/drivers/ata/pata_sil680.c
@@ -82,7 +82,8 @@ static unsigned long sil680_seldev(struct ata_port *ap, struct ata_device *adev,
82 * space for us. 82 * space for us.
83 */ 83 */
84 84
85static int sil680_cable_detect(struct ata_port *ap) { 85static int sil680_cable_detect(struct ata_port *ap)
86{
86 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 87 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
87 unsigned long addr = sil680_selreg(ap, 0); 88 unsigned long addr = sil680_selreg(ap, 0);
88 u8 ata66; 89 u8 ata66;
@@ -181,7 +182,7 @@ static void sil680_set_dmamode(struct ata_port *ap, struct ata_device *adev)
181 mode &= ~(0x03 << port_shift); 182 mode &= ~(0x03 << port_shift);
182 183
183 /* Extract scsc */ 184 /* Extract scsc */
184 scsc = (scsc & 0x30) ? 1: 0; 185 scsc = (scsc & 0x30) ? 1 : 0;
185 186
186 if (adev->dma_mode >= XFER_UDMA_0) { 187 if (adev->dma_mode >= XFER_UDMA_0) {
187 multi = 0x10C1; 188 multi = 0x10C1;
@@ -254,7 +255,7 @@ static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
254{ 255{
255 u8 tmpbyte = 0; 256 u8 tmpbyte = 0;
256 257
257 /* FIXME: double check */ 258 /* FIXME: double check */
258 pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 259 pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE,
259 pdev->revision ? 1 : 255); 260 pdev->revision ? 1 : 255);
260 261
@@ -272,22 +273,22 @@ static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
272 *try_mmio = (tmpbyte & 1) || pci_resource_start(pdev, 5); 273 *try_mmio = (tmpbyte & 1) || pci_resource_start(pdev, 5);
273#endif 274#endif
274 275
275 switch(tmpbyte & 0x30) { 276 switch (tmpbyte & 0x30) {
276 case 0x00: 277 case 0x00:
277 /* 133 clock attempt to force it on */ 278 /* 133 clock attempt to force it on */
278 pci_write_config_byte(pdev, 0x8A, tmpbyte|0x10); 279 pci_write_config_byte(pdev, 0x8A, tmpbyte|0x10);
279 break; 280 break;
280 case 0x30: 281 case 0x30:
281 /* if clocking is disabled */ 282 /* if clocking is disabled */
282 /* 133 clock attempt to force it on */ 283 /* 133 clock attempt to force it on */
283 pci_write_config_byte(pdev, 0x8A, tmpbyte & ~0x20); 284 pci_write_config_byte(pdev, 0x8A, tmpbyte & ~0x20);
284 break; 285 break;
285 case 0x10: 286 case 0x10:
286 /* 133 already */ 287 /* 133 already */
287 break; 288 break;
288 case 0x20: 289 case 0x20:
289 /* BIOS set PCI x2 clocking */ 290 /* BIOS set PCI x2 clocking */
290 break; 291 break;
291 } 292 }
292 293
293 pci_read_config_byte(pdev, 0x8A, &tmpbyte); 294 pci_read_config_byte(pdev, 0x8A, &tmpbyte);
@@ -305,12 +306,19 @@ static u8 sil680_init_chip(struct pci_dev *pdev, int *try_mmio)
305 pci_write_config_dword(pdev, 0xB8, 0x43924392); 306 pci_write_config_dword(pdev, 0xB8, 0x43924392);
306 pci_write_config_dword(pdev, 0xBC, 0x40094009); 307 pci_write_config_dword(pdev, 0xBC, 0x40094009);
307 308
308 switch(tmpbyte & 0x30) { 309 switch (tmpbyte & 0x30) {
309 case 0x00: printk(KERN_INFO "sil680: 100MHz clock.\n");break; 310 case 0x00:
310 case 0x10: printk(KERN_INFO "sil680: 133MHz clock.\n");break; 311 printk(KERN_INFO "sil680: 100MHz clock.\n");
311 case 0x20: printk(KERN_INFO "sil680: Using PCI clock.\n");break; 312 break;
312 /* This last case is _NOT_ ok */ 313 case 0x10:
313 case 0x30: printk(KERN_ERR "sil680: Clock disabled ?\n"); 314 printk(KERN_INFO "sil680: 133MHz clock.\n");
315 break;
316 case 0x20:
317 printk(KERN_INFO "sil680: Using PCI clock.\n");
318 break;
319 /* This last case is _NOT_ ok */
320 case 0x30:
321 printk(KERN_ERR "sil680: Clock disabled ?\n");
314 } 322 }
315 return tmpbyte & 0x30; 323 return tmpbyte & 0x30;
316} 324}