blob: cadcbf64d1dd6d6da44059feb6e831e871111857 [file] [log] [blame]
Shawn McCarneyfec38332024-05-02 13:58:56 -05001/**
2 * Copyright © 2024 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#pragma once
17
18#include "rail.hpp"
19#include "services.hpp"
20#include "ucd90x_device.hpp"
21
22#include <cstdint>
23#include <map>
24#include <memory>
25#include <string>
26#include <utility>
27#include <vector>
28
29namespace phosphor::power::sequencer
30{
31
32/**
33 * @class UCD90320Device
34 *
35 * Class representing the UCD90320 power sequencer device.
36 */
37class UCD90320Device : public UCD90xDevice
38{
39 public:
40 // Specify which compiler-generated methods we want
41 UCD90320Device() = delete;
42 UCD90320Device(const UCD90320Device&) = delete;
43 UCD90320Device(UCD90320Device&&) = delete;
44 UCD90320Device& operator=(const UCD90320Device&) = delete;
45 UCD90320Device& operator=(UCD90320Device&&) = delete;
46 virtual ~UCD90320Device() = default;
47
48 /**
49 * Constructor.
50 *
Shawn McCarneyfec38332024-05-02 13:58:56 -050051 * @param bus I2C bus for the device
52 * @param address I2C address for the device
Shawn McCarney31234452025-10-28 12:32:05 -050053 * @param rails Voltage rails that are enabled and monitored by this device
54 * @param services System services like hardware presence and the journal
Shawn McCarneyfec38332024-05-02 13:58:56 -050055 */
Shawn McCarney31234452025-10-28 12:32:05 -050056 explicit UCD90320Device(uint8_t bus, uint16_t address,
57 std::vector<std::unique_ptr<Rail>> rails,
58 Services& services) :
59 UCD90xDevice(deviceName, bus, address, std::move(rails), services)
Shawn McCarneyfec38332024-05-02 13:58:56 -050060 {}
61
62 constexpr static std::string deviceName{"UCD90320"};
63
64 protected:
65 /** @copydoc UCD90xDevice::storeGPIOValues() */
66 virtual void storeGPIOValues(
67 Services& services, const std::vector<int>& values,
68 std::map<std::string, std::string>& additionalData) override;
69};
70
71} // namespace phosphor::power::sequencer