blob: 6515b137838f8c3e0adae221ae5d855087145255 [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/config/fuchsia/rules.gni")
import("//build/test.gni")
import("//src/sys/build/components.gni")
bind_rules("aml-meson-power-bind") {
rules = "aml-power.bind"
output = "aml-meson-power-bind.h"
tests = "bind-tests.json"
deps = [
"//src/devices/bind/amlogic.platform",
"//src/devices/bind/fuchsia.google.platform",
]
}
driver_module("aml-meson-power") {
defines = [ "_ALL_SOURCE" ]
configs += [ "//build/config/fuchsia:enable_zircon_asserts" ]
configs += [ "//build/unification/config:zircon-migrated" ]
sources = [
"aml-power.cc",
"aml-power.h",
]
deps = [
":aml-meson-power-bind",
"//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.powerimpl",
"//sdk/banjo/fuchsia.hardware.pwm",
"//sdk/banjo/fuchsia.hardware.vreg",
"//src/devices/bus/lib/device-protocol-pdev",
"//src/devices/lib/amlogic",
"//src/devices/lib/driver",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/public/lib/fbl",
"//zircon/public/lib/fidl",
"//zircon/public/lib/hwreg",
"//zircon/public/lib/sync",
"//zircon/public/lib/zx",
]
}
test("aml-meson-power-test-bin") {
configs += [ "//build/unification/config:zircon-migrated" ]
output_name = "aml-meson-power-test"
sources = [
"aml-power-test.cc",
"aml-power.cc",
"aml-power.h",
]
deps = [
":aml-meson-power-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",
"//sdk/banjo/fuchsia.hardware.platform.device:fuchsia.hardware.platform.device_banjo_cpp",
"//sdk/banjo/fuchsia.hardware.powerimpl",
"//sdk/banjo/fuchsia.hardware.pwm",
"//sdk/banjo/fuchsia.hardware.pwm:fuchsia.hardware.pwm_mock",
"//sdk/banjo/fuchsia.hardware.thermal",
"//sdk/banjo/fuchsia.hardware.vreg",
"//sdk/banjo/fuchsia.hardware.vreg:fuchsia.hardware.vreg_mock",
"//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/public/lib/fbl",
"//zircon/public/lib/hwreg",
"//zircon/public/lib/mock-function",
"//zircon/public/lib/sync",
"//zircon/public/lib/zx",
"//zircon/public/lib/zxtest",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fidl-utils",
]
}
fuchsia_unittest_package("aml-meson-power-test") {
deps = [ ":aml-meson-power-test-bin" ]
test_specs = {
environments = basic_envs
}
}
group("tests") {
testonly = true
deps = [
":aml-meson-power-bind_test",
":aml-meson-power-test",
]
}