# # Copyright (C) 2006-2013 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # INPUT_MODULES_MENU:=Input modules define KernelPackage/hid SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=HID Devices DEPENDS:=+kmod-input-core +kmod-input-evdev KCONFIG:=CONFIG_HID CONFIG_HIDRAW=y CONFIG_HID_BATTERY_STRENGTH=y FILES:=$(LINUX_DIR)/drivers/hid/hid.ko AUTOLOAD:=$(call AutoLoad,61,hid) endef define KernelPackage/hid/description Kernel modules for HID devices endef $(eval $(call KernelPackage,hid)) define KernelPackage/hid-generic SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=Generic HID device support DEPENDS:=+kmod-hid KCONFIG:=CONFIG_HID_GENERIC FILES:=$(LINUX_DIR)/drivers/hid/hid-generic.ko AUTOLOAD:=$(call AutoProbe,hid-generic) endef define KernelPackage/hid/description Kernel modules for generic HID device (e.g. keyboards and mice) support endef $(eval $(call KernelPackage,hid-generic)) define KernelPackage/input-core SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=Input device core KCONFIG:=CONFIG_INPUT FILES:=$(LINUX_DIR)/drivers/input/input-core.ko endef define KernelPackage/input-core/description Kernel modules for support of input device endef $(eval $(call KernelPackage,input-core)) define KernelPackage/input-evdev SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=Input event device DEPENDS:=+kmod-input-core KCONFIG:=CONFIG_INPUT_EVDEV FILES:=$(LINUX_DIR)/drivers/input/evdev.ko AUTOLOAD:=$(call AutoLoad,60,evdev) endef define KernelPackage/input-evdev/description Kernel modules for support of input device events endef $(eval $(call KernelPackage,input-evdev)) define KernelPackage/input-gpio-keys SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=GPIO key support DEPENDS:= @GPIO_SUPPORT +kmod-input-core KCONFIG:= \ CONFIG_KEYBOARD_GPIO \ CONFIG_INPUT_KEYBOARD=y FILES:=$(LINUX_DIR)/drivers/input/keyboard/gpio_keys.ko AUTOLOAD:=$(call AutoProbe,gpio_keys,1) endef define KernelPackage/input-gpio-keys/description This driver implements support for buttons connected to GPIO pins of various CPUs (and some other chips). See also gpio-button-hotplug which is an alternative, lower overhead implementation that generates uevents instead of kernel input events. endef $(eval $(call KernelPackage,input-gpio-keys)) define KernelPackage/input-gpio-keys-polled SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=Polled GPIO key support DEPENDS:=@GPIO_SUPPORT +kmod-input-polldev KCONFIG:= \ CONFIG_KEYBOARD_GPIO_POLLED \ CONFIG_INPUT_KEYBOARD=y FILES:=$(LINUX_DIR)/drivers/input/keyboard/gpio_keys_polled.ko AUTOLOAD:=$(call AutoProbe,gpio_keys_polled,1) endef define KernelPackage/input-gpio-keys-polled/description Kernel module for support polled GPIO keys input device See also gpio-button-hotplug which is an alternative, lower overhead implementation that generates uevents instead of kernel input events. endef $(eval $(call KernelPackage,input-gpio-keys-polled)) define KernelPackage/input-gpio-encoder SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=GPIO rotary encoder DEPENDS:=@GPIO_SUPPORT +kmod-input-core KCONFIG:=CONFIG_INPUT_GPIO_ROTARY_ENCODER FILES:=$(LINUX_DIR)/drivers/input/misc/rotary_encoder.ko AUTOLOAD:=$(call AutoProbe,rotary_encoder) endef define KernelPackage/input-gpio-encoder/description Kernel module to use rotary encoders connected to GPIO pins endef $(eval $(call KernelPackage,input-gpio-encoder)) define KernelPackage/input-joydev SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=Joystick device support DEPENDS:=+kmod-input-core KCONFIG:=CONFIG_INPUT_JOYDEV FILES:=$(LINUX_DIR)/drivers/input/joydev.ko AUTOLOAD:=$(call AutoProbe,joydev) endef define KernelPackage/input-joydev/description Kernel module for joystick support endef $(eval $(call KernelPackage,input-joydev)) define KernelPackage/input-polldev SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=Polled Input device support DEPENDS:=+kmod-input-core KCONFIG:=CONFIG_INPUT_POLLDEV FILES:=$(LINUX_DIR)/drivers/input/input-polldev.ko endef define KernelPackage/input-polldev/description Kernel module for support of polled input devices endef $(eval $(call KernelPackage,input-polldev)) define KernelPackage/input-matrixkmap SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=Input matrix devices support DEPENDS:=+kmod-input-core KCONFIG:=CONFIG_INPUT_MATRIXKMAP FILES:=$(LINUX_DIR)/drivers/input/matrix-keymap.ko AUTOLOAD:=$(call AutoProbe,matrix-keymap) endef define KernelPackage/input-matrixkmap/description Kernel module support for input matrix devices endef $(eval $(call KernelPackage,input-matrixkmap)) define KernelPackage/input-touchscreen-ads7846 SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=ADS7846/TSC2046/AD7873 and AD(S)7843 based touchscreens DEPENDS:=+kmod-hwmon-core +kmod-input-core +kmod-spi-bitbang KCONFIG:= \ CONFIG_INPUT_TOUCHSCREEN=y \ CONFIG_TOUCHSCREEN_PROPERTIES=y \ CONFIG_TOUCHSCREEN_ADS7846 FILES:=$(LINUX_DIR)/drivers/input/touchscreen/ads7846.ko \ $(LINUX_DIR)/drivers/input/touchscreen/of_touchscreen.ko AUTOLOAD:=$(call AutoProbe,ads7846) endef define KernelPackage/input-touchscreen-ads7846/description Kernel module for ADS7846/TSC2046/AD7873 and AD(S)7843 based touchscreens endef $(eval $(call KernelPackage,input-touchscreen-ads7846)) define KernelPackage/keyboard-imx SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=IMX keypad support DEPENDS:=@(TARGET_mxs||TARGET_imx) +kmod-input-matrixkmap KCONFIG:= \ CONFIG_KEYBOARD_IMX \ CONFIG_INPUT_KEYBOARD=y FILES:=$(LINUX_DIR)/drivers/input/keyboard/imx_keypad.ko AUTOLOAD:=$(call AutoProbe,imx_keypad) endef define KernelPackage/keyboard-imx/description Enable support for IMX keypad port. endef $(eval $(call KernelPackage,keyboard-imx)) define KernelPackage/input-uinput SUBMENU:=$(INPUT_MODULES_MENU) TITLE:=user input module DEPENDS:=+kmod-input-core KCONFIG:= \ CONFIG_INPUT_MISC=y \ CONFIG_INPUT_UINPUT FILES:=$(LINUX_DIR)/drivers/input/misc/uinput.ko AUTOLOAD:=$(call AutoProbe,uinput) endef define KernelPackage/input-uinput/description user input modules needed for bluez endef $(eval $(call KernelPackage,input-uinput)) f='#n85'>85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
/*
* vpt.h: Virtual Platform Timer definitions
*
* Copyright (c) 2004, Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place - Suite 330, Boston, MA 02111-1307 USA.
*/
#ifndef __ASM_X86_HVM_VPT_H__
#define __ASM_X86_HVM_VPT_H__
#include <xen/config.h>
#include <xen/init.h>
#include <xen/lib.h>
#include <xen/time.h>
#include <xen/errno.h>
#include <xen/time.h>
#include <xen/timer.h>
#include <xen/list.h>
#include <asm/hvm/vpic.h>
#include <asm/hvm/irq.h>
#include <public/hvm/save.h>
struct HPETState;
struct HPET_timer_fn_info {
struct HPETState *hs;
unsigned int tn;
};
struct hpet_registers {
/* Memory-mapped, software visible registers */
uint64_t capability; /* capabilities */
uint64_t config; /* configuration */
uint64_t isr; /* interrupt status reg */
uint64_t mc64; /* main counter */
struct { /* timers */
uint64_t config; /* configuration/cap */
uint64_t cmp; /* comparator */
uint64_t fsb; /* FSB route, not supported now */
} timers[HPET_TIMER_NUM];
/* Hidden register state */
uint64_t period[HPET_TIMER_NUM]; /* Last value written to comparator */
};
typedef struct HPETState {
struct hpet_registers hpet;
struct vcpu *vcpu;
uint64_t tsc_freq;
uint64_t mc_offset;
struct timer timers[HPET_TIMER_NUM];
struct HPET_timer_fn_info timer_fn_info[HPET_TIMER_NUM];
spinlock_t lock;
} HPETState;
/*
* Abstract layer of periodic time, one short time.
*/
typedef void time_cb(struct vcpu *v, void *opaque);
struct periodic_time {
struct list_head list;
bool_t on_list;
bool_t one_shot;
bool_t do_not_freeze;
bool_t irq_issued;
#define PTSRC_isa 1 /* ISA time source */
#define PTSRC_lapic 2 /* LAPIC time source */
u8 source; /* PTSRC_ */
u8 irq;
struct vcpu *vcpu; /* vcpu timer interrupt delivers to */
u32 pending_intr_nr; /* pending timer interrupts */
u64 period; /* frequency in ns */
u64 period_cycles; /* frequency in cpu cycles */
s_time_t scheduled; /* scheduled timer interrupt */
u64 last_plt_gtime; /* platform time when last IRQ is injected */
struct timer timer; /* ac_timer */
time_cb *cb;
void *priv; /* point back to platform time source */
};
#define PIT_FREQ 1193181
#define PIT_BASE 0x40
typedef struct PITState {
/* Hardware state */
struct hvm_hw_pit hw;
/* Last time the counters read zero, for calcuating counter reads */
int64_t count_load_time[3];
/* Channel 0 IRQ handling. */
struct periodic_time pt0;
spinlock_t lock;
} PITState;
typedef struct RTCState {
/* Hardware state */
struct hvm_hw_rtc hw;
/* RTC's idea of the current time */
struct tm current_tm;
/* second update */
int64_t next_second_time;
struct timer second_timer;
struct timer second_timer2;
struct periodic_time pt;
int32_t time_offset_seconds;
spinlock_t lock;
} RTCState;
#define FREQUENCE_PMTIMER 3579545 /* Timer should run at 3.579545 MHz */
typedef struct PMTState {
struct hvm_hw_pmtimer pm; /* 32bit timer value */
struct vcpu *vcpu; /* Keeps sync with this vcpu's guest-time */
uint64_t last_gtime; /* Last (guest) time we updated the timer */
uint64_t scale; /* Multiplier to get from tsc to timer ticks */
struct timer timer; /* To make sure we send SCIs */
spinlock_t lock;
} PMTState;
struct pl_time { /* platform time */
struct PITState vpit;
struct RTCState vrtc;
struct HPETState vhpet;
struct PMTState vpmt;
};
#define ticks_per_sec(v) (v->domain->arch.hvm_domain.tsc_frequency)
void pt_save_timer(struct vcpu *v);
void pt_restore_timer(struct vcpu *v);
void pt_update_irq(struct vcpu *v);
void pt_intr_post(struct vcpu *v, struct hvm_intack intack);
void pt_reset(struct vcpu *v);
void pt_migrate(struct vcpu *v);
/* Is given periodic timer active? */
#define pt_active(pt) ((pt)->on_list)
/*
* Create/destroy a periodic (or one-shot!) timer.
* The given periodic timer structure must be initialised with zero bytes,
* except for the 'source' field which must be initialised with the
* correct PTSRC_ value. The initialised timer structure can then be passed
* to {create,destroy}_periodic_time() and number of times and in any order.
* Note that, for a given periodic timer, invocations of these functions MUST
* be serialised.
*/
void create_periodic_time(
struct vcpu *v, struct periodic_time *pt, uint64_t period,
uint8_t irq, char one_shot, time_cb *cb, void *data);
void destroy_periodic_time(struct periodic_time *pt);
int pv_pit_handler(int port, int data, int write);
void pit_init(struct vcpu *v, unsigned long cpu_khz);
void pit_stop_channel0_irq(PITState * pit);
void pit_deinit(struct domain *d);
void rtc_init(struct vcpu *v, int base);
void rtc_migrate_timers(struct vcpu *v);
void rtc_deinit(struct domain *d);
void pmtimer_init(struct vcpu *v);
void pmtimer_deinit(struct domain *d);
void hpet_migrate_timers(struct vcpu *v);
void hpet_init(struct vcpu *v);
void hpet_deinit(struct domain *d);
#endif /* __ASM_X86_HVM_VPT_H__ */