Lines Matching refs:int3472
43 static void skl_int3472_log_sensor_module_name(struct int3472_discrete_device *int3472) in skl_int3472_log_sensor_module_name() argument
47 obj = acpi_evaluate_dsm_typed(int3472->sensor->handle, in skl_int3472_log_sensor_module_name()
51 dev_dbg(int3472->dev, "Sensor module id: '%s'\n", obj->string.pointer); in skl_int3472_log_sensor_module_name()
78 static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int3472, in skl_int3472_map_gpio_to_sensor() argument
84 if (int3472->n_sensor_gpios >= INT3472_MAX_SENSOR_GPIOS) { in skl_int3472_map_gpio_to_sensor()
85 dev_warn(int3472->dev, "Too many GPIOs mapped\n"); in skl_int3472_map_gpio_to_sensor()
89 ret = skl_int3472_fill_gpiod_lookup(&int3472->gpios.table[int3472->n_sensor_gpios], in skl_int3472_map_gpio_to_sensor()
94 int3472->n_sensor_gpios++; in skl_int3472_map_gpio_to_sensor()
101 skl_int3472_gpiod_get_from_temp_lookup(struct int3472_discrete_device *int3472, in skl_int3472_gpiod_get_from_temp_lookup() argument
113 lookup->dev_id = dev_name(int3472->dev); in skl_int3472_gpiod_get_from_temp_lookup()
119 desc = devm_gpiod_get(int3472->dev, func, GPIOD_OUT_LOW); in skl_int3472_gpiod_get_from_temp_lookup()
190 struct int3472_discrete_device *int3472 = data; in skl_int3472_handle_gpio_resources() local
207 obj = acpi_evaluate_dsm_typed(int3472->adev->handle, in skl_int3472_handle_gpio_resources()
209 int3472->ngpios + 2, in skl_int3472_handle_gpio_resources()
213 dev_warn(int3472->dev, "No _DSM entry for GPIO pin %u\n", in skl_int3472_handle_gpio_resources()
224 dev_warn(int3472->dev, "%s %s pin number mismatch _DSM %d resource %d\n", in skl_int3472_handle_gpio_resources()
232 dev_dbg(int3472->dev, "%s %s pin %d active-%s\n", func, in skl_int3472_handle_gpio_resources()
239 ret = skl_int3472_map_gpio_to_sensor(int3472, agpio, func, polarity); in skl_int3472_handle_gpio_resources()
247 gpio = skl_int3472_gpiod_get_from_temp_lookup(int3472, agpio, func, polarity); in skl_int3472_handle_gpio_resources()
256 ret = skl_int3472_register_gpio_clock(int3472, gpio); in skl_int3472_handle_gpio_resources()
262 ret = skl_int3472_register_pled(int3472, gpio); in skl_int3472_handle_gpio_resources()
268 ret = skl_int3472_register_regulator(int3472, gpio); in skl_int3472_handle_gpio_resources()
279 dev_warn(int3472->dev, in skl_int3472_handle_gpio_resources()
286 int3472->ngpios++; in skl_int3472_handle_gpio_resources()
290 return dev_err_probe(int3472->dev, ret, err_msg); in skl_int3472_handle_gpio_resources()
295 static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472) in skl_int3472_parse_crs() argument
300 skl_int3472_log_sensor_module_name(int3472); in skl_int3472_parse_crs()
302 ret = acpi_dev_get_resources(int3472->adev, &resource_list, in skl_int3472_parse_crs()
304 int3472); in skl_int3472_parse_crs()
311 ret = skl_int3472_register_dsm_clock(int3472); in skl_int3472_parse_crs()
315 int3472->gpios.dev_id = int3472->sensor_name; in skl_int3472_parse_crs()
316 gpiod_add_lookup_table(&int3472->gpios); in skl_int3472_parse_crs()
323 struct int3472_discrete_device *int3472 = platform_get_drvdata(pdev); in skl_int3472_discrete_remove() local
325 gpiod_remove_lookup_table(&int3472->gpios); in skl_int3472_discrete_remove()
327 skl_int3472_unregister_clock(int3472); in skl_int3472_discrete_remove()
328 skl_int3472_unregister_pled(int3472); in skl_int3472_discrete_remove()
329 skl_int3472_unregister_regulator(int3472); in skl_int3472_discrete_remove()
335 struct int3472_discrete_device *int3472; in skl_int3472_discrete_probe() local
352 int3472 = devm_kzalloc(&pdev->dev, struct_size(int3472, gpios.table, in skl_int3472_discrete_probe()
354 if (!int3472) in skl_int3472_discrete_probe()
357 int3472->adev = adev; in skl_int3472_discrete_probe()
358 int3472->dev = &pdev->dev; in skl_int3472_discrete_probe()
359 platform_set_drvdata(pdev, int3472); in skl_int3472_discrete_probe()
360 int3472->clock.imgclk_index = cldb.clock_source; in skl_int3472_discrete_probe()
362 ret = skl_int3472_get_sensor_adev_and_name(&pdev->dev, &int3472->sensor, in skl_int3472_discrete_probe()
363 &int3472->sensor_name); in skl_int3472_discrete_probe()
371 INIT_LIST_HEAD(&int3472->gpios.list); in skl_int3472_discrete_probe()
373 ret = skl_int3472_parse_crs(int3472); in skl_int3472_discrete_probe()