| # 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-pwm-bind") { |
| rules = "aml-pwm.bind" |
| bind_output = "aml-pwm.bindbc" |
| tests = "bind-tests.json" |
| deps = [ |
| "//src/devices/bind/fuchsia.amlogic.platform", |
| "//src/devices/bind/fuchsia.devicetree", |
| "//src/devices/bind/fuchsia.platform", |
| ] |
| } |
| |
| fuchsia_driver("aml-pwm-driver") { |
| output_name = "aml-pwm" |
| configs += [ |
| "//build/config:all_source", |
| "//build/config/fuchsia:enable_zircon_asserts", |
| ] |
| sources = [ "aml-pwm.cc" ] |
| deps = [ |
| ":common", |
| "//src/devices/lib/driver", |
| ] |
| |
| # TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| fuchsia_driver_component("aml-pwm") { |
| info = "aml-pwm-info.json" |
| component_name = "aml-pwm" |
| deps = [ ":aml-pwm-driver" ] |
| manifest = "meta/aml-pwm.cml" |
| } |
| |
| fuchsia_driver_package("package") { |
| package_name = "aml-pwm" |
| driver_components = [ ":aml-pwm" ] |
| } |
| |
| test("aml-pwm-test-bin") { |
| output_name = "aml-pwm-test" |
| sources = [ |
| "aml-pwm-test.cc", |
| "aml-pwm.cc", |
| ] |
| deps = [ |
| ":common", |
| "//src/devices/testing/mock-mmio-reg:mock-mmio-reg-zxtest", |
| "//src/devices/testing/no_ddk", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| |
| # TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |
| |
| group("common") { |
| public_deps = [ |
| ":aml-pwm-bind", |
| "//sdk/banjo/fuchsia.hardware.pwm:fuchsia.hardware.pwm_banjo_cpp", |
| "//src/devices/bus/lib/device-protocol-pdev", |
| "//src/devices/lib/amlogic", |
| "//src/devices/lib/mmio", |
| "//src/lib/ddk", |
| "//src/lib/ddk:ddk-metadata-headers", |
| "//src/lib/ddktl", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/hwreg", |
| "//zircon/system/ulib/zircon-internal", |
| ] |
| } |
| |
| fuchsia_unittest_package("aml-pwm-test") { |
| deps = [ ":aml-pwm-test-bin" ] |
| test_specs = { |
| environments = basic_envs |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":aml-pwm-bind_test", |
| ":aml-pwm-test", |
| ] |
| } |