Unverified Commit 6e22f089 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: codecs: aw88261: add dvdd-supply property

Merge series from Bharadwaj Raju <bharadwaj.raju@machinesoul.in>:

The AW88261 has a DVDD chip which needs to be powered on for it to
function correctly. The property for this was missing, so this patchset
adds the dvdd-supply property which enables a regulator to be bound
to it in a device tree.
parents 10303b32 519d0a6b
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ properties:
  reset-gpios:
    maxItems: 1

  dvdd-supply: true

  awinic,audio-channel:
    description:
      It is used to distinguish multiple PA devices, so that different
@@ -65,6 +67,17 @@ allOf:
    then:
      properties:
        reset-gpios: false
  - if:
      properties:
        compatible:
          contains:
            const: awinic,aw88261
    then:
      required:
        - dvdd-supply
    else:
      properties:
        dvdd-supply: false

unevaluatedProperties: false

+5 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include <linux/i2c.h>
#include <linux/firmware.h>
#include <linux/regmap.h>
#include <linux/regulator/consumer.h>
#include <sound/soc.h>
#include "aw88261.h"
#include "aw88395/aw88395_data_type.h"
@@ -1190,6 +1191,10 @@ static int aw88261_init(struct aw88261 *aw88261, struct i2c_client *i2c, struct
	unsigned int chip_id;
	int ret;

	ret = devm_regulator_get_enable(&i2c->dev, "dvdd");
	if (ret)
		return dev_err_probe(&i2c->dev, ret, "Failed to enable dvdd supply\n");

	/* read chip id */
	ret = regmap_read(regmap, AW88261_ID_REG, &chip_id);
	if (ret) {