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 #pragma once 6 7 #define BIT(x) (1UL << (x)) 8 #define NSEC_PER_SEC 1000000000 9 10 // Register offset 11 #define S905D2_AO_PWM_PWM_A (0x0 * 4) 12 #define S905D2_AO_PWM_PWM_B (0x1 * 4) 13 #define S905D2_AO_PWM_MISC_REG_AB (0x2 * 4) 14 #define S905D2_AO_DS_A_B (0x3 * 4) 15 #define S905D2_AO_PWM_TIME_AB (0x4 * 4) 16 #define S905D2_AO_PWM_A2 (0x5 * 4) 17 #define S905D2_AO_PWM_B2 (0x6 * 4) 18 #define S905D2_AO_PWM_BLINK_AB (0x7 * 4) 19 20 #define CLK_A_ENABLE BIT(15) 21 #define CLK_B_ENABLE BIT(23) 22 #define A_ENABLE BIT(0) 23 #define B_ENABLE BIT(1) 24 25 #define PWM_HIGH_SHIFT 16 26