Lines Matching refs:int3472

44 static void skl_int3472_log_sensor_module_name(struct int3472_discrete_device *int3472)  in skl_int3472_log_sensor_module_name()  argument
48 obj = acpi_evaluate_dsm_typed(int3472->sensor->handle, in skl_int3472_log_sensor_module_name()
52 dev_dbg(int3472->dev, "Sensor module id: '%s'\n", obj->string.pointer); in skl_int3472_log_sensor_module_name()
79 static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int3472, in skl_int3472_map_gpio_to_sensor() argument
85 if (int3472->n_sensor_gpios >= INT3472_MAX_SENSOR_GPIOS) { in skl_int3472_map_gpio_to_sensor()
86 dev_warn(int3472->dev, "Too many GPIOs mapped\n"); in skl_int3472_map_gpio_to_sensor()
90 ret = skl_int3472_fill_gpiod_lookup(&int3472->gpios.table[int3472->n_sensor_gpios], in skl_int3472_map_gpio_to_sensor()
95 int3472->n_sensor_gpios++; in skl_int3472_map_gpio_to_sensor()
102 skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472, in skl_int3472_gpiod_get_from_temp_lookup() argument
114 lookup->dev_id = dev_name(int3472->dev); in skl_int3472_gpiod_get_from_temp_lookup()
120 desc = devm_gpiod_get(int3472->dev, con_id, GPIOD_OUT_LOW); in skl_int3472_gpiod_get_from_temp_lookup()
235 struct int3472_discrete_device *int3472 = data; in skl_int3472_handle_gpio_resources() local
252 obj = acpi_evaluate_dsm_typed(int3472->adev->handle, in skl_int3472_handle_gpio_resources()
254 int3472->ngpios + 2, in skl_int3472_handle_gpio_resources()
258 dev_warn(int3472->dev, "No _DSM entry for GPIO pin %u\n", in skl_int3472_handle_gpio_resources()
265 int3472_get_con_id_and_polarity(int3472->sensor, &type, &con_id, &gpio_flags); in skl_int3472_handle_gpio_resources()
270 dev_dbg(int3472->dev, FW_BUG "%s %s pin number mismatch _DSM %d resource %d\n", in skl_int3472_handle_gpio_resources()
277 dev_dbg(int3472->dev, "%s %s pin %d active-%s\n", con_id, in skl_int3472_handle_gpio_resources()
284 ret = skl_int3472_map_gpio_to_sensor(int3472, agpio, con_id, gpio_flags); in skl_int3472_handle_gpio_resources()
292 gpio = skl_int3472_gpiod_get_from_temp_lookup(int3472, agpio, con_id, gpio_flags); in skl_int3472_handle_gpio_resources()
301 ret = skl_int3472_register_gpio_clock(int3472, gpio); in skl_int3472_handle_gpio_resources()
307 ret = skl_int3472_register_pled(int3472, gpio); in skl_int3472_handle_gpio_resources()
313 ret = skl_int3472_register_regulator(int3472, gpio); in skl_int3472_handle_gpio_resources()
324 dev_warn(int3472->dev, in skl_int3472_handle_gpio_resources()
331 int3472->ngpios++; in skl_int3472_handle_gpio_resources()
335 return dev_err_probe(int3472->dev, ret, err_msg); in skl_int3472_handle_gpio_resources()
341 static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472) in skl_int3472_parse_crs() argument
346 skl_int3472_log_sensor_module_name(int3472); in skl_int3472_parse_crs()
348 ret = acpi_dev_get_resources(int3472->adev, &resource_list, in skl_int3472_parse_crs()
350 int3472); in skl_int3472_parse_crs()
357 ret = skl_int3472_register_dsm_clock(int3472); in skl_int3472_parse_crs()
361 int3472->gpios.dev_id = int3472->sensor_name; in skl_int3472_parse_crs()
362 gpiod_add_lookup_table(&int3472->gpios); in skl_int3472_parse_crs()
369 struct int3472_discrete_device *int3472 = platform_get_drvdata(pdev); in skl_int3472_discrete_remove() local
371 gpiod_remove_lookup_table(&int3472->gpios); in skl_int3472_discrete_remove()
373 skl_int3472_unregister_clock(int3472); in skl_int3472_discrete_remove()
374 skl_int3472_unregister_pled(int3472); in skl_int3472_discrete_remove()
375 skl_int3472_unregister_regulator(int3472); in skl_int3472_discrete_remove()
381 struct int3472_discrete_device *int3472; in skl_int3472_discrete_probe() local
401 int3472 = devm_kzalloc(&pdev->dev, struct_size(int3472, gpios.table, in skl_int3472_discrete_probe()
403 if (!int3472) in skl_int3472_discrete_probe()
406 int3472->adev = adev; in skl_int3472_discrete_probe()
407 int3472->dev = &pdev->dev; in skl_int3472_discrete_probe()
408 platform_set_drvdata(pdev, int3472); in skl_int3472_discrete_probe()
409 int3472->clock.imgclk_index = cldb.clock_source; in skl_int3472_discrete_probe()
411 ret = skl_int3472_get_sensor_adev_and_name(&pdev->dev, &int3472->sensor, in skl_int3472_discrete_probe()
412 &int3472->sensor_name); in skl_int3472_discrete_probe()
420 INIT_LIST_HEAD(&int3472->gpios.list); in skl_int3472_discrete_probe()
422 ret = skl_int3472_parse_crs(int3472); in skl_int3472_discrete_probe()