genode/repos/os/include/regulator/driver.h
Norman Feske ca971bbfd8 Move repositories to 'repos/' subdirectory
This patch changes the top-level directory layout as a preparatory
step for improving the tools for managing 3rd-party source codes.
The rationale is described in the issue referenced below.

Issue #1082
2014-05-14 16:08:00 +02:00

51 lines
1.0 KiB
C++

/*
* \brief Regulator-driver interface
* \author Stefan Kalkowski
* \date 2013-06-13
*/
/*
* Copyright (C) 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.
*/
#ifndef _INCLUDE__REGULATOR__DRIVER_H_
#define _INCLUDE__REGULATOR__DRIVER_H_
#include <regulator/consts.h>
namespace Regulator {
/**
* Interface to be implemented by the device-specific driver code
*/
struct Driver
{
virtual void level(Regulator_id id, unsigned long level) = 0;
virtual unsigned long level(Regulator_id id) = 0;
virtual void state(Regulator_id id, bool enable) = 0;
virtual bool state(Regulator_id id) = 0;
};
/**
* Interface for constructing the driver object
*/
struct Driver_factory
{
/**
* Construct new driver
*/
virtual Driver &create(Regulator_id regulator) = 0;
/**
* Destroy driver
*/
virtual void destroy(Driver &driver) = 0;
};
}
#endif /* _REGULATOR__DRIVER_H_ */