Commit 31ef718a authored by Charles Keepax's avatar Charles Keepax Committed by DidntRead
Browse files

switch: arizona: Check short circuit impedance after parsing DT



Currently we do calculations based on the short circuit impedance before
we have read that value from device tree. Move this to after we have
parsed the device tree.

Change-Id: I6869dc9f568a7f42818199981161d02cb7e59b69
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
parent cac7479e
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -3226,11 +3226,6 @@ static int arizona_extcon_probe(struct platform_device *pdev)
	if (!arizona->dapm || !arizona->dapm->card)
		return -EPROBE_DEFER;

	if (pdata->hpdet_short_circuit_imp < 1)
		pdata->hpdet_short_circuit_imp = ARIZONA_HP_SHORT_IMPEDANCE;
	else if	(pdata->hpdet_short_circuit_imp >= HP_LOW_IMPEDANCE_LIMIT)
		pdata->hpdet_short_circuit_imp = HP_LOW_IMPEDANCE_LIMIT - 1;

	info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
	if (!info)
		return -ENOMEM;
@@ -3243,6 +3238,11 @@ static int arizona_extcon_probe(struct platform_device *pdev)
		}
	}

	if (pdata->hpdet_short_circuit_imp < 1)
		pdata->hpdet_short_circuit_imp = ARIZONA_HP_SHORT_IMPEDANCE;
	else if	(pdata->hpdet_short_circuit_imp >= HP_LOW_IMPEDANCE_LIMIT)
		pdata->hpdet_short_circuit_imp = HP_LOW_IMPEDANCE_LIMIT - 1;

	/* Set of_node to parent from the SPI device to allow
	 * location regulator supplies */
	pdev->dev.of_node = arizona->dev->of_node;