apple-properties.c (ead5d1f4d877e92c051e1a1ade623d0d30e71619) apple-properties.c (355845b738e76445c8522802552146d96cb4afa7)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * apple-properties.c - EFI device properties on Macs
4 * Copyright (C) 2016 Lukas Wunner <lukas@wunner.de>
5 *
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * apple-properties.c - EFI device properties on Macs
4 * Copyright (C) 2016 Lukas Wunner <lukas@wunner.de>
5 *
6 * Note, all properties are considered as u8 arrays.
7 * To get a value of any of them the caller must use device_property_read_u8_array().
6 * Properties are stored either as:
7 * u8 arrays which can be retrieved with device_property_read_u8_array() or
8 * booleans which can be queried with device_property_present().
8 */
9
10#define pr_fmt(fmt) "apple-properties: " fmt
11
12#include <linux/memblock.h>
13#include <linux/efi.h>
14#include <linux/io.h>
15#include <linux/platform_data/x86/apple.h>

--- 67 unchanged lines hidden (view full) ---

83 dev_err(dev, "cannot allocate property name\n");
84 break;
85 }
86 ucs2_as_utf8(key, ptr + sizeof(key_len),
87 key_len - sizeof(key_len));
88
89 entry_data = ptr + key_len + sizeof(val_len);
90 entry_len = val_len - sizeof(val_len);
9 */
10
11#define pr_fmt(fmt) "apple-properties: " fmt
12
13#include <linux/memblock.h>
14#include <linux/efi.h>
15#include <linux/io.h>
16#include <linux/platform_data/x86/apple.h>

--- 67 unchanged lines hidden (view full) ---

84 dev_err(dev, "cannot allocate property name\n");
85 break;
86 }
87 ucs2_as_utf8(key, ptr + sizeof(key_len),
88 key_len - sizeof(key_len));
89
90 entry_data = ptr + key_len + sizeof(val_len);
91 entry_len = val_len - sizeof(val_len);
91 entry[i] = PROPERTY_ENTRY_U8_ARRAY_LEN(key, entry_data,
92 entry_len);
92 if (entry_len)
93 entry[i] = PROPERTY_ENTRY_U8_ARRAY_LEN(key, entry_data,
94 entry_len);
95 else
96 entry[i] = PROPERTY_ENTRY_BOOL(key);
97
93 if (dump_properties) {
94 dev_info(dev, "property: %s\n", key);
95 print_hex_dump(KERN_INFO, pr_fmt(), DUMP_PREFIX_OFFSET,
96 16, 1, entry_data, entry_len, true);
97 }
98
99 ptr += key_len + val_len;
100 }

--- 132 unchanged lines hidden ---
98 if (dump_properties) {
99 dev_info(dev, "property: %s\n", key);
100 print_hex_dump(KERN_INFO, pr_fmt(), DUMP_PREFIX_OFFSET,
101 16, 1, entry_data, entry_len, true);
102 }
103
104 ptr += key_len + val_len;
105 }

--- 132 unchanged lines hidden ---