Commit 72f86d08 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull pcmcia fixes from Dominik Brodowski:
 "These are just a few odd fixes and improvements to the PCMCIA core and
  to a few PCMCIA device drivers"

* 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux:
  pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges
  pcmcia: pcmcia_resource: Replace mdelay() with msleep()
  pcmcia: add error handling for pcmcia_enable_device in qlogic_stub
  char: pcmcia: cm4000_cs: Replace mdelay with usleep_range in set_protocol
  pcmcia: Use module_pcmcia_driver for scsi drivers
  pcmcia: remove KERN_INFO level from debug message
parents c403993a 95691e3e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -530,7 +530,7 @@ static int set_protocol(struct cm4000_dev *dev, struct ptsreq *ptsreq)
			DEBUGP(5, dev, "NumRecBytes is valid\n");
			break;
		}
		mdelay(10);
		usleep_range(10000, 11000);
	}
	if (i == 100) {
		DEBUGP(5, dev, "Timeout waiting for NumRecBytes getting "
@@ -546,7 +546,7 @@ static int set_protocol(struct cm4000_dev *dev, struct ptsreq *ptsreq)
			DEBUGP(2, dev, "NumRecBytes = %i\n", num_bytes_read);
			break;
		}
		mdelay(10);
		usleep_range(10000, 11000);
	}

	/* check whether it is a short PTS reply? */
+1 −1
Original line number Diff line number Diff line
@@ -505,7 +505,7 @@ static void cm4040_reader_release(struct pcmcia_device *link)

	DEBUGP(3, dev, "-> cm4040_reader_release\n");
	while (link->open) {
		DEBUGP(3, dev, KERN_INFO MODULE_NAME ": delaying release "
		DEBUGP(3, dev, MODULE_NAME ": delaying release "
		       "until process has terminated\n");
 		wait_event(dev->devq, (link->open == 0));
	}
+2 −2
Original line number Diff line number Diff line
@@ -284,7 +284,7 @@ int pcmcia_fixup_iowidth(struct pcmcia_device *p_dev)
		io_on.stop = s->io[i].res->end;

		s->ops->set_io_map(s, &io_off);
		mdelay(40);
		msleep(40);
		s->ops->set_io_map(s, &io_on);
	}
unlock:
@@ -567,7 +567,7 @@ int pcmcia_enable_device(struct pcmcia_device *p_dev)
			!(flags & CONF_ENABLE_PULSE_IRQ))
			option |= COR_LEVEL_REQ;
		pcmcia_write_cis_mem(s, 1, (base + CISREG_COR)>>1, 1, &option);
		mdelay(40);
		msleep(40);
	}
	if (p_dev->config_regs & PRESENT_STATUS)
		pcmcia_write_cis_mem(s, 1, (base + CISREG_CCSR)>>1, 1, &status);
+35 −0
Original line number Diff line number Diff line
@@ -119,6 +119,10 @@
#define  RL5C4XX_MISC_CONTROL           0x2F /* 8 bit */
#define  RL5C4XX_ZV_ENABLE              0x08

/* Misc Control 3 Register */
#define RL5C4XX_MISC3			0x00A2 /* 16 bit */
#define  RL5C47X_MISC3_CB_CLKRUN_DIS	BIT(1)

#ifdef __YENTA_H

#define rl_misc(socket)		((socket)->private[0])
@@ -156,6 +160,35 @@ static void ricoh_set_zv(struct yenta_socket *socket)
        }
}

static void ricoh_set_clkrun(struct yenta_socket *socket, bool quiet)
{
	u16 misc3;

	/*
	 * RL5C475II likely has this setting, too, however no datasheet
	 * is publicly available for this chip
	 */
	if (socket->dev->device != PCI_DEVICE_ID_RICOH_RL5C476 &&
	    socket->dev->device != PCI_DEVICE_ID_RICOH_RL5C478)
		return;

	if (socket->dev->revision < 0x80)
		return;

	misc3 = config_readw(socket, RL5C4XX_MISC3);
	if (misc3 & RL5C47X_MISC3_CB_CLKRUN_DIS) {
		if (!quiet)
			dev_dbg(&socket->dev->dev,
				"CLKRUN feature already disabled\n");
	} else if (disable_clkrun) {
		if (!quiet)
			dev_info(&socket->dev->dev,
				 "Disabling CLKRUN feature\n");
		misc3 |= RL5C47X_MISC3_CB_CLKRUN_DIS;
		config_writew(socket, RL5C4XX_MISC3, misc3);
	}
}

static void ricoh_save_state(struct yenta_socket *socket)
{
	rl_misc(socket) = config_readw(socket, RL5C4XX_MISC);
@@ -172,6 +205,7 @@ static void ricoh_restore_state(struct yenta_socket *socket)
	config_writew(socket, RL5C4XX_16BIT_IO_0, rl_io(socket));
	config_writew(socket, RL5C4XX_16BIT_MEM_0, rl_mem(socket));
	config_writew(socket, RL5C4XX_CONFIG, rl_config(socket));
	ricoh_set_clkrun(socket, true);
}


@@ -197,6 +231,7 @@ static int ricoh_override(struct yenta_socket *socket)
	config_writew(socket, RL5C4XX_CONFIG, config);

	ricoh_set_zv(socket);
	ricoh_set_clkrun(socket, false);

	return 0;
}
+2 −1
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@

static bool disable_clkrun;
module_param(disable_clkrun, bool, 0444);
MODULE_PARM_DESC(disable_clkrun, "If PC card doesn't function properly, please try this option");
MODULE_PARM_DESC(disable_clkrun,
		 "If PC card doesn't function properly, please try this option (TI and Ricoh bridges only)");

static bool isa_probe = 1;
module_param(isa_probe, bool, 0444);
Loading