- pdata->button[i].code = code;
- pdata->button[i].desc = of_get_property(child_node, "label", NULL);
- pdata->button[i].type = rk_key_type_get(child_node, &pdata->button[i]);
- switch(pdata->button[i].type)
- {
- case TYPE_GPIO:
- gpio = of_get_gpio_flags(child_node, 0, &flags);
- if (gpio < 0) {
- ret = gpio;
- if (ret != -EPROBE_DEFER)
- dev_err(&pdev->dev,"Failed to get gpio flags, error: %d\n",
- ret);
- goto error_ret;
- }
-
- pdata->button[i].gpio = gpio;
- pdata->button[i].active_low = flags & OF_GPIO_ACTIVE_LOW;
- pdata->button[i].wakeup = !!of_get_property(child_node, "gpio-key,wakeup", NULL);
- break;
-
- case TYPE_ADC:
- if (of_property_read_u32(child_node, "rockchip,adc_value", &adc_value)) {
- dev_err(&pdev->dev, "Missing rockchip,adc_value property in the DT.\n");
- ret = -EINVAL;
- goto error_ret;
- }
- pdata->button[i].adc_value = adc_value;
- break;
-
- default:
- dev_err(&pdev->dev, "Error rockchip,type property in the DT.\n");
- ret = -EINVAL;
- goto error_ret;
+ pdata->button[i].code = code;
+ pdata->button[i].desc =
+ of_get_property(child_node, "label", NULL);
+ pdata->button[i].type =
+ rk_key_type_get(child_node, &pdata->button[i]);
+ switch (pdata->button[i].type) {
+ case TYPE_GPIO:
+ gpio = of_get_gpio_flags(child_node, 0, &flags);
+ if (gpio < 0) {
+ ret = gpio;
+ if (ret != -EPROBE_DEFER)
+ dev_err(&pdev->dev,
+ "Failed to get gpio flags, error: %d\n",
+ ret);
+ goto error_ret;
+ }
+
+ pdata->button[i].gpio = gpio;
+ pdata->button[i].active_low =
+ flags & OF_GPIO_ACTIVE_LOW;
+ pdata->button[i].wakeup =
+ !!of_get_property(child_node, "gpio-key,wakeup",
+ NULL);
+ break;
+
+ case TYPE_ADC:
+ if (of_property_read_u32
+ (child_node, "rockchip,adc_value", &adc_value)) {
+ dev_err(&pdev->dev,
+ "Missing rockchip,adc_value property in the DT.\n");
+ ret = -EINVAL;
+ goto error_ret;
+ }
+ pdata->button[i].adc_value = adc_value;
+ break;
+
+ default:
+ dev_err(&pdev->dev,
+ "Error rockchip,type property in the DT.\n");
+ ret = -EINVAL;
+ goto error_ret;