2013-05-07 12:10:47 +02:00
|
|
|
/**
|
|
|
|
* \brief Input driver front-end
|
|
|
|
* \author Norman Feske
|
|
|
|
* \author Christian Helmuth
|
|
|
|
* \author Stefan Kalkowski
|
|
|
|
* \date 2006-08-30
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2006-2013 Genode Labs GmbH
|
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
2014-05-07 10:33:20 +02:00
|
|
|
/* Genode includes */
|
2013-05-07 12:10:47 +02:00
|
|
|
#include <base/env.h>
|
|
|
|
#include <base/sleep.h>
|
|
|
|
#include <base/rpc_server.h>
|
|
|
|
#include <cap_session/connection.h>
|
|
|
|
#include <platform_session/connection.h>
|
|
|
|
#include <input/component.h>
|
2014-05-07 10:33:20 +02:00
|
|
|
#include <input/root.h>
|
2013-05-07 12:10:47 +02:00
|
|
|
#include <base/printf.h>
|
|
|
|
|
2014-05-07 10:33:20 +02:00
|
|
|
/* local includes */
|
2013-05-07 12:10:47 +02:00
|
|
|
#include <driver.h>
|
|
|
|
|
|
|
|
using namespace Genode;
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
/* initialize server entry point */
|
|
|
|
enum { STACK_SIZE = 4096 };
|
|
|
|
static Cap_connection cap;
|
|
|
|
static Rpc_entrypoint ep(&cap, STACK_SIZE, "input_ep");
|
|
|
|
|
2014-05-07 10:33:20 +02:00
|
|
|
static Input::Session_component session;
|
|
|
|
|
2013-05-07 12:10:47 +02:00
|
|
|
Platform::Connection plat_drv;
|
|
|
|
switch (plat_drv.revision()) {
|
|
|
|
case Platform::Session::SMD:
|
|
|
|
plat_drv.enable(Platform::Session::I2C_2);
|
|
|
|
plat_drv.enable(Platform::Session::I2C_3);
|
|
|
|
plat_drv.enable(Platform::Session::BUTTONS);
|
2014-05-07 10:33:20 +02:00
|
|
|
Input::Tablet_driver::factory(session.event_queue());
|
2013-11-19 14:46:23 +01:00
|
|
|
break;
|
2013-05-07 12:10:47 +02:00
|
|
|
default:
|
|
|
|
PWRN("No input driver available for this board");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* entry point serving input root interface */
|
2014-05-07 10:33:20 +02:00
|
|
|
static Input::Root_component root(ep, session);
|
2013-05-07 12:10:47 +02:00
|
|
|
|
|
|
|
/* tell parent about the service */
|
2014-05-07 10:33:20 +02:00
|
|
|
env()->parent()->announce(ep.manage(&root));
|
2013-05-07 12:10:47 +02:00
|
|
|
|
|
|
|
/* main's done - go to sleep */
|
|
|
|
sleep_forever();
|
|
|
|
return 0;
|
|
|
|
}
|