| # 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("//build/test/test_package.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.composite", |
| "//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/ddk.protocol.composite", |
| "//sdk/banjo/ddk.protocol.platform.device", |
| "//sdk/banjo/ddk.protocol.powerimpl", |
| "//sdk/banjo/ddk.protocol.pwm", |
| "//sdk/banjo/ddk.protocol.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") { |
| 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/ddk.protocol.clock", |
| "//sdk/banjo/ddk.protocol.composite", |
| "//sdk/banjo/ddk.protocol.gpio", |
| "//sdk/banjo/ddk.protocol.i2c", |
| "//sdk/banjo/ddk.protocol.platform.device", |
| "//sdk/banjo/ddk.protocol.powerimpl", |
| "//sdk/banjo/ddk.protocol.pwm", |
| "//sdk/banjo/ddk.protocol.pwm:ddk.protocol.pwm_mock", |
| "//sdk/banjo/ddk.protocol.thermal", |
| "//sdk/banjo/ddk.protocol.vreg", |
| "//sdk/banjo/ddk.protocol.vreg:ddk.protocol.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", |
| ] |
| } |
| |
| unittest_package("aml-meson-power-test-package") { |
| package_name = "aml-meson-power-test" |
| deps = [ ":aml-meson-power-test" ] |
| |
| tests = [ |
| { |
| name = "aml-meson-power-test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":aml-meson-power-bind_test", |
| ":aml-meson-power-test-package", |
| ] |
| } |