diff options
| author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-23 17:24:26 +0000 | 
|---|---|---|
| committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-24 23:45:32 +0000 | 
| commit | bdd92c9ad287e03a2ec52f5a89c470cd5caae1c2 (patch) | |
| tree | 38d863507e900fb2ccac4c22fcf8934271c051b5 /drivers/tty/hvc/hvc_tile.c | |
| parent | a37f2f87edc1b6e5932becf6e51535d36b690f2a (diff) | |
| parent | 8e934dbf264418afe4d1dff34ce074ecc14280db (diff) | |
| download | olio-linux-3.10-bdd92c9ad287e03a2ec52f5a89c470cd5caae1c2.tar.xz olio-linux-3.10-bdd92c9ad287e03a2ec52f5a89c470cd5caae1c2.zip  | |
Merge branch 'drm-intel-fixes' into drm-intel-next
Merge important suspend and resume regression fixes and resolve the
small conflict.
Conflicts:
	drivers/gpu/drm/i915/i915_dma.c
Diffstat (limited to 'drivers/tty/hvc/hvc_tile.c')
| -rw-r--r-- | drivers/tty/hvc/hvc_tile.c | 68 | 
1 files changed, 68 insertions, 0 deletions
diff --git a/drivers/tty/hvc/hvc_tile.c b/drivers/tty/hvc/hvc_tile.c new file mode 100644 index 00000000000..7a84a059547 --- /dev/null +++ b/drivers/tty/hvc/hvc_tile.c @@ -0,0 +1,68 @@ +/* + * Copyright 2010 Tilera Corporation. All Rights Reserved. + * + *   This program is free software; you can redistribute it and/or + *   modify it under the terms of the GNU General Public License + *   as published by the Free Software Foundation, version 2. + * + *   This program is distributed in the hope that it will be useful, but + *   WITHOUT ANY WARRANTY; without even the implied warranty of + *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or + *   NON INFRINGEMENT.  See the GNU General Public License for + *   more details. + * + * Tilera TILE Processor hypervisor console + */ + +#include <linux/console.h> +#include <linux/delay.h> +#include <linux/err.h> +#include <linux/init.h> +#include <linux/moduleparam.h> +#include <linux/types.h> + +#include <hv/hypervisor.h> + +#include "hvc_console.h" + +static int hvc_tile_put_chars(uint32_t vt, const char *buf, int count) +{ +	return hv_console_write((HV_VirtAddr)buf, count); +} + +static int hvc_tile_get_chars(uint32_t vt, char *buf, int count) +{ +	int i, c; + +	for (i = 0; i < count; ++i) { +		c = hv_console_read_if_ready(); +		if (c < 0) +			break; +		buf[i] = c; +	} + +	return i; +} + +static const struct hv_ops hvc_tile_get_put_ops = { +	.get_chars = hvc_tile_get_chars, +	.put_chars = hvc_tile_put_chars, +}; + +static int __init hvc_tile_console_init(void) +{ +	extern void disable_early_printk(void); +	hvc_instantiate(0, 0, &hvc_tile_get_put_ops); +	add_preferred_console("hvc", 0, NULL); +	disable_early_printk(); +	return 0; +} +console_initcall(hvc_tile_console_init); + +static int __init hvc_tile_init(void) +{ +	struct hvc_struct *s; +	s = hvc_alloc(0, 0, &hvc_tile_get_put_ops, 128); +	return IS_ERR(s) ? PTR_ERR(s) : 0; +} +device_initcall(hvc_tile_init);  |