blob: 85d4f5f8f8e3b38a3bbf2f0a9024fd3c0ef74222 [file] [log] [blame]
# 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/components.gni")
import("//build/drivers.gni")
import("//build/test.gni")
driver_bind_rules("aml-thermal-s905d2g-bind") {
rules = "aml-thermal.bind"
header_output = "aml-thermal-s905d2g-bind.h"
bind_output = "aml-thermal-s905d2g.bindbc"
tests = "bind-tests.json"
deps = [
"//src/devices/bind/fuchsia.amlogic.platform",
"//src/devices/bind/fuchsia.platform",
]
}
fuchsia_driver("aml-thermal-s905d2g-driver") {
output_name = "aml-thermal-s905d2g"
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
sources = [
"aml-thermal.cc",
"aml-tsensor.cc",
]
deps = [
":aml-thermal-s905d2g-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.i2c:fuchsia.hardware.i2c_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.pwm:fuchsia.hardware.pwm_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.thermal:fuchsia.hardware.thermal_banjo_cpp",
"//sdk/fidl/fuchsia.hardware.thermal:fuchsia.hardware.thermal_c",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/bus/lib/device-protocol-platform-device",
"//src/devices/lib/amlogic",
"//src/devices/lib/driver",
"//src/devices/lib/mmio",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fidl-utils",
"//zircon/system/ulib/hwreg",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zx",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
fuchsia_driver_component("aml-thermal-s905d2g") {
info = "aml-thermal-s905d2g-info.json"
component_name = "aml-thermal-s905d2g"
deps = [ ":aml-thermal-s905d2g-driver" ]
colocate = true
}
test("aml-thermal-s905d2g-test-bin") {
output_name = "aml-thermal-s905d2g-test"
configs += [ "//build/config:all_source" ]
sources = [
"aml-thermal-test.cc",
"aml-thermal.cc",
"aml-tsensor.cc",
]
deps = [
":aml-thermal-s905d2g-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.i2c:fuchsia.hardware.i2c_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.pwm:fuchsia.hardware.pwm_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.pwm:fuchsia.hardware.pwm_banjo_cpp_mock",
"//sdk/banjo/fuchsia.hardware.thermal:fuchsia.hardware.thermal_banjo_cpp",
"//sdk/fidl/fuchsia.hardware.thermal:fuchsia.hardware.thermal_c",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/bus/lib/device-protocol-platform-device",
"//src/devices/lib/amlogic",
"//src/devices/lib/mmio",
"//src/devices/testing/mock-mmio-reg",
"//src/devices/testing/no_ddk",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/fidl-utils",
"//zircon/system/ulib/hwreg",
"//zircon/system/ulib/mock-function",
"//zircon/system/ulib/sync",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxtest",
]
# TODO(fxbug.dev/95833): This target uses the deprecated C bindings.
# Consider switching to the C++ bindings. See linked bug for details.
configs += [ "//build/c:fidl-deprecated-c-bindings" ]
}
fuchsia_unittest_package("aml-thermal-s905d2g-test") {
deps = [ ":aml-thermal-s905d2g-test-bin" ]
test_specs = {
environments = basic_envs
}
}
group("tests") {
testonly = true
deps = [
":aml-thermal-s905d2g-bind_test",
":aml-thermal-s905d2g-test",
]
}