1// Copyright 2018 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include <ddk/debug.h>
6#include <ddk/device.h>
7#include <ddk/protocol/platform-bus.h>
8#include <ddk/protocol/platform-defs.h>
9#include <soc/aml-s912/s912-hw.h>
10
11#include "vim.h"
12
13static const pbus_i2c_channel_t led2472g_channels[] = {
14    {
15        .bus_id = 0,
16        .address = 0x46,
17    },
18};
19
20static const pbus_dev_t led2472g_dev = {
21    .name = "led2472g",
22    .vid = PDEV_VID_GENERIC,
23    .pid = PDEV_PID_GENERIC,
24    .did = PDEV_DID_LED2472G,
25    .i2c_channels = led2472g_channels,
26    .i2c_channel_count = countof(led2472g_channels),
27};
28
29zx_status_t vim_led2472g_init(vim_bus_t* bus) {
30    zx_status_t status;
31    if ((status = pbus_device_add(&bus->pbus, &led2472g_dev)) != ZX_OK) {
32        zxlogf(ERROR, "vim_led2472g_init: pbus_device_add() failed for led2472g: %d\n", status);
33        return status;
34    }
35
36    return ZX_OK;
37}
38