2
* dock.c -- docking station/port replicator support
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License as published by the
6
* Free Software Foundation; either version 2, or (at your option) any
9
* This program is distributed in the hope that it will be useful, but
10
* WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* General Public License for more details.
14
* Written by Soós Péter <sp@osb.hu>, 2002-2004
15
* Modified by Mathieu Bérard <mathieu.berard@crans.org>, 2006
21
static int omnibook_dock_read(char *buffer, struct omnibook_operation *io_op)
27
if ((retval = backend_byte_read(io_op, &dock)))
30
len += sprintf(buffer + len, "Laptop is %s\n", (dock) ? "docked" : "undocked");
35
static int omnibook_dock_write(char *buffer, struct omnibook_operation *io_op)
41
retval = backend_byte_write(io_op, 0);
44
retval = backend_byte_write(io_op, 1);
53
static struct omnibook_feature dock_driver;
55
static int __init omnibook_dock_init(struct omnibook_operation *io_op)
57
/* writing is only supported on ectype 13 */
58
if(!(omnibook_ectype & TSM40))
59
dock_driver.write = NULL;
64
static struct omnibook_tbl dock_table[] __initdata = {
65
{XE3GF, SIMPLE_BYTE(EC, XE3GF_CSPR, XE3GF_CSPR_MASK)},
66
{OB500 | OB510 | OB6000 | OB6100, SIMPLE_BYTE(EC, OB500_STA1, OB500_DCKS_MASK)},
67
{OB4150, SIMPLE_BYTE(EC, OB4150_DCID, 0)},
68
{TSM40, {SMI, SMI_GET_DOCK, SMI_SET_DOCK, 0, 0, 0}},
72
static struct omnibook_feature __declared_feature dock_driver = {
75
.init = omnibook_dock_init,
76
.read = omnibook_dock_read,
77
.write = omnibook_dock_write,
78
.ectypes = XE3GF | OB500 | OB510 | OB6000 | OB6100 | OB4150 | TSM40,
82
module_param_named(dock, dock_driver.enabled, int, S_IRUGO);
83
MODULE_PARM_DESC(dock, "Use 0 to disable, 1 to enable docking station support");