74 lines
2.9 KiB
C
74 lines
2.9 KiB
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <wayland-client.h>
|
|
|
|
struct device_information {
|
|
char const* const device_name;
|
|
|
|
bool screen_rotation_supported;
|
|
char const* const target_output;
|
|
char const* const target_motion_sensor;
|
|
enum wl_output_transform const sensor_to_output_rotation[4];
|
|
|
|
bool basestation_detection_supported;
|
|
uint16_t const basestation_vendor_id;
|
|
uint16_t const basestation_product_id;
|
|
};
|
|
|
|
static struct device_information DEVICE_INFORMATION_GENERIC = {
|
|
.device_name = "generic",
|
|
.screen_rotation_supported = true,
|
|
.target_output = "eDP-1",
|
|
.target_motion_sensor = "/sys/bus/iio/devices/iio:device0",
|
|
.sensor_to_output_rotation =
|
|
{
|
|
[ACCEL_ROTATION_0DEG] = WL_OUTPUT_TRANSFORM_NORMAL,
|
|
[ACCEL_ROTATION_90DEG] = WL_OUTPUT_TRANSFORM_90,
|
|
[ACCEL_ROTATION_180DEG] = WL_OUTPUT_TRANSFORM_180,
|
|
[ACCEL_ROTATION_270DEG] = WL_OUTPUT_TRANSFORM_270,
|
|
},
|
|
.basestation_detection_supported = false,
|
|
.basestation_vendor_id = 0,
|
|
.basestation_product_id = 0,
|
|
};
|
|
|
|
static struct device_information DEVICE_INFOS[] = {
|
|
{
|
|
// Lenovo Miix 320-10icr
|
|
// https://support.lenovo.com/us/en/solutions/pd104871-product-overview-miix-320-10icr
|
|
.device_name = "lenovo-miix-320-10icr",
|
|
.screen_rotation_supported = true,
|
|
.target_output = "DSI-1",
|
|
.target_motion_sensor = "/sys/bus/iio/devices/iio:device0",
|
|
.sensor_to_output_rotation =
|
|
{
|
|
[ACCEL_ROTATION_0DEG] = WL_OUTPUT_TRANSFORM_270,
|
|
[ACCEL_ROTATION_90DEG] = WL_OUTPUT_TRANSFORM_NORMAL,
|
|
[ACCEL_ROTATION_180DEG] = WL_OUTPUT_TRANSFORM_90,
|
|
[ACCEL_ROTATION_270DEG] = WL_OUTPUT_TRANSFORM_180,
|
|
},
|
|
.basestation_detection_supported = true,
|
|
.basestation_vendor_id = 0x048d,
|
|
.basestation_product_id = 0x8911,
|
|
},
|
|
{
|
|
// Samsung Chromebook Pro
|
|
// https://www.samsung.com/us/computing/chromebooks/12-14/samsung-chromebook-pro-xe510c24-k01us/
|
|
.device_name = "google-caroline",
|
|
.screen_rotation_supported = true,
|
|
.target_output = "eDP-1",
|
|
.target_motion_sensor = "/sys/bus/iio/devices/iio:device1",
|
|
.sensor_to_output_rotation =
|
|
{
|
|
[ACCEL_ROTATION_0DEG] = WL_OUTPUT_TRANSFORM_NORMAL,
|
|
[ACCEL_ROTATION_90DEG] = WL_OUTPUT_TRANSFORM_270,
|
|
[ACCEL_ROTATION_180DEG] = WL_OUTPUT_TRANSFORM_180,
|
|
[ACCEL_ROTATION_270DEG] = WL_OUTPUT_TRANSFORM_90,
|
|
},
|
|
.basestation_detection_supported = false,
|
|
.basestation_vendor_id = 0,
|
|
.basestation_product_id = 0,
|
|
},
|
|
};
|