#define SPI_OPCODE_WREN 0x06
#define SPI_OPCODE_FAST_READ 0x0b
+#ifdef DEBUG_TRACE
+#define debug_trace(fmt, args...) debug(fmt, ##args)
+#else
+#define debug_trace(x, args...)
+#endif
+
struct ich_spi_platdata {
pci_dev_t dev; /* PCI device number */
int ich_version; /* Controller version, 7 or 9 */
{
u8 value = readb(priv->base + reg);
- debug("read %2.2x from %4.4x\n", value, reg);
+ debug_trace("read %2.2x from %4.4x\n", value, reg);
return value;
}
{
u16 value = readw(priv->base + reg);
- debug("read %4.4x from %4.4x\n", value, reg);
+ debug_trace("read %4.4x from %4.4x\n", value, reg);
return value;
}
{
u32 value = readl(priv->base + reg);
- debug("read %8.8x from %4.4x\n", value, reg);
+ debug_trace("read %8.8x from %4.4x\n", value, reg);
return value;
}
static void ich_writeb(struct ich_spi_priv *priv, u8 value, int reg)
{
writeb(value, priv->base + reg);
- debug("wrote %2.2x to %4.4x\n", value, reg);
+ debug_trace("wrote %2.2x to %4.4x\n", value, reg);
}
static void ich_writew(struct ich_spi_priv *priv, u16 value, int reg)
{
writew(value, priv->base + reg);
- debug("wrote %4.4x to %4.4x\n", value, reg);
+ debug_trace("wrote %4.4x to %4.4x\n", value, reg);
}
static void ich_writel(struct ich_spi_priv *priv, u32 value, int reg)
{
writel(value, priv->base + reg);
- debug("wrote %8.8x to %4.4x\n", value, reg);
+ debug_trace("wrote %8.8x to %4.4x\n", value, reg);
}
static void write_reg(struct ich_spi_priv *priv, const void *value,
}
memcpy(trans->cmd, dout, bytes);
trans->cmd_len = bytes;
- debug("ICH SPI: Saved %d bytes\n", bytes);
+ debug_trace("ICH SPI: Saved %d bytes\n", bytes);
return 0;
}
trans->out = trans->cmd;
trans->bytesout = trans->cmd_len;
using_cmd = 1;
- debug("ICH SPI: Using %d bytes\n", trans->cmd_len);
+ debug_trace("ICH SPI: Using %d bytes\n", trans->cmd_len);
} else {
trans->out = dout;
trans->bytesout = dout ? bytes : 0;
if (using_cmd && dout && bytes) {
trans->out = dout;
trans->bytesout = bytes;
- debug("ICH SPI: Moving to data, %d bytes\n", bytes);
+ debug_trace("ICH SPI: Moving to data, %d bytes\n", bytes);
}
/* Preset control fields */