1 1.22 thorpej /* $NetBSD: acpi_i2c.c,v 1.22 2025/09/18 02:51:04 thorpej Exp $ */ 2 1.1 bouyer 3 1.1 bouyer /*- 4 1.11 thorpej * Copyright (c) 2017, 2021 The NetBSD Foundation, Inc. 5 1.1 bouyer * All rights reserved. 6 1.1 bouyer * 7 1.1 bouyer * This code is derived from software contributed to The NetBSD Foundation 8 1.1 bouyer * by Manuel Bouyer. 9 1.1 bouyer * 10 1.1 bouyer * Redistribution and use in source and binary forms, with or without 11 1.1 bouyer * modification, are permitted provided that the following conditions 12 1.1 bouyer * are met: 13 1.1 bouyer * 1. Redistributions of source code must retain the above copyright 14 1.1 bouyer * notice, this list of conditions and the following disclaimer. 15 1.1 bouyer * 2. Redistributions in binary form must reproduce the above copyright 16 1.1 bouyer * notice, this list of conditions and the following disclaimer in the 17 1.1 bouyer * documentation and/or other materials provided with the distribution. 18 1.1 bouyer * 19 1.1 bouyer * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 1.1 bouyer * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 1.1 bouyer * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 1.1 bouyer * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 1.1 bouyer * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 1.1 bouyer * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 1.1 bouyer * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 1.1 bouyer * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 1.1 bouyer * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 1.1 bouyer * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 1.1 bouyer * POSSIBILITY OF SUCH DAMAGE. 30 1.1 bouyer */ 31 1.1 bouyer 32 1.16 jmcneill #include "iic.h" 33 1.16 jmcneill 34 1.1 bouyer #include <sys/cdefs.h> 35 1.22 thorpej __KERNEL_RCSID(0, "$NetBSD: acpi_i2c.c,v 1.22 2025/09/18 02:51:04 thorpej Exp $"); 36 1.13 jmcneill 37 1.13 jmcneill #include <sys/device.h> 38 1.1 bouyer 39 1.1 bouyer #include <dev/acpi/acpireg.h> 40 1.1 bouyer #include <dev/acpi/acpivar.h> 41 1.1 bouyer #include <dev/acpi/acpi_i2c.h> 42 1.14 jmcneill #include <external/bsd/acpica/dist/include/acinterp.h> 43 1.17 jmcneill #include <external/bsd/acpica/dist/include/amlcode.h> 44 1.9 jmcneill #include <dev/i2c/i2cvar.h> 45 1.1 bouyer 46 1.11 thorpej #include <sys/kmem.h> 47 1.11 thorpej 48 1.2 bouyer #define _COMPONENT ACPI_BUS_COMPONENT 49 1.2 bouyer ACPI_MODULE_NAME ("acpi_i2c") 50 1.2 bouyer 51 1.14 jmcneill struct acpi_i2c_address_space_context { 52 1.14 jmcneill ACPI_CONNECTION_INFO conn_info; /* must be first */ 53 1.14 jmcneill i2c_tag_t tag; 54 1.14 jmcneill }; 55 1.14 jmcneill 56 1.13 jmcneill static const struct device_compatible_entry hid_compat_data[] = { 57 1.13 jmcneill { .compat = "PNP0C50" }, 58 1.13 jmcneill DEVICE_COMPAT_EOL 59 1.13 jmcneill }; 60 1.13 jmcneill 61 1.16 jmcneill #if NIIC > 0 62 1.1 bouyer struct acpi_i2c_context { 63 1.1 bouyer uint16_t i2c_addr; 64 1.13 jmcneill struct acpi_devnode *res_src; 65 1.1 bouyer }; 66 1.16 jmcneill #endif 67 1.1 bouyer 68 1.13 jmcneill static struct acpi_devnode * 69 1.13 jmcneill acpi_i2c_resource_find_source(ACPI_RESOURCE_SOURCE *rs) 70 1.13 jmcneill { 71 1.13 jmcneill ACPI_STATUS rv; 72 1.13 jmcneill ACPI_HANDLE hdl; 73 1.13 jmcneill struct acpi_devnode *ad; 74 1.13 jmcneill 75 1.13 jmcneill if (rs->StringPtr == NULL) { 76 1.13 jmcneill return NULL; 77 1.13 jmcneill } 78 1.13 jmcneill 79 1.13 jmcneill rv = AcpiGetHandle(NULL, rs->StringPtr, &hdl); 80 1.13 jmcneill if (ACPI_FAILURE(rv)) { 81 1.13 jmcneill printf("%s: couldn't lookup '%s': %s\n", __func__, 82 1.13 jmcneill rs->StringPtr, AcpiFormatException(rv)); 83 1.13 jmcneill return NULL; 84 1.13 jmcneill } 85 1.13 jmcneill 86 1.13 jmcneill SIMPLEQ_FOREACH(ad, &acpi_softc->sc_head, ad_list) { 87 1.13 jmcneill if (ad->ad_handle == hdl) { 88 1.13 jmcneill return ad; 89 1.13 jmcneill } 90 1.13 jmcneill } 91 1.13 jmcneill 92 1.13 jmcneill printf("%s: no acpi devnode matching resource source '%s'\n", 93 1.13 jmcneill __func__, rs->StringPtr); 94 1.13 jmcneill return NULL; 95 1.13 jmcneill } 96 1.13 jmcneill 97 1.1 bouyer static ACPI_STATUS 98 1.1 bouyer acpi_i2c_resource_parse_callback(ACPI_RESOURCE *res, void *context) 99 1.1 bouyer { 100 1.1 bouyer struct acpi_i2c_context *i2cc = context; 101 1.1 bouyer 102 1.1 bouyer switch (res->Type) { 103 1.1 bouyer case ACPI_RESOURCE_TYPE_END_TAG: 104 1.1 bouyer break; 105 1.1 bouyer case ACPI_RESOURCE_TYPE_SERIAL_BUS: 106 1.1 bouyer switch (res->Data.I2cSerialBus.Type) { 107 1.1 bouyer case ACPI_RESOURCE_SERIAL_TYPE_I2C: 108 1.1 bouyer i2cc->i2c_addr = res->Data.I2cSerialBus.SlaveAddress; 109 1.13 jmcneill i2cc->res_src = acpi_i2c_resource_find_source( 110 1.13 jmcneill &res->Data.I2cSerialBus.ResourceSource); 111 1.1 bouyer break; 112 1.1 bouyer } 113 1.1 bouyer break; 114 1.1 bouyer case ACPI_RESOURCE_TYPE_EXTENDED_IRQ: 115 1.1 bouyer break; 116 1.1 bouyer default: 117 1.15 jmcneill break; 118 1.1 bouyer } 119 1.1 bouyer return_ACPI_STATUS(AE_OK); 120 1.1 bouyer } 121 1.1 bouyer 122 1.1 bouyer static void 123 1.1 bouyer acpi_enter_i2c_device(struct acpi_devnode *ad, prop_array_t array) 124 1.1 bouyer { 125 1.1 bouyer prop_dictionary_t dev; 126 1.1 bouyer struct acpi_i2c_context i2cc; 127 1.1 bouyer ACPI_STATUS rv; 128 1.11 thorpej char *clist; 129 1.11 thorpej size_t clist_size; 130 1.22 thorpej devhandle_t child_devhandle; 131 1.1 bouyer 132 1.1 bouyer memset(&i2cc, 0, sizeof(i2cc)); 133 1.1 bouyer rv = AcpiWalkResources(ad->ad_handle, "_CRS", 134 1.1 bouyer acpi_i2c_resource_parse_callback, &i2cc); 135 1.1 bouyer if (ACPI_FAILURE(rv)) { 136 1.1 bouyer return; 137 1.1 bouyer } 138 1.1 bouyer if (i2cc.i2c_addr == 0) 139 1.1 bouyer return; 140 1.1 bouyer dev = prop_dictionary_create(); 141 1.1 bouyer if (dev == NULL) { 142 1.1 bouyer aprint_error("ignoring device %s (no memory)\n", 143 1.1 bouyer ad->ad_name); 144 1.1 bouyer return; 145 1.1 bouyer } 146 1.12 thorpej clist = acpi_pack_compat_list(ad, &clist_size); 147 1.11 thorpej if (clist == NULL) { 148 1.11 thorpej prop_object_release(dev); 149 1.11 thorpej aprint_error("ignoring device %s (no _HID or _CID)\n", 150 1.11 thorpej ad->ad_name); 151 1.11 thorpej return; 152 1.11 thorpej } 153 1.12 thorpej prop_dictionary_set_string(dev, "name", ad->ad_name); 154 1.1 bouyer prop_dictionary_set_uint32(dev, "addr", i2cc.i2c_addr); 155 1.22 thorpej child_devhandle = devhandle_from_acpi(devhandle_invalid(), 156 1.22 thorpej ad->ad_handle); 157 1.22 thorpej prop_dictionary_set_data(dev, "devhandle", &child_devhandle, 158 1.22 thorpej sizeof(child_devhandle)); 159 1.11 thorpej prop_dictionary_set_data(dev, "compatible", clist, clist_size); 160 1.11 thorpej kmem_free(clist, clist_size); 161 1.11 thorpej 162 1.1 bouyer prop_array_add(array, dev); 163 1.1 bouyer prop_object_release(dev); 164 1.1 bouyer } 165 1.1 bouyer 166 1.13 jmcneill static void 167 1.13 jmcneill acpi_enter_i2chid_devs(device_t dev, struct acpi_devnode *devnode, 168 1.13 jmcneill prop_array_t array) 169 1.13 jmcneill { 170 1.13 jmcneill struct acpi_devnode *ad; 171 1.13 jmcneill 172 1.13 jmcneill KASSERT(dev != NULL); 173 1.13 jmcneill 174 1.13 jmcneill SIMPLEQ_FOREACH(ad, &acpi_softc->sc_head, ad_list) { 175 1.13 jmcneill struct acpi_attach_args aa = { 176 1.13 jmcneill .aa_node = ad 177 1.13 jmcneill }; 178 1.13 jmcneill struct acpi_i2c_context i2cc; 179 1.13 jmcneill ACPI_STATUS rv; 180 1.13 jmcneill 181 1.13 jmcneill if (!acpi_device_present(ad->ad_handle)) 182 1.13 jmcneill continue; 183 1.13 jmcneill if (ad->ad_device != NULL) 184 1.13 jmcneill continue; 185 1.13 jmcneill if (acpi_compatible_match(&aa, hid_compat_data) == 0) 186 1.13 jmcneill continue; 187 1.13 jmcneill 188 1.13 jmcneill memset(&i2cc, 0, sizeof(i2cc)); 189 1.13 jmcneill rv = AcpiWalkResources(ad->ad_handle, "_CRS", 190 1.13 jmcneill acpi_i2c_resource_parse_callback, &i2cc); 191 1.13 jmcneill if (ACPI_SUCCESS(rv) && 192 1.13 jmcneill i2cc.i2c_addr != 0 && 193 1.13 jmcneill i2cc.res_src == devnode) { 194 1.13 jmcneill aprint_debug_dev(dev, "claiming %s\n", ad->ad_name); 195 1.18 jmcneill ad->ad_device = dev; 196 1.19 jmcneill acpi_claim_childdevs(dev, ad, NULL); 197 1.13 jmcneill acpi_enter_i2c_device(ad, array); 198 1.13 jmcneill } 199 1.13 jmcneill } 200 1.13 jmcneill } 201 1.13 jmcneill 202 1.1 bouyer prop_array_t 203 1.20 thorpej acpi_copy_i2c_devs(device_t dev) 204 1.1 bouyer { 205 1.1 bouyer struct acpi_devnode *ad; 206 1.20 thorpej ACPI_HANDLE *hdl = devhandle_to_acpi(device_handle(dev)); 207 1.20 thorpej struct acpi_devnode *devnode = acpi_match_node(hdl); 208 1.20 thorpej 209 1.20 thorpej if (devnode == NULL) { 210 1.20 thorpej aprint_error_dev(dev, "%s: no devnode matching handle\n", 211 1.20 thorpej __func__); 212 1.20 thorpej return NULL; 213 1.20 thorpej } 214 1.20 thorpej 215 1.1 bouyer prop_array_t array = prop_array_create(); 216 1.1 bouyer if (array == NULL) 217 1.1 bouyer return NULL; 218 1.1 bouyer 219 1.1 bouyer SIMPLEQ_FOREACH(ad, &devnode->ad_child_head, ad_child_list) { 220 1.1 bouyer if (ad->ad_devinfo->Type != ACPI_TYPE_DEVICE) 221 1.1 bouyer continue; 222 1.4 christos if (!acpi_device_present(ad->ad_handle)) 223 1.4 christos continue; 224 1.1 bouyer acpi_enter_i2c_device(ad, array); 225 1.1 bouyer } 226 1.10 jmcneill 227 1.10 jmcneill if (dev != NULL) { 228 1.19 jmcneill acpi_claim_childdevs(dev, devnode, "_CRS"); 229 1.19 jmcneill acpi_claim_childdevs(dev, devnode, "_ADR"); 230 1.13 jmcneill acpi_enter_i2chid_devs(dev, devnode, array); 231 1.10 jmcneill } 232 1.10 jmcneill 233 1.1 bouyer return array; 234 1.1 bouyer } 235 1.14 jmcneill 236 1.16 jmcneill #if NIIC > 0 237 1.14 jmcneill static ACPI_STATUS 238 1.14 jmcneill acpi_i2c_gsb_init(ACPI_HANDLE region_hdl, UINT32 function, 239 1.14 jmcneill void *handler_ctx, void **region_ctx) 240 1.14 jmcneill { 241 1.14 jmcneill if (function == ACPI_REGION_DEACTIVATE) { 242 1.14 jmcneill *region_ctx = NULL; 243 1.14 jmcneill } else { 244 1.14 jmcneill *region_ctx = region_hdl; 245 1.14 jmcneill } 246 1.14 jmcneill return AE_OK; 247 1.14 jmcneill } 248 1.14 jmcneill 249 1.14 jmcneill static ACPI_STATUS 250 1.14 jmcneill acpi_i2c_gsb_handler(UINT32 function, ACPI_PHYSICAL_ADDRESS address, 251 1.14 jmcneill UINT32 bit_width, UINT64 *value, void *handler_ctx, 252 1.14 jmcneill void *region_ctx) 253 1.14 jmcneill { 254 1.14 jmcneill ACPI_OPERAND_OBJECT *region_obj = region_ctx; 255 1.14 jmcneill struct acpi_i2c_address_space_context *context = handler_ctx; 256 1.17 jmcneill UINT8 *buf = ACPI_CAST_PTR(uint8_t, value); 257 1.14 jmcneill ACPI_PHYSICAL_ADDRESS base_address; 258 1.14 jmcneill ACPI_RESOURCE *res; 259 1.14 jmcneill ACPI_STATUS rv; 260 1.17 jmcneill ACPI_CONNECTION_INFO *conn_info = &context->conn_info; 261 1.14 jmcneill i2c_tag_t tag = context->tag; 262 1.17 jmcneill i2c_addr_t i2c_addr; 263 1.14 jmcneill i2c_op_t op; 264 1.14 jmcneill union { 265 1.14 jmcneill uint8_t cmd8; 266 1.14 jmcneill uint16_t cmd16; 267 1.17 jmcneill uint32_t cmd32; 268 1.14 jmcneill } cmd; 269 1.17 jmcneill size_t buflen; 270 1.14 jmcneill size_t cmdlen; 271 1.17 jmcneill bool do_xfer = true; 272 1.14 jmcneill 273 1.14 jmcneill if (region_obj->Region.Type != ACPI_TYPE_REGION) { 274 1.14 jmcneill return AE_OK; 275 1.14 jmcneill } 276 1.14 jmcneill 277 1.14 jmcneill base_address = region_obj->Region.Address; 278 1.17 jmcneill KASSERT(region_obj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS); 279 1.14 jmcneill 280 1.14 jmcneill rv = AcpiBufferToResource(conn_info->Connection, conn_info->Length, 281 1.14 jmcneill &res); 282 1.14 jmcneill if (ACPI_FAILURE(rv)) { 283 1.14 jmcneill return rv; 284 1.14 jmcneill } 285 1.14 jmcneill if (res->Type != ACPI_RESOURCE_TYPE_SERIAL_BUS || 286 1.14 jmcneill res->Data.CommonSerialBus.Type != ACPI_RESOURCE_SERIAL_TYPE_I2C) { 287 1.14 jmcneill return AE_TYPE; 288 1.14 jmcneill } 289 1.14 jmcneill 290 1.17 jmcneill i2c_addr = res->Data.I2cSerialBus.SlaveAddress; 291 1.14 jmcneill if ((function & ACPI_IO_MASK) != 0) { 292 1.14 jmcneill op = I2C_OP_WRITE_WITH_STOP; 293 1.14 jmcneill } else { 294 1.14 jmcneill op = I2C_OP_READ_WITH_STOP; 295 1.14 jmcneill } 296 1.14 jmcneill 297 1.14 jmcneill #ifdef ACPI_I2C_DEBUG 298 1.17 jmcneill UINT32 length; 299 1.17 jmcneill rv = AcpiExGetProtocolBufferLength(function >> 16, &length); 300 1.17 jmcneill if (ACPI_FAILURE(rv)) { 301 1.17 jmcneill printf("%s AcpiExGetProtocolBufferLength failed: %s\n", 302 1.17 jmcneill __func__, AcpiFormatException(rv)); 303 1.17 jmcneill length = UINT32_MAX; 304 1.17 jmcneill } 305 1.14 jmcneill printf("%s %s: %s Attr %X Addr %.4X BaseAddr %.4X Length %.2X BitWidth %X BufLen %X", 306 1.17 jmcneill __func__, AcpiUtGetRegionName(region_obj->Region.SpaceId), 307 1.14 jmcneill (function & ACPI_IO_MASK) ? "Write" : "Read ", 308 1.14 jmcneill (UINT32) (function >> 16), 309 1.14 jmcneill (UINT32) address, (UINT32) base_address, 310 1.17 jmcneill length, bit_width, buf[1]); 311 1.14 jmcneill printf(" [AccessLength %.2X Connection %p]\n", 312 1.14 jmcneill conn_info->AccessLength, conn_info->Connection); 313 1.14 jmcneill #endif 314 1.14 jmcneill 315 1.17 jmcneill switch ((UINT32)(function >> 16)) { 316 1.17 jmcneill case AML_FIELD_ATTRIB_QUICK: 317 1.17 jmcneill cmdlen = 0; 318 1.17 jmcneill buflen = 0; 319 1.17 jmcneill break; 320 1.17 jmcneill case AML_FIELD_ATTRIB_SEND_RECEIVE: 321 1.17 jmcneill cmdlen = 0; 322 1.17 jmcneill buflen = 1; 323 1.17 jmcneill break; 324 1.17 jmcneill case AML_FIELD_ATTRIB_BYTE: 325 1.17 jmcneill cmdlen = bit_width / NBBY; 326 1.17 jmcneill buflen = 1; 327 1.17 jmcneill break; 328 1.17 jmcneill case AML_FIELD_ATTRIB_WORD: 329 1.17 jmcneill cmdlen = bit_width / NBBY; 330 1.17 jmcneill buflen = 2; 331 1.17 jmcneill break; 332 1.17 jmcneill case AML_FIELD_ATTRIB_BYTES: 333 1.17 jmcneill cmdlen = bit_width / NBBY; 334 1.17 jmcneill buflen = buf[1]; 335 1.17 jmcneill break; 336 1.17 jmcneill case AML_FIELD_ATTRIB_BLOCK: 337 1.17 jmcneill cmdlen = bit_width / NBBY; 338 1.17 jmcneill buflen = buf[1]; 339 1.17 jmcneill op |= I2C_OPMASK_BLKMODE; 340 1.17 jmcneill break; 341 1.17 jmcneill case AML_FIELD_ATTRIB_RAW_BYTES: 342 1.17 jmcneill case AML_FIELD_ATTRIB_RAW_PROCESS_BYTES: 343 1.17 jmcneill case AML_FIELD_ATTRIB_PROCESS_CALL: 344 1.17 jmcneill default: 345 1.17 jmcneill cmdlen = 0; 346 1.17 jmcneill do_xfer = false; 347 1.17 jmcneill #ifdef ACPI_I2C_DEBUG 348 1.17 jmcneill printf("field attrib 0x%x not supported\n", 349 1.17 jmcneill (UINT32)(function >> 16)); 350 1.17 jmcneill #endif 351 1.17 jmcneill break; 352 1.17 jmcneill } 353 1.17 jmcneill 354 1.17 jmcneill switch (cmdlen) { 355 1.17 jmcneill case 0: 356 1.17 jmcneill case 1: 357 1.14 jmcneill cmd.cmd8 = (uint8_t)(base_address + address); 358 1.17 jmcneill break; 359 1.17 jmcneill case 2: 360 1.14 jmcneill cmd.cmd16 = (uint16_t)(base_address + address); 361 1.17 jmcneill break; 362 1.17 jmcneill case 4: 363 1.17 jmcneill cmd.cmd32 = (uint32_t)(base_address + address); 364 1.17 jmcneill break; 365 1.17 jmcneill default: 366 1.17 jmcneill do_xfer = false; 367 1.17 jmcneill #ifdef ACPI_I2C_DEBUG 368 1.17 jmcneill printf("cmdlen %zu not supported\n", cmdlen); 369 1.17 jmcneill #endif 370 1.17 jmcneill break; 371 1.14 jmcneill } 372 1.17 jmcneill 373 1.17 jmcneill if (!do_xfer) { 374 1.17 jmcneill buf[0] = EINVAL; 375 1.14 jmcneill } else { 376 1.14 jmcneill const int flags = I2C_F_POLL; 377 1.14 jmcneill iic_acquire_bus(tag, flags); 378 1.17 jmcneill buf[0] = iic_exec(tag, op, i2c_addr, 379 1.17 jmcneill &cmd, cmdlen, &buf[2], buflen, flags); 380 1.14 jmcneill iic_release_bus(tag, flags); 381 1.17 jmcneill if (buf[0] == 0) { 382 1.17 jmcneill buf[1] = buflen; 383 1.14 jmcneill } 384 1.14 jmcneill #ifdef ACPI_I2C_DEBUG 385 1.17 jmcneill printf("%s iic_exec op %u addr 0x%x len %zu/%zu returned %d\n", 386 1.17 jmcneill __func__, op, res->Data.I2cSerialBus.SlaveAddress, cmdlen, 387 1.17 jmcneill buflen, buf[0]); 388 1.14 jmcneill #endif 389 1.14 jmcneill } 390 1.14 jmcneill 391 1.14 jmcneill ACPI_FREE(res); 392 1.14 jmcneill 393 1.14 jmcneill return AE_OK; 394 1.14 jmcneill } 395 1.16 jmcneill #endif 396 1.14 jmcneill 397 1.21 thorpej void 398 1.21 thorpej acpi_i2c_register(device_t dev, i2c_tag_t tag) 399 1.14 jmcneill { 400 1.16 jmcneill #if NIIC > 0 401 1.21 thorpej ACPI_HANDLE hdl = devhandle_to_acpi(device_handle(dev)); 402 1.14 jmcneill struct acpi_i2c_address_space_context *context; 403 1.14 jmcneill ACPI_STATUS rv; 404 1.14 jmcneill 405 1.14 jmcneill context = kmem_zalloc(sizeof(*context), KM_SLEEP); 406 1.14 jmcneill context->tag = tag; 407 1.14 jmcneill 408 1.21 thorpej rv = AcpiInstallAddressSpaceHandler(hdl, 409 1.14 jmcneill ACPI_ADR_SPACE_GSBUS, acpi_i2c_gsb_handler, acpi_i2c_gsb_init, 410 1.14 jmcneill context); 411 1.14 jmcneill if (ACPI_FAILURE(rv)) { 412 1.14 jmcneill aprint_error_dev(dev, 413 1.14 jmcneill "couldn't install address space handler: %s", 414 1.14 jmcneill AcpiFormatException(rv)); 415 1.14 jmcneill } 416 1.16 jmcneill #endif 417 1.14 jmcneill } 418