| # 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/config/fuchsia/rules.gni") |
| import("//build/driver_package.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.gni") |
| import("//src/sys/build/components.gni") |
| |
| config_9364_path = "gt6853/goodix_cfg_group_fiti9364.bin" |
| config_9365_path = "gt6853/goodix_cfg_group_fiti9365.bin" |
| firmware_path = "gt6853/goodix_firmware.bin" |
| |
| driver_package("gt6853") { |
| deps = [ ":gt6853-module" ] |
| |
| drivers = [ |
| { |
| name = "gt6853.so" |
| }, |
| ] |
| |
| libraries = [] |
| |
| if (internal_access) { |
| deps += [ |
| ":config-9364-copy($shlib_toolchain)", |
| ":config-9365-copy($shlib_toolchain)", |
| ":firmware-copy($shlib_toolchain)", |
| ] |
| |
| libraries += [ |
| { |
| name = "firmware/$config_9364_path" |
| }, |
| { |
| name = "firmware/$config_9365_path" |
| }, |
| { |
| name = "firmware/$firmware_path" |
| }, |
| ] |
| } |
| } |
| |
| if (internal_access) { |
| copy("config-9364-copy") { |
| sources = [ "//prebuilt/touch/$config_9364_path" ] |
| outputs = [ "$root_out_dir/firmware/$config_9364_path" ] |
| } |
| copy("config-9365-copy") { |
| sources = [ "//prebuilt/touch/$config_9365_path" ] |
| outputs = [ "$root_out_dir/firmware/$config_9365_path" ] |
| } |
| copy("firmware-copy") { |
| sources = [ "//prebuilt/touch/$firmware_path" ] |
| outputs = [ "$root_out_dir/firmware/$firmware_path" ] |
| } |
| } |
| |
| group("common") { |
| public_deps = [ |
| ":gt6853-bind", |
| "//sdk/banjo/ddk.protocol.composite", |
| "//sdk/banjo/ddk.protocol.gpio", |
| "//sdk/banjo/ddk.protocol.hidbus", |
| "//sdk/banjo/ddk.protocol.i2c", |
| "//sdk/banjo/ddk.protocol.platform.device", |
| "//sdk/fidl/fuchsia.input.report:fuchsia.input.report_llcpp", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//src/devices/lib/driver", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//src/ui/input/lib/input-report-reader", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zircon-internal", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxc", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/hid", |
| ] |
| } |
| |
| bind_rules("gt6853-bind") { |
| rules = "gt6853.bind" |
| output = "gt6853-bind.h" |
| tests = "gt6853-bind-test.json" |
| deps = [ |
| "//src/devices/bind/fuchsia.composite", |
| "//src/devices/bind/goodix.platform", |
| ] |
| } |
| |
| driver_module("gt6853-module") { |
| output_name = "gt6853" |
| sources = [ "gt6853.cc" ] |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| deps = [ ":common" ] |
| defines = [ |
| "GT6853_CONFIG_9364_PATH=\"$config_9364_path\"", |
| "GT6853_CONFIG_9365_PATH=\"$config_9365_path\"", |
| "GT6853_FIRMWARE_PATH=\"$firmware_path\"", |
| ] |
| } |
| |
| test("gt6853-test") { |
| output_name = "gt6853-test" |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "gt6853-test.cc", |
| "gt6853.cc", |
| ] |
| deps = [ |
| ":common", |
| "//sdk/banjo/ddk.protocol.gpio:ddk.protocol.gpio_mock", |
| "//src/devices/i2c/testing/fake-i2c", |
| "//src/devices/testing/fake_ddk", |
| "//zircon/public/lib/mock-function", |
| "//zircon/public/lib/zxtest", |
| ] |
| defines = [ |
| "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" |
| executable_path = "test/gt6853-test" |
| deps = [ ":gt6853-test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":gt6853-bind_test", |
| ":gt6853-test-package", |
| ] |
| } |