| # 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_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") { |
| export_to_bazel = true |
| driver_components = [ ":gt6853-module" ] |
| |
| deps = [] |
| if (internal_access) { |
| deps += [ |
| ":config-9364", |
| ":config-9365", |
| ":firmware", |
| ] |
| } |
| } |
| |
| 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/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio_cpp", |
| "//sdk/fidl/fuchsia.input.report:fuchsia.input.report_cpp", |
| "//sdk/fidl/fuchsia.mem:fuchsia.mem_cpp", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//sdk/lib/input_report_reader", |
| "//src/devices/i2c/lib/i2c-channel-legacy", |
| "//src/devices/lib/driver", |
| "//src/devices/lib/driver:driver_runtime", |
| "//src/graphics/display/lib/device-protocol-display", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//src/ui/input/lib/hid", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/fzl", |
| "//zircon/system/ulib/inspect", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zircon-internal", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| driver_bind_rules("gt6853-bind") { |
| rules = "meta/gt6853.bind" |
| tests = "meta/gt6853-bind-test.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio_bindlib", |
| "//sdk/fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_bindlib", |
| "//src/devices/bind/fuchsia.amlogic.platform.s905d3", |
| "//src/devices/bind/fuchsia.goodix.platform", |
| "//src/devices/bind/fuchsia.gpio", |
| "//src/devices/bind/fuchsia.platform", |
| ] |
| } |
| |
| fuchsia_cc_driver("gt6853-module-driver") { |
| legacy = true |
| 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_9364_PATH=\"$config_9364_path\"", |
| "GT6853_CONFIG_9365_PATH=\"$config_9365_path\"", |
| "GT6853_FIRMWARE_PATH=\"$firmware_path\"", |
| ] |
| } |
| |
| fuchsia_driver_component("gt6853-module") { |
| info = "meta/gt6853-module-info.json" |
| component_name = "gt6853" |
| deps = [ ":gt6853-module-driver" ] |
| manifest = "meta/gt6853.cml" |
| } |
| |
| test("gt6853-test") { |
| output_name = "gt6853-test" |
| configs += [ "//build/config:all_source" ] |
| sources = [ |
| "gt6853-nelson.cc", |
| "gt6853-test.cc", |
| "gt6853.cc", |
| ] |
| deps = [ |
| ":common", |
| "//sdk/fidl/fuchsia.hardware.gpio:fuchsia.hardware.gpio_cpp", |
| "//sdk/lib/async_patterns/testing/cpp", |
| "//sdk/lib/component/outgoing/cpp", |
| "//sdk/lib/inspect/testing/cpp:zxtest", |
| "//src/devices/gpio/testing/fake-gpio", |
| "//src/devices/i2c/testing/fake-i2c", |
| "//src/devices/testing/mock-ddk", |
| "//zircon/system/ulib/mock-function", |
| "//zircon/system/ulib/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" |
| deps = [ ":gt6853-test" ] |
| test_specs = { |
| log_settings = { |
| max_severity = "ERROR" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":gt6853-bind_test", |
| ":gt6853-test-package", |
| ] |
| } |