| # Copyright 2021 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-pwm-regulator-bind") { |
| rules = "aml-pwm-regulator.bind" |
| header_output = "aml-pwm-regulator-bind.h" |
| tests = "bind-tests.json" |
| deps = [ "//src/devices/bind/fuchsia.platform" ] |
| } |
| |
| group("common") { |
| public_deps = [ |
| ":aml-pwm-regulator-bind", |
| "//sdk/banjo/fuchsia.hardware.pwm:fuchsia.hardware.pwm_banjo_cpp", |
| "//sdk/banjo/fuchsia.hardware.vreg:fuchsia.hardware.vreg_banjo_cpp", |
| "//sdk/fidl/fuchsia.hardware.vreg:fuchsia.hardware.vreg_llcpp", |
| "//src/devices/lib/amlogic", |
| "//src/lib/ddk", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| ] |
| } |
| |
| fuchsia_driver("aml-pwm-regulator-driver") { |
| output_name = "aml-pwm-regulator" |
| sources = [ "aml-pwm-regulator.cc" ] |
| deps = [ |
| ":common", |
| "//src/devices/lib/driver", |
| ] |
| } |
| |
| fuchsia_driver_component("aml-pwm-regulator") { |
| info = "aml-pwm-regulator-info.json" |
| component_name = "aml-pwm-regulator" |
| deps = [ ":aml-pwm-regulator-driver" ] |
| colocate = true |
| } |
| |
| test("aml-pwm-regulator-test-bin") { |
| output_name = "aml-pwm-regulator-test" |
| sources = [ |
| "aml-pwm-regulator-test.cc", |
| "aml-pwm-regulator.cc", |
| ] |
| deps = [ |
| ":common", |
| "//sdk/banjo/fuchsia.hardware.pwm:fuchsia.hardware.pwm_banjo_cpp_mock", |
| "//src/devices/lib/metadata:llcpp", |
| "//src/devices/testing/no_ddk", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(fxbug.dev/94768): This target uses mutable tables which are deprecated, |
| # rather than builders. |
| configs += [ "//build/cpp:fidl-wire-deprecated-mutable-tables" ] |
| } |
| |
| fuchsia_unittest_package("aml-pwm-regulator-test") { |
| deps = [ ":aml-pwm-regulator-test-bin" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":aml-pwm-regulator-bind_test", |
| ":aml-pwm-regulator-test", |
| ] |
| } |