Commit 706c27d2 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k parport local_irq*() updates

Convert m68k parport drivers to new local_irq*() framework:
  - Atari parport
parent 7f0eb5bd
...@@ -25,11 +25,10 @@ parport_atari_read_data(struct parport *p) ...@@ -25,11 +25,10 @@ parport_atari_read_data(struct parport *p)
unsigned long flags; unsigned long flags;
unsigned char data; unsigned char data;
save_flags(flags); local_irq_save(flags);
cli();
sound_ym.rd_data_reg_sel = 15; sound_ym.rd_data_reg_sel = 15;
data = sound_ym.rd_data_reg_sel; data = sound_ym.rd_data_reg_sel;
restore_flags(flags); local_irq_restore(flags);
return data; return data;
} }
...@@ -38,11 +37,10 @@ parport_atari_write_data(struct parport *p, unsigned char data) ...@@ -38,11 +37,10 @@ parport_atari_write_data(struct parport *p, unsigned char data)
{ {
unsigned long flags; unsigned long flags;
save_flags(flags); local_irq_save(flags);
cli();
sound_ym.rd_data_reg_sel = 15; sound_ym.rd_data_reg_sel = 15;
sound_ym.wd_data = data; sound_ym.wd_data = data;
restore_flags(flags); local_irq_restore(flags);
} }
static unsigned char static unsigned char
...@@ -51,12 +49,11 @@ parport_atari_read_control(struct parport *p) ...@@ -51,12 +49,11 @@ parport_atari_read_control(struct parport *p)
unsigned long flags; unsigned long flags;
unsigned char control = 0; unsigned char control = 0;
save_flags(flags); local_irq_save(flags);
cli();
sound_ym.rd_data_reg_sel = 14; sound_ym.rd_data_reg_sel = 14;
if (!(sound_ym.rd_data_reg_sel & (1 << 5))) if (!(sound_ym.rd_data_reg_sel & (1 << 5)))
control = PARPORT_CONTROL_STROBE; control = PARPORT_CONTROL_STROBE;
restore_flags(flags); local_irq_restore(flags);
return control; return control;
} }
...@@ -65,14 +62,13 @@ parport_atari_write_control(struct parport *p, unsigned char control) ...@@ -65,14 +62,13 @@ parport_atari_write_control(struct parport *p, unsigned char control)
{ {
unsigned long flags; unsigned long flags;
save_flags(flags); local_irq_save(flags);
cli();
sound_ym.rd_data_reg_sel = 14; sound_ym.rd_data_reg_sel = 14;
if (control & PARPORT_CONTROL_STROBE) if (control & PARPORT_CONTROL_STROBE)
sound_ym.wd_data = sound_ym.rd_data_reg_sel & ~(1 << 5); sound_ym.wd_data = sound_ym.rd_data_reg_sel & ~(1 << 5);
else else
sound_ym.wd_data = sound_ym.rd_data_reg_sel | (1 << 5); sound_ym.wd_data = sound_ym.rd_data_reg_sel | (1 << 5);
restore_flags(flags); local_irq_restore(flags);
} }
static unsigned char static unsigned char
...@@ -129,12 +125,11 @@ parport_atari_data_forward(struct parport *p) ...@@ -129,12 +125,11 @@ parport_atari_data_forward(struct parport *p)
{ {
unsigned long flags; unsigned long flags;
save_flags(flags); local_irq_save(flags);
cli();
/* Soundchip port B as output. */ /* Soundchip port B as output. */
sound_ym.rd_data_reg_sel = 7; sound_ym.rd_data_reg_sel = 7;
sound_ym.wd_data = sound_ym.rd_data_reg_sel | 0x40; sound_ym.wd_data = sound_ym.rd_data_reg_sel | 0x40;
restore_flags(flags); local_irq_restore(flags);
} }
static void static void
...@@ -143,12 +138,11 @@ parport_atari_data_reverse(struct parport *p) ...@@ -143,12 +138,11 @@ parport_atari_data_reverse(struct parport *p)
#if 0 /* too dangerous, can kill sound chip */ #if 0 /* too dangerous, can kill sound chip */
unsigned long flags; unsigned long flags;
save_flags(flags); local_irq_save(flags);
cli();
/* Soundchip port B as input. */ /* Soundchip port B as input. */
sound_ym.rd_data_reg_sel = 7; sound_ym.rd_data_reg_sel = 7;
sound_ym.wd_data = sound_ym.rd_data_reg_sel & ~0x40; sound_ym.wd_data = sound_ym.rd_data_reg_sel & ~0x40;
restore_flags(flags); local_irq_restore(flags);
#endif #endif
} }
...@@ -209,15 +203,14 @@ parport_atari_init(void) ...@@ -209,15 +203,14 @@ parport_atari_init(void)
unsigned long flags; unsigned long flags;
if (MACH_IS_ATARI) { if (MACH_IS_ATARI) {
save_flags(flags); local_irq_save(flags);
cli();
/* Soundchip port A/B as output. */ /* Soundchip port A/B as output. */
sound_ym.rd_data_reg_sel = 7; sound_ym.rd_data_reg_sel = 7;
sound_ym.wd_data = (sound_ym.rd_data_reg_sel & 0x3f) | 0xc0; sound_ym.wd_data = (sound_ym.rd_data_reg_sel & 0x3f) | 0xc0;
/* STROBE high. */ /* STROBE high. */
sound_ym.rd_data_reg_sel = 14; sound_ym.rd_data_reg_sel = 14;
sound_ym.wd_data = sound_ym.rd_data_reg_sel | (1 << 5); sound_ym.wd_data = sound_ym.rd_data_reg_sel | (1 << 5);
restore_flags(flags); local_irq_restore(flags);
/* MFP port I0 as input. */ /* MFP port I0 as input. */
mfp.data_dir &= ~1; mfp.data_dir &= ~1;
/* MFP port I0 interrupt on high->low edge. */ /* MFP port I0 interrupt on high->low edge. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment