Lines Matching refs:type
77 static enum shps_dsm_fn shps_dsm_fn_for_irq(enum shps_irq_type type)
79 return SHPS_DSM_FN_IRQ_BASE_PRESENCE + type;
82 static void shps_dsm_notify_irq(struct platform_device *pdev, enum shps_irq_type type)
90 mutex_lock(&sdev->lock[type]);
92 value = gpiod_get_value_cansleep(sdev->gpio[type]);
94 mutex_unlock(&sdev->lock[type]);
95 dev_err(&pdev->dev, "failed to get gpio: %d (irq=%d)\n", type, value);
99 dev_dbg(&pdev->dev, "IRQ notification via DSM (irq=%d, value=%d)\n", type, value);
101 param.type = ACPI_TYPE_INTEGER;
105 shps_dsm_fn_for_irq(type), ¶m, ACPI_TYPE_BUFFER);
108 type, value);
113 type, value);
116 mutex_unlock(&sdev->lock[type]);
125 int type;
128 for (type = 0; type < SHPS_NUM_IRQS; type++)
129 if (irq == sdev->irq[type])
133 if (WARN(type >= SHPS_NUM_IRQS, "invalid IRQ number: %d\n", irq))
137 shps_dsm_notify_irq(pdev, type);
141 static int shps_setup_irq(struct platform_device *pdev, enum shps_irq_type type)
148 const int dsm = shps_dsm_fn_for_irq(type);
157 dev_dbg(&pdev->dev, "IRQ notification via DSM not present (irq=%d)\n", type);
161 gpiod = devm_gpiod_get(&pdev->dev, shps_gpio_names[type], GPIOD_ASIS);
169 irq_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "shps-irq-%d", type);
178 dev_dbg(&pdev->dev, "set up irq %d as type %d\n", irq, type);
180 sdev->gpio[type] = gpiod;
181 sdev->irq[type] = irq;