blob: 36301b4519b331ea3c4dd3d4153420fb83d15214 [file] [log] [blame]
Jim Wright1553cd92021-03-31 16:11:59 -05001/**
2 * Copyright © 2021 IBM Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Jim Wright7945dd22021-04-06 16:55:15 -050017#include "ucd90320_monitor.hpp"
18
19#include <fmt/format.h>
20
21#include <string>
22
23namespace phosphor::power::sequencer
Jim Wright1553cd92021-03-31 16:11:59 -050024{
Jim Wright7945dd22021-04-06 16:55:15 -050025
26UCD90320Monitor::UCD90320Monitor(sdbusplus::bus::bus& bus, std::uint8_t i2cBus,
27 std::uint16_t i2cAddress) :
28 PowerSequencerMonitor(),
29 bus{bus}, interface {
30 fmt::format("/sys/bus/i2c/devices/{}-{:04x}", i2cBus, i2cAddress).c_str(),
31 "ucd9000", 0
Jim Wright1553cd92021-03-31 16:11:59 -050032}
Jim Wright7945dd22021-04-06 16:55:15 -050033{}
34
35} // namespace phosphor::power::sequencer