OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium OS 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 // Concrete class for DeveloperSwitch. This class represents the physical |
| 6 // developer mode switch on the Chrome OS device and maps its value to |
| 7 // kEnabled, kDisabled, and kUnsupported as per PlatformSwitch. |
| 8 // |
| 9 // The developer mode switch shares a file in /sys which is provided by |
| 10 // chromeos_acpi for the x86 plaform (ARM TBD). The file contains an integer |
| 11 // in ASCII format (-1, 0, 544, whatever) with one bit representing a |
| 12 // platform switch value. The developer switch is allocated the 6th |
| 13 // bit (0x20). The file in use (CHSW) indicates the boot-time position |
| 14 // of the switch and not a current measurement (available in GPIO.* files). |
| 15 #ifndef CROS_BOOT_MODE_DEVELOPER_SWITCH_H_ |
| 16 #define CROS_BOOT_MODE_DEVELOPER_SWITCH_H_ |
| 17 |
| 18 #include "platform_switch.h" |
| 19 |
| 20 namespace cros_boot_mode { |
| 21 |
| 22 class DeveloperSwitch : public PlatformSwitch { |
| 23 public: |
| 24 DeveloperSwitch(); |
| 25 virtual ~DeveloperSwitch(); |
| 26 virtual const char *name() const { |
| 27 return "developer"; |
| 28 } |
| 29 virtual unsigned int bitmask() const { |
| 30 return 0x00000020; // specified in the firmware spec. |
| 31 } |
| 32 }; |
| 33 |
| 34 } // namespace cros_boot_mode |
| 35 #endif // CROS_BOOT_MODE_DEVELOPER_SWITCH_H_ |
OLD | NEW |