| # 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/config/fuchsia/rules.gni") |
| import("//build/test.gni") |
| import("//src/sys/build/components.gni") |
| |
| bind_rules("gt92xx_bind") { |
| rules = "gt92xx.bind" |
| output = "gt92xx_bind.h" |
| tests = "bind_tests.json" |
| deps = [ "//src/devices/bind/fuchsia.google.platform" ] |
| } |
| |
| astro_firmware_path = |
| "gt9293-astro/GT9293_6105(6E43)_Official_Release_20180917.bin" |
| |
| driver_module("goodix-module") { |
| output_name = "goodix" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "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", |
| "//sdk/banjo/fuchsia.hardware.i2c", |
| "//sdk/banjo/fuchsia.hardware.platform.device", |
| "//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/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/hid", |
| "//zircon/system/ulib/hid", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/trace:trace-driver", |
| ] |
| } |
| |
| if (internal_access) { |
| resource("astro-firmware") { |
| sources = [ "//prebuilt/touch/$astro_firmware_path" ] |
| outputs = [ "lib/firmware/$astro_firmware_path" ] |
| } |
| } |
| |
| fuchsia_system_package("goodix") { |
| deps = [ ":goodix-module" ] |
| |
| if (internal_access) { |
| deps += [ ":astro-firmware" ] |
| } |
| allowed_in_extra_deps = true |
| } |
| |
| group("test") { |
| testonly = true |
| deps = [ ":gt92xx-test" ] |
| } |
| |
| test("gt92xx-test") { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| output_name = "gt92xx-test" |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "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", |
| "//src/devices/i2c/lib/device-protocol-i2c", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/i2c/testing/mock-i2c", |
| "//src/devices/testing/fake_ddk", |
| "//src/lib/ddk", |
| "//src/lib/ddk:ddk-metadata-headers", |
| "//src/lib/ddktl", |
| "//src/ui/input/testing/mock-hidbus-ifc", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/mock-function", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/hid", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/trace:trace-driver", |
| ] |
| } |
| |
| fuchsia_unittest_package("gt92xx-test-package") { |
| package_name = "gt92xx-test" |
| deps = [ ":gt92xx-test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":gt92xx-test-package", |
| ":gt92xx_bind_test", |
| ] |
| } |