2 * This file is part of the coreboot project.
4 * Copyright (C) 2016 Nicola Corna <nicola@corna.info>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #include <ec/acpi/ec.h>
17 #include <pc80/mc146818rtc.h>
27 void h8_usb_always_on(void)
29 enum usb_always_on val
;
32 if (get_option(&val
, "usb_always_on") != CB_SUCCESS
)
35 if (val
== UAO_AC_AND_BATTERY
) {
36 reg
= ec_read(H8_USB_ALWAYS_ON
);
37 reg
&= ~H8_USB_ALWAYS_ON_AC_ONLY
;
38 reg
|= H8_USB_ALWAYS_ON_ENABLE
;
39 ec_write(H8_USB_ALWAYS_ON
, reg
);
40 } else if (val
== UAO_AC_ONLY
) {
41 reg
= ec_read(H8_USB_ALWAYS_ON
);
42 reg
|= H8_USB_ALWAYS_ON_AC_ONLY
;
43 reg
|= H8_USB_ALWAYS_ON_ENABLE
;
44 ec_write(H8_USB_ALWAYS_ON
, reg
);