Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67457
b: refs/heads/master
c: 435706b
h: refs/heads/master
i:
  67455: 793719d
v: v3
  • Loading branch information
Grant Likely authored and Josh Boyer committed Oct 3, 2007
1 parent 2f72c7a commit 2c66866
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8fa7b6100693e0b648ffd34564f6f41226502a19
refs/heads/master: 435706b385d1f5422e44ee86b5dec0a2150eca02
43 changes: 40 additions & 3 deletions trunk/drivers/serial/uartlite.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@
#define ULITE_MINOR 187
#define ULITE_NR_UARTS 4

/* For register details see datasheet:
http://www.xilinx.com/bvdocs/ipcenter/data_sheet/opb_uartlite.pdf
*/
/* ---------------------------------------------------------------------
* Register definitions
*
* For register details see datasheet:
* http://www.xilinx.com/bvdocs/ipcenter/data_sheet/opb_uartlite.pdf
*/

#define ULITE_RX 0x00
#define ULITE_TX 0x04
#define ULITE_STATUS 0x08
Expand All @@ -49,6 +53,10 @@

static struct uart_port ulite_ports[ULITE_NR_UARTS];

/* ---------------------------------------------------------------------
* Core UART driver operations
*/

static int ulite_receive(struct uart_port *port, int stat)
{
struct tty_struct *tty = port->info->tty;
Expand Down Expand Up @@ -308,6 +316,10 @@ static struct uart_ops ulite_ops = {
.verify_port = ulite_verify_port
};

/* ---------------------------------------------------------------------
* Console driver operations
*/

#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
static void ulite_console_wait_tx(struct uart_port *port)
{
Expand Down Expand Up @@ -413,6 +425,19 @@ static struct uart_driver ulite_uart_driver = {
#endif
};

/* ---------------------------------------------------------------------
* Port assignment functions (mapping devices to uart_port structures)
*/

/** ulite_assign: register a uartlite device with the driver
*
* @dev: pointer to device structure
* @id: requested id number. Pass -1 for automatic port assignment
* @base: base address of uartlite registers
* @irq: irq number for uartlite
*
* Returns: 0 on success, <0 otherwise
*/
static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq)
{
struct uart_port *port;
Expand Down Expand Up @@ -465,6 +490,10 @@ static int __devinit ulite_assign(struct device *dev, int id, u32 base, int irq)
return 0;
}

/** ulite_release: register a uartlite device with the driver
*
* @dev: pointer to device structure
*/
static int __devinit ulite_release(struct device *dev)
{
struct uart_port *port = dev_get_drvdata(dev);
Expand All @@ -479,6 +508,10 @@ static int __devinit ulite_release(struct device *dev)
return rc;
}

/* ---------------------------------------------------------------------
* Platform bus binding
*/

static int __devinit ulite_probe(struct platform_device *pdev)
{
struct resource *res, *res2;
Expand Down Expand Up @@ -508,6 +541,10 @@ static struct platform_driver ulite_platform_driver = {
},
};

/* ---------------------------------------------------------------------
* Module setup/teardown
*/

int __init ulite_init(void)
{
int ret;
Expand Down

0 comments on commit 2c66866

Please sign in to comment.