Lines Matching refs:int3472
42 static void skl_int3472_log_sensor_module_name(struct int3472_discrete_device *int3472) in skl_int3472_log_sensor_module_name() argument
46 obj = acpi_evaluate_dsm_typed(int3472->sensor->handle, in skl_int3472_log_sensor_module_name()
50 dev_dbg(int3472->dev, "Sensor module id: '%s'\n", obj->string.pointer); in skl_int3472_log_sensor_module_name()
55 static int skl_int3472_map_gpio_to_sensor(struct int3472_discrete_device *int3472, in skl_int3472_map_gpio_to_sensor() argument
65 if (int3472->n_sensor_gpios >= INT3472_MAX_SENSOR_GPIOS) { in skl_int3472_map_gpio_to_sensor()
66 dev_warn(int3472->dev, "Too many GPIOs mapped\n"); in skl_int3472_map_gpio_to_sensor()
78 table_entry = &int3472->gpios.table[int3472->n_sensor_gpios]; in skl_int3472_map_gpio_to_sensor()
85 int3472->n_sensor_gpios++; in skl_int3472_map_gpio_to_sensor()
155 struct int3472_discrete_device *int3472 = data; in skl_int3472_handle_gpio_resources() local
171 obj = acpi_evaluate_dsm_typed(int3472->adev->handle, in skl_int3472_handle_gpio_resources()
173 int3472->ngpios + 2, in skl_int3472_handle_gpio_resources()
177 dev_warn(int3472->dev, "No _DSM entry for GPIO pin %u\n", in skl_int3472_handle_gpio_resources()
188 dev_warn(int3472->dev, "%s %s pin number mismatch _DSM %d resource %d\n", in skl_int3472_handle_gpio_resources()
196 dev_dbg(int3472->dev, "%s %s pin %d active-%s\n", func, in skl_int3472_handle_gpio_resources()
203 ret = skl_int3472_map_gpio_to_sensor(int3472, agpio, func, polarity); in skl_int3472_handle_gpio_resources()
209 ret = skl_int3472_register_gpio_clock(int3472, agpio, polarity); in skl_int3472_handle_gpio_resources()
215 ret = skl_int3472_register_pled(int3472, agpio, polarity); in skl_int3472_handle_gpio_resources()
221 ret = skl_int3472_register_regulator(int3472, agpio); in skl_int3472_handle_gpio_resources()
227 dev_warn(int3472->dev, in skl_int3472_handle_gpio_resources()
234 int3472->ngpios++; in skl_int3472_handle_gpio_resources()
238 return dev_err_probe(int3472->dev, ret, err_msg); in skl_int3472_handle_gpio_resources()
243 static int skl_int3472_parse_crs(struct int3472_discrete_device *int3472) in skl_int3472_parse_crs() argument
248 skl_int3472_log_sensor_module_name(int3472); in skl_int3472_parse_crs()
250 ret = acpi_dev_get_resources(int3472->adev, &resource_list, in skl_int3472_parse_crs()
252 int3472); in skl_int3472_parse_crs()
259 ret = skl_int3472_register_dsm_clock(int3472); in skl_int3472_parse_crs()
263 int3472->gpios.dev_id = int3472->sensor_name; in skl_int3472_parse_crs()
264 gpiod_add_lookup_table(&int3472->gpios); in skl_int3472_parse_crs()
271 struct int3472_discrete_device *int3472 = platform_get_drvdata(pdev); in skl_int3472_discrete_remove() local
273 gpiod_remove_lookup_table(&int3472->gpios); in skl_int3472_discrete_remove()
275 skl_int3472_unregister_clock(int3472); in skl_int3472_discrete_remove()
276 skl_int3472_unregister_pled(int3472); in skl_int3472_discrete_remove()
277 skl_int3472_unregister_regulator(int3472); in skl_int3472_discrete_remove()
283 struct int3472_discrete_device *int3472; in skl_int3472_discrete_probe() local
300 int3472 = devm_kzalloc(&pdev->dev, struct_size(int3472, gpios.table, in skl_int3472_discrete_probe()
302 if (!int3472) in skl_int3472_discrete_probe()
305 int3472->adev = adev; in skl_int3472_discrete_probe()
306 int3472->dev = &pdev->dev; in skl_int3472_discrete_probe()
307 platform_set_drvdata(pdev, int3472); in skl_int3472_discrete_probe()
308 int3472->clock.imgclk_index = cldb.clock_source; in skl_int3472_discrete_probe()
310 ret = skl_int3472_get_sensor_adev_and_name(&pdev->dev, &int3472->sensor, in skl_int3472_discrete_probe()
311 &int3472->sensor_name); in skl_int3472_discrete_probe()
319 INIT_LIST_HEAD(&int3472->gpios.list); in skl_int3472_discrete_probe()
321 ret = skl_int3472_parse_crs(int3472); in skl_int3472_discrete_probe()