Prechádzať zdrojové kódy

asoc: codecs: Update default value for chip wakeup regs

For chip wakeup registers used as interrupt mask, set
default value provided via dtsi.

Change-Id: Ie080006cb7a92e8745636c97a67b8e09ab977832
Signed-off-by: Laxminath Kasam <[email protected]>
Laxminath Kasam 5 rokov pred
rodič
commit
0f73819a4d
1 zmenil súbory, kde vykonal 16 pridanie a 1 odobranie
  1. 16 1
      asoc/codecs/msm-cdc-pinctrl.c

+ 16 - 1
asoc/codecs/msm-cdc-pinctrl.c

@@ -196,7 +196,8 @@ static int msm_cdc_pinctrl_probe(struct platform_device *pdev)
 	struct msm_cdc_pinctrl_info *gpio_data;
 	u32 tlmm_gpio[MAX_GPIOS] = {0};
 	u32 chip_wakeup_reg[MAX_GPIOS] = {0};
-	u32 i = 0;
+	u32 chip_wakeup_default_val[MAX_GPIOS] = {0};
+	u32 i = 0, temp = 0;
 	int count = 0;
 
 	gpio_data = devm_kzalloc(&pdev->dev,
@@ -258,6 +259,20 @@ static int msm_cdc_pinctrl_probe(struct platform_device *pdev)
 			gpio_data->chip_wakeup_register[i] =
 				devm_ioremap(&pdev->dev, chip_wakeup_reg[i], 0x4);
 		}
+		if (of_property_read_u32_array(pdev->dev.of_node,
+					"qcom,chip-wakeup-default-val",
+					chip_wakeup_default_val, count)) {
+			for (i = 0; i < count; i++) {
+				temp = ioread32(gpio_data->chip_wakeup_register[i]);
+				if (chip_wakeup_default_val[i])
+					temp |= (1 <<
+						 gpio_data->chip_wakeup_maskbit[i]);
+				else
+					temp &= ~(1 <<
+						  gpio_data->chip_wakeup_maskbit[i]);
+				iowrite32(temp, gpio_data->chip_wakeup_register[i]);
+			}
+		}
 		gpio_data->wakeup_reg_count = count;
 	}