blob: a4e12fb1de687621fc4d131c9288900c9d1451ac [file]
# Copyright 2019 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")
driver_bind_rules("gt92xx_bind") {
rules = "gt92xx.bind"
header_output = "gt92xx_bind.h"
bind_output = "goodix.bindbc"
tests = "bind_tests.json"
deps = [ "//src/devices/bind/fuchsia.google.platform" ]
}
astro_firmware_path =
"gt9293-astro/GT9293_6105(6E43)_Official_Release_20180917.bin"
fuchsia_driver("goodix-module-driver") {
output_name = "goodix"
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = [
"gt92xx-firmware.cc",
"gt92xx.cc",
]
defines = [ "GT9293_ASTRO_FIRMWARE_PATH=\"$astro_firmware_path\"" ]
deps = [
":gt92xx_bind",
"//sdk/banjo/fuchsia.hardware.clock:fuchsia.hardware.clock_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.hidbus:fuchsia.hardware.hidbus_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.i2c:fuchsia.hardware.i2c_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp",
"//src/devices/i2c/lib/device-protocol-i2c",
"//src/devices/i2c/lib/device-protocol-i2c-channel",
"//src/devices/lib/driver",
"//src/devices/lib/mmio",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/hid",
"//zircon/system/ulib/inspect",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/trace:trace-driver",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxc",
]
# TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
fuchsia_driver_component("goodix-module") {
component_name = "goodix"
deps = [ ":goodix-module-driver" ]
info = "goodix-module-info.json"
colocate = true
}
if (internal_access) {
resource("astro-firmware") {
sources = [ "//prebuilt/touch/$astro_firmware_path" ]
outputs = [ "lib/firmware/$astro_firmware_path" ]
}
}
fuchsia_driver_package("goodix") {
driver_components = [ ":goodix-module" ]
deps = []
if (internal_access) {
deps += [ ":astro-firmware" ]
}
}
group("test") {
testonly = true
deps = [ ":gt92xx-test" ]
}
test("gt92xx-test") {
output_name = "gt92xx-test"
configs += [ "//build/config:all_source" ]
sources = [
"gt92xx-firmware-test.cc",
"gt92xx-firmware.cc",
"gt92xx-test.cc",
"gt92xx.cc",
]
defines = [ "GT9293_ASTRO_FIRMWARE_PATH=\"$astro_firmware_path\"" ]
deps = [
":gt92xx_bind",
"//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp_mock",
"//sdk/banjo/fuchsia.hardware.hidbus:fuchsia.hardware.hidbus_banjo_cpp",
"//src/devices/i2c/lib/device-protocol-i2c",
"//src/devices/i2c/lib/device-protocol-i2c-channel",
"//src/devices/i2c/testing/fake-i2c",
"//src/devices/i2c/testing/mock-i2c",
"//src/devices/testing/mock-ddk",
"//src/lib/ddk",
"//src/lib/ddk:ddk-metadata-headers",
"//src/lib/ddktl",
"//src/ui/input/testing/mock-hidbus-ifc",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fzl",
"//zircon/system/ulib/hid",
"//zircon/system/ulib/inspect",
"//zircon/system/ulib/mock-function",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/trace:trace-driver",
"//zircon/system/ulib/zircon-internal",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxtest",
]
# TODO(https://fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
fuchsia_unittest_package("gt92xx-test-package") {
package_name = "gt92xx-test"
deps = [ ":gt92xx-test" ]
}
group("tests") {
testonly = true
deps = [
":gt92xx-test-package",
":gt92xx_bind_test",
]
}