| # 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/test.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" |
| |
| fuchsia_system_package("gt6853") { |
| deps = [ ":gt6853-module" ] |
| |
| if (internal_access) { |
| deps += [ |
| ":config-9364", |
| ":config-9365", |
| ":firmware", |
| ] |
| } |
| allowed_in_extra_deps = true |
| } |
| |
| if (internal_access) { |
| 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", |
| "//sdk/banjo/fuchsia.hardware.i2c", |
| "//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp", |
| "//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/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\"", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| test("gt6853-test") { |
| output_name = "gt6853-test" |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "gt6853-test.cc", |
| "gt6853.cc", |
| ] |
| deps = [ |
| ":common", |
| "//sdk/banjo/fuchsia.hardware.gpio:fuchsia.hardware.gpio_banjo_cpp_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\"", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| fuchsia_unittest_package("gt6853-test-package") { |
| package_name = "gt6853-test" |
| deps = [ ":gt6853-test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":gt6853-bind_test", |
| ":gt6853-test-package", |
| ] |
| } |