| # 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("ti-tca6408a-bind") { |
| rules = "ti-tca6408a.bind" |
| tests = "ti-tca6408a-bind-test.json" |
| deps = [ |
| "//sdk/fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_bindlib", |
| "//src/devices/bind/fuchsia.devicetree", |
| "//src/devices/bind/fuchsia.platform", |
| "//src/devices/bind/fuchsia.ti.platform", |
| ] |
| } |
| |
| source_set("common") { |
| public_deps = [ |
| ":ti-tca6408a-bind", |
| "//sdk/fidl/fuchsia.driver.compat:fuchsia.driver.compat_cpp", |
| "//sdk/fidl/fuchsia.hardware.gpioimpl:fuchsia.hardware.gpioimpl_cpp", |
| "//sdk/lib/driver/compat/cpp", |
| "//sdk/lib/driver/component/cpp:cpp", |
| "//src/devices/i2c/lib/device-protocol-i2c-channel", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_driver("ti-tca6408a-driver") { |
| output_name = "ti-tca6408a" |
| sources = [ "ti-tca6408a.cc" ] |
| deps = [ |
| ":common", |
| "//src/devices/lib/driver:driver_runtime", |
| ] |
| } |
| |
| fuchsia_driver_component("ti-tca6408a") { |
| info = "ti-tca6408a-info.json" |
| deps = [ ":ti-tca6408a-driver" ] |
| manifest = "meta/ti-tca6408a.cml" |
| } |
| |
| fuchsia_driver_package("package") { |
| package_name = "ti-tca6408a" |
| driver_components = [ ":ti-tca6408a" ] |
| } |
| |
| test("ti-tca6408a-test-bin") { |
| output_name = "ti-tca6408a-test" |
| sources = [ |
| "ti-tca6408a-test.cc", |
| "ti-tca6408a.cc", |
| ] |
| deps = [ |
| ":common", |
| "//sdk/lib/async_patterns/testing/cpp", |
| "//sdk/lib/driver/compat/cpp", |
| "//sdk/lib/driver/testing/cpp:cpp", |
| "//src/devices/i2c/testing/fake-i2c", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| fuchsia_unittest_package("ti-tca6408a-test") { |
| deps = [ ":ti-tca6408a-test-bin" ] |
| test_specs = { |
| environments = basic_envs |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":ti-tca6408a-bind_test", |
| ":ti-tca6408a-test", |
| ] |
| } |