From 66ee9365c5313d4a1bbb76561b3188566e44c025 Mon Sep 17 00:00:00 2001 From: Kyle Repinski Date: Tue, 17 Nov 2015 12:53:22 -0600 Subject: Update some hw_device_t structs. version_major and version_minor are deprecated. Ensure we actually set the sensor api version. --- keymaster/keymaster_tuna.cpp | 22 +++++++++++----------- liblight/lights.c | 6 +++--- libsensors/sensors.cpp | 7 ++++--- nfc/nfc_hw.c | 4 ++-- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/keymaster/keymaster_tuna.cpp b/keymaster/keymaster_tuna.cpp index ce97478..4385f23 100644 --- a/keymaster/keymaster_tuna.cpp +++ b/keymaster/keymaster_tuna.cpp @@ -949,20 +949,20 @@ static int tee_open(const hw_module_t* module, const char* name, } static struct hw_module_methods_t keystore_module_methods = { - open: tee_open, + .open = tee_open, }; struct keystore_module HAL_MODULE_INFO_SYM __attribute__ ((visibility ("default"))) = { - common: { - tag: HARDWARE_MODULE_TAG, - module_api_version: KEYMASTER_MODULE_API_VERSION_0_3, - hal_api_version: HARDWARE_HAL_API_VERSION, - id: KEYSTORE_HARDWARE_MODULE_ID, - name: "Keymaster TEE HAL", - author: "The Android Open Source Project", - methods: &keystore_module_methods, - dso: 0, - reserved: {}, + .common = { + .tag = HARDWARE_MODULE_TAG, + .module_api_version = KEYMASTER_MODULE_API_VERSION_0_3, + .hal_api_version = HARDWARE_HAL_API_VERSION, + .id = KEYSTORE_HARDWARE_MODULE_ID, + .name = "Keymaster TEE HAL", + .author = "The Android Open Source Project", + .methods = &keystore_module_methods, + .dso = 0, + .reserved = {}, }, }; diff --git a/liblight/lights.c b/liblight/lights.c index 943fc2f..a64e6b5 100644 --- a/liblight/lights.c +++ b/liblight/lights.c @@ -265,13 +265,13 @@ static int open_lights(const struct hw_module_t *module, char const *name, } static struct hw_module_methods_t lights_module_methods = { - .open = open_lights, + .open = open_lights, }; struct hw_module_t HAL_MODULE_INFO_SYM = { .tag = HARDWARE_MODULE_TAG, - .version_major = 1, - .version_minor = 0, + .module_api_version = 1, + .hal_api_version = HARDWARE_HAL_API_VERSION, .id = LIGHTS_HARDWARE_MODULE_ID, .name = "lights Module", .author = "Google, Inc.", diff --git a/libsensors/sensors.cpp b/libsensors/sensors.cpp index bee3f7a..fe2070e 100644 --- a/libsensors/sensors.cpp +++ b/libsensors/sensors.cpp @@ -121,8 +121,8 @@ static struct hw_module_methods_t sensors_module_methods = { struct sensors_module_t HAL_MODULE_INFO_SYM = { .common = { .tag = HARDWARE_MODULE_TAG, - .version_major = 1, - .version_minor = 0, + .module_api_version = SENSORS_MODULE_API_VERSION_0_1, + .hal_api_version = HARDWARE_HAL_API_VERSION, .id = SENSORS_HARDWARE_MODULE_ID, .name = "Samsung Sensor module", .author = "Samsung Electronic Company", @@ -395,7 +395,8 @@ static int open_sensors(const struct hw_module_t* module, memset(&dev->device, 0, sizeof(sensors_poll_device_t)); dev->device.common.tag = HARDWARE_DEVICE_TAG; - dev->device.common.version = 0; + // TODO: We can't expect this version to be supported forever... + dev->device.common.version = SENSORS_DEVICE_API_VERSION_0_1; dev->device.common.module = const_cast(module); dev->device.common.close = poll__close; dev->device.activate = poll__activate; diff --git a/nfc/nfc_hw.c b/nfc/nfc_hw.c index 295bcab..1095375 100644 --- a/nfc/nfc_hw.c +++ b/nfc/nfc_hw.c @@ -142,8 +142,8 @@ static struct hw_module_methods_t nfc_module_methods = { struct nfc_module_t HAL_MODULE_INFO_SYM = { .common = { .tag = HARDWARE_MODULE_TAG, - .version_major = 1, - .version_minor = 0, + .module_api_version = 1, + .hal_api_version = HARDWARE_HAL_API_VERSION, .id = NFC_HARDWARE_MODULE_ID, .name = "Tuna NFC HW HAL", .author = "The Android Open Source Project", -- cgit v1.1