Instead of holding SPEC-variable dependent files and directories inline within the repository structure, move them into 'spec' subdirectories at the corresponding levels, e.g.: repos/base/include/spec repos/base/mk/spec repos/base/lib/mk/spec repos/base/src/core/spec ... Moreover, this commit removes the 'platform' directories. That term was used in an overloaded sense. All SPEC-relative 'platform' directories are now named 'spec'. Other files, like for instance those related to the kernel/architecture specific startup library, where moved from 'platform' directories to explicit, more meaningful places like e.g.: 'src/lib/startup'. Fix #1673
69 lines
1.5 KiB
C++
69 lines
1.5 KiB
C++
/**
|
|
* \brief Input driver front-end
|
|
* \author Norman Feske
|
|
* \author Christian Helmuth
|
|
* \author Stefan Kalkowski
|
|
* \date 2006-08-30
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2006-2015 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.
|
|
*/
|
|
|
|
/* Genode includes */
|
|
#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>
|
|
#include <input/root.h>
|
|
#include <base/printf.h>
|
|
#include <os/server.h>
|
|
|
|
/* local includes */
|
|
#include <driver.h>
|
|
|
|
using namespace Genode;
|
|
|
|
|
|
struct Main
|
|
{
|
|
Server::Entrypoint &ep;
|
|
|
|
Input::Session_component session;
|
|
Input::Root_component root;
|
|
|
|
Main(Server::Entrypoint &ep)
|
|
: ep(ep), root(ep.rpc_ep(), session)
|
|
{
|
|
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);
|
|
Input::Tablet_driver::factory(ep, session.event_queue());
|
|
break;
|
|
default:
|
|
PWRN("No input driver available for this board");
|
|
}
|
|
|
|
/* tell parent about the service */
|
|
env()->parent()->announce(ep.manage(root));
|
|
}
|
|
};
|
|
|
|
/************
|
|
** Server **
|
|
************/
|
|
|
|
namespace Server {
|
|
char const *name() { return "input_drv_ep"; }
|
|
size_t stack_size() { return 2*1024*sizeof(long); }
|
|
void construct(Entrypoint &ep) { static Main server(ep); }
|
|
}
|