blob: 2e1ff029432d949867a607e5d57cff7a1abcea96 [file] [log] [blame]
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/bind/bind.gni")
import("//build/cipd.gni")
import("//build/components.gni")
import("//build/drivers.gni")
import("//build/test.gni")
config_7703_path = "gt6853/goodix_cfg_group_sit7703.bin"
config_9364_path = "gt6853/goodix_cfg_group_fiti9364.bin"
config_9365_path = "gt6853/goodix_cfg_group_fiti9365.bin"
firmware_path = "gt6853/goodix_firmware.bin"
fuchsia_driver_package("gt6853") {
driver_components = [ ":gt6853-module" ]
deps = []
if (internal_access) {
deps += [
":config-7703",
":config-9364",
":config-9365",
":firmware",
]
}
}
if (internal_access) {
resource("config-7703") {
sources = [ "//prebuilt/touch/$config_7703_path" ]
outputs = [ "lib/firmware/$config_7703_path" ]
}
resource("config-9364") {
sources = [ "//prebuilt/touch/$config_9364_path" ]
outputs = [ "lib/firmware/$config_9364_path" ]
}
resource("config-9365") {
sources = [ "//prebuilt/touch/$config_9365_path" ]
outputs = [ "lib/firmware/$config_9365_path" ]
}
resource("firmware") {
sources = [ "//prebuilt/touch/$firmware_path" ]
outputs = [ "lib/firmware/$firmware_path" ]
}
}
group("common") {
public_deps = [
":gt6853-bind",
"//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.hidbus:fuchsia.hardware.hidbus_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp",
"//sdk/fidl/fuchsia.input.report:fuchsia.input.report_llcpp",
"//sdk/fidl/fuchsia.mem:fuchsia.mem_llcpp",
"//sdk/lib/input_report_reader",
"//src/devices/i2c/lib/device-protocol-i2c-channel",
"//src/devices/lib/driver",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/hid",
"//zircon/system/ulib/inspect",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zircon-internal",
"//zircon/system/ulib/zx",
]
}
driver_bind_rules("gt6853-bind") {
rules = "gt6853.bind"
header_output = "gt6853-bind.h"
tests = "gt6853-bind-test.json"
deps = [ "//src/devices/bind/fuchsia.goodix.platform" ]
}
fuchsia_driver("gt6853-module-driver") {
output_name = "gt6853"
sources = [
"gt6853-nelson.cc",
"gt6853.cc",
]
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
deps = [ ":common" ]
defines = [
"GT6853_CONFIG_7703_PATH=\"$config_7703_path\"",
"GT6853_CONFIG_9364_PATH=\"$config_9364_path\"",
"GT6853_CONFIG_9365_PATH=\"$config_9365_path\"",
"GT6853_FIRMWARE_PATH=\"$firmware_path\"",
]
}
fuchsia_driver_component("gt6853-module") {
info = "gt6853-module-info.json"
component_name = "gt6853"
deps = [ ":gt6853-module-driver" ]
colocate = true
}
test("gt6853-test") {
output_name = "gt6853-test"
configs += [ "//build/config:all_source" ]
sources = [
"gt6853-nelson.cc",
"gt6853-test.cc",
"gt6853.cc",
]
deps = [
":common",
"//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp_mock",
"//sdk/lib/inspect/testing/cpp:zxtest",
"//src/devices/i2c/testing/fake-i2c",
"//src/devices/testing/mock-ddk",
"//zircon/system/ulib/mock-function",
"//zircon/system/ulib/zxtest",
]
defines = [
"GT6853_CONFIG_7703_PATH=\"$config_7703_path\"",
"GT6853_CONFIG_9364_PATH=\"$config_9364_path\"",
"GT6853_CONFIG_9365_PATH=\"$config_9365_path\"",
"GT6853_FIRMWARE_PATH=\"$firmware_path\"",
]
}
fuchsia_unittest_package("gt6853-test-package") {
package_name = "gt6853-test"
deps = [ ":gt6853-test" ]
}
group("tests") {
testonly = true
deps = [
":gt6853-bind_test",
":gt6853-test-package",
]
}