blob: e12ffc43501d49f1df950e58f8fefec31b41b4ba [file] [log] [blame]
# 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")
pramboot_path = "ft8201/FT8006_Pramboot_V1.6_20180426_le.bin"
firmware_path =
"ft8201/LQ_T800_FT8201_BOE_8.0inch_TP0x05_Lcd0x08_20190921_all.bin"
fuchsia_system_package("ft8201") {
deps = [ ":ft8201-module" ]
if (internal_access) {
deps += [
":firmware",
":pramboot",
]
}
allowed_in_extra_deps = true
}
if (internal_access) {
resource("firmware") {
sources = [ "//prebuilt/touch/$firmware_path" ]
outputs = [ "lib/firmware/$firmware_path" ]
}
resource("pramboot") {
sources = [ "//prebuilt/touch/$pramboot_path" ]
outputs = [ "lib/firmware/$pramboot_path" ]
}
}
bind_rules("ft8201-bind") {
rules = "ft8201.bind"
output = "ft8201-bind.h"
tests = "ft8201-bind-test.json"
deps = [
"//src/devices/bind/fuchsia.focaltech.platform",
"//src/devices/bind/fuchsia.platform",
]
}
source_set("common") {
public_deps = [
":ft8201-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",
"//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/hid",
]
}
driver_module("ft8201-module") {
output_name = "ft8201"
sources = [ "ft8201.cc" ]
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
deps = [ ":common" ]
defines = [
"FT8201_FIRMWARE_PATH=\"$firmware_path\"",
"FT8201_PRAMBOOT_PATH=\"$pramboot_path\"",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
# 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" ]
}
executable("ft8201-test-bin") {
testonly = true
output_name = "ft8201-test"
configs += [ "//build/config:all_source" ]
sources = [
"ft8201-firmware-test.cc",
"ft8201-test.cc",
"ft8201.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 = [
"FT8201_FIRMWARE_PATH=\"$firmware_path\"",
"FT8201_PRAMBOOT_PATH=\"$pramboot_path\"",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
# 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("ft8201-test") {
deps = [ ":ft8201-test-bin" ]
if (internal_access) {
deps += [
":test-firmware",
":test-pramboot",
]
}
}
if (internal_access) {
resource("test-firmware") {
sources = [ "//prebuilt/touch/$firmware_path" ]
outputs = [ "data/firmware/$firmware_path" ]
}
resource("test-pramboot") {
sources = [ "//prebuilt/touch/$pramboot_path" ]
outputs = [ "data/firmware/$pramboot_path" ]
}
}
group("tests") {
testonly = true
deps = [
":ft8201-bind_test",
":ft8201-test",
]
}