From f70575805708cabdedea7498aaa3f710fde4d920 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Wed, 31 Jan 2024 03:29:01 +0000 Subject: [PATCH] add lvds1024*800 --- kernel/drivers/parport/ieee1284.c | 100 +++++++++++++++++++------------------------------ 1 files changed, 39 insertions(+), 61 deletions(-) diff --git a/kernel/drivers/parport/ieee1284.c b/kernel/drivers/parport/ieee1284.c index f12b9da..4547ac4 100644 --- a/kernel/drivers/parport/ieee1284.c +++ b/kernel/drivers/parport/ieee1284.c @@ -31,12 +31,6 @@ #undef DEBUG /* Don't want a garbled console */ #endif -#ifdef DEBUG -#define DPRINTK(stuff...) printk (stuff) -#else -#define DPRINTK(stuff...) -#endif - /* Make parport_wait_peripheral wake up. * It will be useful to call this from an interrupt handler. */ static void parport_ieee1284_wakeup (struct parport *port) @@ -258,16 +252,15 @@ PARPORT_STATUS_PAPEROUT, PARPORT_STATUS_PAPEROUT); if (r) - DPRINTK (KERN_INFO "%s: Timeout at event 49\n", + pr_debug("%s: Timeout at event 49\n", port->name); parport_data_forward (port); - DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n", - port->name); + pr_debug("%s: ECP direction: forward\n", port->name); port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; } - /* fall through */ + fallthrough; default: /* Terminate from all other modes. */ @@ -281,8 +274,7 @@ /* Event 24: nAck goes low */ r = parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0); if (r) - DPRINTK (KERN_INFO "%s: Timeout at event 24\n", - port->name); + pr_debug("%s: Timeout at event 24\n", port->name); /* Event 25: Set nAutoFd low */ parport_frob_control (port, @@ -294,8 +286,7 @@ PARPORT_STATUS_ACK, PARPORT_STATUS_ACK); if (r) - DPRINTK (KERN_INFO "%s: Timeout at event 27\n", - port->name); + pr_debug("%s: Timeout at event 27\n", port->name); /* Event 29: Set nAutoFd high */ parport_frob_control (port, PARPORT_CONTROL_AUTOFD, 0); @@ -304,8 +295,7 @@ port->ieee1284.mode = IEEE1284_MODE_COMPAT; port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; - DPRINTK (KERN_DEBUG "%s: In compatibility (forward idle) mode\n", - port->name); + pr_debug("%s: In compatibility (forward idle) mode\n", port->name); } #endif /* IEEE1284 support */ @@ -329,7 +319,7 @@ #ifndef CONFIG_PARPORT_1284 if (mode == IEEE1284_MODE_COMPAT) return 0; - printk (KERN_ERR "parport: IEEE1284 not supported in this kernel\n"); + pr_err("parport: IEEE1284 not supported in this kernel\n"); return -1; #else int m = mode & ~IEEE1284_ADDR; @@ -406,8 +396,7 @@ PARPORT_CONTROL_SELECT | PARPORT_CONTROL_AUTOFD, PARPORT_CONTROL_SELECT); - DPRINTK (KERN_DEBUG - "%s: Peripheral not IEEE1284 compliant (0x%02X)\n", + pr_debug("%s: Peripheral not IEEE1284 compliant (0x%02X)\n", port->name, parport_read_status (port)); port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; return -1; /* Not IEEE1284 compliant */ @@ -430,8 +419,7 @@ PARPORT_STATUS_ACK, PARPORT_STATUS_ACK)) { /* This shouldn't really happen with a compliant device. */ - DPRINTK (KERN_DEBUG - "%s: Mode 0x%02x not supported? (0x%02x)\n", + pr_debug("%s: Mode 0x%02x not supported? (0x%02x)\n", port->name, mode, port->ops->read_status (port)); parport_ieee1284_terminate (port); return 1; @@ -442,7 +430,7 @@ /* xflag should be high for all modes other than nibble (0). */ if (mode && !xflag) { /* Mode not supported. */ - DPRINTK (KERN_DEBUG "%s: Mode 0x%02x rejected by peripheral\n", + pr_debug("%s: Mode 0x%02x rejected by peripheral\n", port->name, mode); parport_ieee1284_terminate (port); return 1; @@ -463,9 +451,7 @@ /* Event 52: nAck goes low */ if (parport_wait_peripheral (port, PARPORT_STATUS_ACK, 0)) { /* This peripheral is _very_ slow. */ - DPRINTK (KERN_DEBUG - "%s: Event 52 didn't happen\n", - port->name); + pr_debug("%s: Event 52 didn't happen\n", port->name); parport_ieee1284_terminate (port); return 1; } @@ -481,10 +467,9 @@ PARPORT_STATUS_ACK)) { /* This shouldn't really happen with a compliant * device. */ - DPRINTK (KERN_DEBUG - "%s: Mode 0x%02x not supported? (0x%02x)\n", + pr_debug("%s: Mode 0x%02x not supported? (0x%02x)\n", port->name, mode, - port->ops->read_status (port)); + port->ops->read_status(port)); parport_ieee1284_terminate (port); return 1; } @@ -495,8 +480,8 @@ /* xflag should be high. */ if (!xflag) { /* Extended mode not supported. */ - DPRINTK (KERN_DEBUG "%s: Extended mode 0x%02x not " - "supported\n", port->name, mode); + pr_debug("%s: Extended mode 0x%02x not supported\n", + port->name, mode); parport_ieee1284_terminate (port); return 1; } @@ -505,7 +490,7 @@ } /* Mode is supported */ - DPRINTK (KERN_DEBUG "%s: In mode 0x%02x\n", port->name, mode); + pr_debug("%s: In mode 0x%02x\n", port->name, mode); port->ieee1284.mode = mode; /* But ECP is special */ @@ -522,13 +507,11 @@ PARPORT_STATUS_PAPEROUT, PARPORT_STATUS_PAPEROUT); if (r) { - DPRINTK (KERN_INFO "%s: Timeout at event 31\n", - port->name); + pr_debug("%s: Timeout at event 31\n", port->name); } port->ieee1284.phase = IEEE1284_PH_FWD_IDLE; - DPRINTK (KERN_DEBUG "%s: ECP direction: forward\n", - port->name); + pr_debug("%s: ECP direction: forward\n", port->name); } else switch (mode) { case IEEE1284_MODE_NIBBLE: case IEEE1284_MODE_BYTE: @@ -573,7 +556,7 @@ if (port->ieee1284.phase == IEEE1284_PH_REV_IDLE) { /* An interrupt in this phase means that data * is now available. */ - DPRINTK (KERN_DEBUG "%s: Data available\n", port->name); + pr_debug("%s: Data available\n", port->name); parport_ieee1284_ack_data_avail (port); } #endif /* IEEE1284 support */ @@ -615,15 +598,14 @@ case IEEE1284_MODE_NIBBLE: case IEEE1284_MODE_BYTE: parport_negotiate (port, IEEE1284_MODE_COMPAT); - /* fall through */ + fallthrough; case IEEE1284_MODE_COMPAT: - DPRINTK (KERN_DEBUG "%s: Using compatibility mode\n", - port->name); + pr_debug("%s: Using compatibility mode\n", port->name); fn = port->ops->compat_write_data; break; case IEEE1284_MODE_EPP: - DPRINTK (KERN_DEBUG "%s: Using EPP mode\n", port->name); + pr_debug("%s: Using EPP mode\n", port->name); if (addr) { fn = port->ops->epp_write_addr; } else { @@ -631,8 +613,7 @@ } break; case IEEE1284_MODE_EPPSWE: - DPRINTK (KERN_DEBUG "%s: Using software-emulated EPP mode\n", - port->name); + pr_debug("%s: Using software-emulated EPP mode\n", port->name); if (addr) { fn = parport_ieee1284_epp_write_addr; } else { @@ -641,7 +622,7 @@ break; case IEEE1284_MODE_ECP: case IEEE1284_MODE_ECPRLE: - DPRINTK (KERN_DEBUG "%s: Using ECP mode\n", port->name); + pr_debug("%s: Using ECP mode\n", port->name); if (addr) { fn = port->ops->ecp_write_addr; } else { @@ -650,8 +631,7 @@ break; case IEEE1284_MODE_ECPSWE: - DPRINTK (KERN_DEBUG "%s: Using software-emulated ECP mode\n", - port->name); + pr_debug("%s: Using software-emulated ECP mode\n", port->name); /* The caller has specified that it must be emulated, * even if we have ECP hardware! */ if (addr) { @@ -662,13 +642,13 @@ break; default: - DPRINTK (KERN_DEBUG "%s: Unknown mode 0x%02x\n", port->name, - port->ieee1284.mode); + pr_debug("%s: Unknown mode 0x%02x\n", + port->name, port->ieee1284.mode); return -ENOSYS; } retval = (*fn) (port, buffer, len, 0); - DPRINTK (KERN_DEBUG "%s: wrote %d/%d bytes\n", port->name, retval, len); + pr_debug("%s: wrote %zd/%zu bytes\n", port->name, retval, len); return retval; #endif /* IEEE1284 support */ } @@ -694,7 +674,7 @@ ssize_t parport_read (struct parport *port, void *buffer, size_t len) { #ifndef CONFIG_PARPORT_1284 - printk (KERN_ERR "parport: IEEE1284 not supported in this kernel\n"); + pr_err("parport: IEEE1284 not supported in this kernel\n"); return -ENODEV; #else int mode = port->physport->ieee1284.mode; @@ -715,26 +695,26 @@ if ((port->physport->modes & PARPORT_MODE_TRISTATE) && !parport_negotiate (port, IEEE1284_MODE_BYTE)) { /* got into BYTE mode OK */ - DPRINTK (KERN_DEBUG "%s: Using byte mode\n", port->name); + pr_debug("%s: Using byte mode\n", port->name); fn = port->ops->byte_read_data; break; } if (parport_negotiate (port, IEEE1284_MODE_NIBBLE)) { return -EIO; } - /* fall through to NIBBLE */ + fallthrough; /* to NIBBLE */ case IEEE1284_MODE_NIBBLE: - DPRINTK (KERN_DEBUG "%s: Using nibble mode\n", port->name); + pr_debug("%s: Using nibble mode\n", port->name); fn = port->ops->nibble_read_data; break; case IEEE1284_MODE_BYTE: - DPRINTK (KERN_DEBUG "%s: Using byte mode\n", port->name); + pr_debug("%s: Using byte mode\n", port->name); fn = port->ops->byte_read_data; break; case IEEE1284_MODE_EPP: - DPRINTK (KERN_DEBUG "%s: Using EPP mode\n", port->name); + pr_debug("%s: Using EPP mode\n", port->name); if (addr) { fn = port->ops->epp_read_addr; } else { @@ -742,8 +722,7 @@ } break; case IEEE1284_MODE_EPPSWE: - DPRINTK (KERN_DEBUG "%s: Using software-emulated EPP mode\n", - port->name); + pr_debug("%s: Using software-emulated EPP mode\n", port->name); if (addr) { fn = parport_ieee1284_epp_read_addr; } else { @@ -752,19 +731,18 @@ break; case IEEE1284_MODE_ECP: case IEEE1284_MODE_ECPRLE: - DPRINTK (KERN_DEBUG "%s: Using ECP mode\n", port->name); + pr_debug("%s: Using ECP mode\n", port->name); fn = port->ops->ecp_read_data; break; case IEEE1284_MODE_ECPSWE: - DPRINTK (KERN_DEBUG "%s: Using software-emulated ECP mode\n", - port->name); + pr_debug("%s: Using software-emulated ECP mode\n", port->name); fn = parport_ieee1284_ecp_read_data; break; default: - DPRINTK (KERN_DEBUG "%s: Unknown mode 0x%02x\n", port->name, - port->physport->ieee1284.mode); + pr_debug("%s: Unknown mode 0x%02x\n", + port->name, port->physport->ieee1284.mode); return -ENOSYS; } -- Gitblit v1.6.2