Commit 99dd3c53 authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branches 'asoc/topic/cs35l35', 'asoc/topic/cs53l30',...

Merge remote-tracking branches 'asoc/topic/cs35l35', 'asoc/topic/cs53l30', 'asoc/topic/da7213', 'asoc/topic/dio2125' and 'asoc/topic/dwc' into asoc-next
Loading
Loading
Loading
Loading
+180 −0
Original line number Diff line number Diff line
CS35L35 Boosted Speaker Amplifier

Required properties:

  - compatible : "cirrus,cs35l35"

  - reg : the I2C address of the device for I2C

  - VA-supply, VP-supply : power supplies for the device,
    as covered in
    Documentation/devicetree/bindings/regulator/regulator.txt.

  - interrupt-parent : Specifies the phandle of the interrupt controller to
    which the IRQs from CS35L35 are delivered to.
  - interrupts : IRQ line info CS35L35.
    (See Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
    for further information relating to interrupt properties)

Optional properties:
  - reset-gpios : gpio used to reset the amplifier

  - cirrus,stereo-config : Boolean to determine if there are 2 AMPs for a
  Stereo configuration

  - cirrus,audio-channel : Set Location of Audio Signal on Serial Port
  0 = Data Packet received on Left I2S Channel
  1 = Data Packet received on Right I2S Channel

  - cirrus,advisory-channel : Set Location of Advisory Signal on Serial Port
  0 = Data Packet received on Left I2S Channel
  1 = Data Packet received on Right I2S Channel

  - cirrus,shared-boost : Boolean to enable ClassH tracking of Advisory Signal
  if 2 Devices share Boost BST_CTL

  - cirrus,external-boost : Boolean to specify the device is using an external
  boost supply, note that sharing a boost from another cs35l35 would constitute
  using an external supply for the slave device

  - cirrus,sp-drv-strength : Value for setting the Serial Port drive strength
  Table 3-10 of the datasheet lists drive-strength specifications
  0 = 1x (Default)
  1 = .5x
  - cirrus,sp-drv-unused : Determines how unused slots should be driven on the
  Serial Port.
  0 - Hi-Z
  2 - Drive 0's (Default)
  3 - Drive 1's

  - cirrus,bst-pdn-fet-on : Boolean to determine if the Boost PDN control
  powers down with a rectification FET On or Off. If VSPK is supplied
  externally then FET is off.

  - cirrus,boost-ctl-millivolt : Boost Voltage Value.  Configures the boost
    converter's output voltage in mV. The range is from 2600mV to 9000mV with
    increments of 100mV.
    (Default) VP

  - cirrus,boost-peak-milliamp : Boost-converter peak current limit in mA.
  Configures the peak current by monitoring the current through the boost FET.
  Range starts at 1680mA and goes to a maximum of 4480mA with increments of
  110mA.
  (Default) 2.46 Amps

  - cirrus,amp-gain-zc : Boolean to determine if to use Amplifier gain-change
  zero-cross

Optional H/G Algorithm sub-node:

  The cs35l35 node can have a single "cirrus,classh-internal-algo" sub-node
  that will disable automatic control of the internal H/G Algorithm.

  It is strongly recommended that the Datasheet be referenced when adjusting
  or using these Class H Algorithm controls over the internal Algorithm.
  Serious damage can occur to the Device and surrounding components.

  - cirrus,classh-internal-algo : Sub-node for the Internal Class H Algorithm
  See Section 4.3 Internal Class H Algorithm in the Datasheet.
  If not used, the device manages the ClassH Algorithm internally.

Optional properties for the "cirrus,classh-internal-algo" Sub-node

  Section 7.29 Class H Control
  - cirrus,classh-bst-overide : Boolean
  - cirrus,classh-bst-max-limit
  - cirrus,classh-mem-depth

  Section 7.30 Class H Headroom Control
  - cirrus,classh-headroom

  Section 7.31 Class H Release Rate
  - cirrus,classh-release-rate

  Section 7.32 Class H Weak FET Drive Control
  - cirrus,classh-wk-fet-disable
  - cirrus,classh-wk-fet-delay
  - cirrus,classh-wk-fet-thld

  Section 7.34 Class H VP Control
  - cirrus,classh-vpch-auto
  - cirrus,classh-vpch-rate
  - cirrus,classh-vpch-man

Optional Monitor Signal Format sub-node:

  The cs35l35 node can have a single "cirrus,monitor-signal-format" sub-node
  for adjusting the Depth, Location and Frame of the Monitoring Signals
  for Algorithms.

  See Sections 4.8.2 through 4.8.4 Serial-Port Control in the Datasheet

  -cirrus,monitor-signal-format : Sub-node for the Monitor Signaling Formating
  on the I2S Port. Each of the 3 8 bit values in the array contain the settings
  for depth, location, and frame.

  If not used, the defaults for the 6 monitor signals is used.

  Sections 7.44 - 7.53 lists values for the depth, location, and frame
  for each monitoring signal.

  - cirrus,imon : 4 8 bit values to set the depth, location, frame and ADC
  scale of the IMON monitor signal.

  - cirrus,vmon : 3 8 bit values to set the depth, location, and frame
  of the VMON monitor signal.

  - cirrus,vpmon : 3 8 bit values to set the depth, location, and frame
  of the VPMON monitor signal.

  - cirrus,vbstmon : 3 8 bit values to set the depth, location, and frame
  of the VBSTMON monitor signal

  - cirrus,vpbrstat : 3 8 bit values to set the depth, location, and frame
  of the VPBRSTAT monitor signal

  - cirrus,zerofill : 3 8 bit values to set the depth, location, and frame\
  of the ZEROFILL packet in the monitor signal

Example:

cs35l35: cs35l35@20 {
	compatible = "cirrus,cs35l35";
	reg = <0x20>;
	VA-supply = <&dummy_vreg>;
	VP-supply = <&dummy_vreg>;
	reset-gpios = <&axi_gpio 54 0>;
	interrupt-parent = <&gpio8>;
	interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
	cirrus,boost-ctl-millivolt = <9000>;

	cirrus,stereo-config;
	cirrus,audio-channel = <0x00>;
	cirrus,advisory-channel = <0x01>;
	cirrus,shared-boost;

	cirrus,classh-internal-algo {
		cirrus,classh-bst-overide;
		cirrus,classh-bst-max-limit = <0x01>;
		cirrus,classh-mem-depth = <0x01>;
		cirrus,classh-release-rate = <0x08>;
		cirrus,classh-headroom-millivolt = <0x0B>;
		cirrus,classh-wk-fet-disable = <0x01>;
		cirrus,classh-wk-fet-delay = <0x04>;
		cirrus,classh-wk-fet-thld = <0x01>;
		cirrus,classh-vpch-auto = <0x01>;
		cirrus,classh-vpch-rate = <0x02>;
		cirrus,classh-vpch-man = <0x05>;
	};

	/* Depth, Location, Frame */
	cirrus,monitor-signal-format {
		cirrus,imon = /bits/ 8 <0x03 0x00 0x01>;
		cirrus,vmon = /bits/ 8 <0x03 0x00 0x00>;
		cirrus,vpmon = /bits/ 8 <0x03 0x04 0x00>;
		cirrus,vbstmon = /bits/ 8 <0x03 0x04 0x01>;
		cirrus,vpbrstat = /bits/ 8 <0x00 0x04 0x00>;
		cirrus,zerofill = /bits/ 8 <0x00 0x00 0x00>;
	};

};
+12 −0
Original line number Diff line number Diff line
DIO2125 Audio Driver

Required properties:
- compatible : "dioo,dio2125"
- enable-gpios : the gpio connected to the enable pin of the dio2125

Example:

amp: analog-amplifier {
	compatible = "dioo,dio2125";
	enable-gpios = <&gpio GPIOH_3 0>;
};
+108 −0
Original line number Diff line number Diff line
/*
 * linux/sound/cs35l35.h -- Platform data for CS35l35
 *
 * Copyright (c) 2016 Cirrus Logic Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef __CS35L35_H
#define __CS35L35_H

struct classh_cfg {
	/*
	 * Class H Algorithm Control Variables
	 * You can either have it done
	 * automatically or you can adjust
	 * these variables for tuning
	 *
	 * if you do not enable the internal algorithm
	 * you will get a set of mixer controls for
	 * Class H tuning
	 *
	 * Section 4.3 of the datasheet
	 */
	bool classh_bst_override;
	bool classh_algo_enable;
	int classh_bst_max_limit;
	int classh_mem_depth;
	int classh_release_rate;
	int classh_headroom;
	int classh_wk_fet_disable;
	int classh_wk_fet_delay;
	int classh_wk_fet_thld;
	int classh_vpch_auto;
	int classh_vpch_rate;
	int classh_vpch_man;
};

struct monitor_cfg {
	/*
	 * Signal Monitor Data
	 * highly configurable signal monitoring
	 * data positioning and different types of
	 * monitoring data.
	 *
	 * Section 4.8.2 - 4.8.4 of the datasheet
	 */
	bool is_present;
	bool imon_specs;
	bool vmon_specs;
	bool vpmon_specs;
	bool vbstmon_specs;
	bool vpbrstat_specs;
	bool zerofill_specs;
	u8 imon_dpth;
	u8 imon_loc;
	u8 imon_frm;
	u8 imon_scale;
	u8 vmon_dpth;
	u8 vmon_loc;
	u8 vmon_frm;
	u8 vpmon_dpth;
	u8 vpmon_loc;
	u8 vpmon_frm;
	u8 vbstmon_dpth;
	u8 vbstmon_loc;
	u8 vbstmon_frm;
	u8 vpbrstat_dpth;
	u8 vpbrstat_loc;
	u8 vpbrstat_frm;
	u8 zerofill_dpth;
	u8 zerofill_loc;
	u8 zerofill_frm;
};

struct cs35l35_platform_data {

	/* Stereo (2 Device) */
	bool stereo;
	/* serial port drive strength */
	int sp_drv_str;
	/* serial port drive in unused slots */
	int sp_drv_unused;
	/* Boost Power Down with FET */
	bool bst_pdn_fet_on;
	/* Boost Voltage : used if ClassH Algo Enabled */
	int bst_vctl;
	/* Boost Converter Peak Current CTRL */
	int bst_ipk;
	/* Amp Gain Zero Cross */
	bool gain_zc;
	/* Audio Input Location */
	int aud_channel;
	/* Advisory Input Location */
	int adv_channel;
	/* Shared Boost for stereo */
	bool shared_bst;
	/* Specifies this amp is using an external boost supply */
	bool ext_bst;
	/* ClassH Algorithm */
	struct classh_cfg classh_algo;
	/* Monitor Config */
	struct monitor_cfg mon_cfg;
};

#endif /* __CS35L35_H */
+10 −0
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ config SND_SOC_ALL_CODECS
	select SND_SOC_CS35L32 if I2C
	select SND_SOC_CS35L33 if I2C
	select SND_SOC_CS35L34 if I2C
	select SND_SOC_CS35L35 if I2C
	select SND_SOC_CS42L42 if I2C
	select SND_SOC_CS42L51_I2C if I2C
	select SND_SOC_CS42L52 if I2C && INPUT
@@ -69,6 +70,7 @@ config SND_SOC_ALL_CODECS
	select SND_SOC_DA7219 if I2C
	select SND_SOC_DA732X if I2C
	select SND_SOC_DA9055 if I2C
	select SND_SOC_DIO2125
	select SND_SOC_DMIC
	select SND_SOC_ES8328_SPI if SPI_MASTER
	select SND_SOC_ES8328_I2C if I2C
@@ -410,6 +412,10 @@ config SND_SOC_CS35L34
	tristate "Cirrus Logic CS35L34 CODEC"
	depends on I2C

config SND_SOC_CS35L35
	tristate "Cirrus Logic CS35L35 CODEC"
	depends on I2C

config SND_SOC_CS42L42
	tristate "Cirrus Logic CS42L42 CODEC"
	depends on I2C
@@ -518,6 +524,10 @@ config SND_SOC_DA732X
config SND_SOC_DA9055
	tristate

config SND_SOC_DIO2125
	tristate "Dioo DIO2125 Amplifier"
	select GPIOLIB

config SND_SOC_DMIC
	tristate

+4 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ snd-soc-cq93vc-objs := cq93vc.o
snd-soc-cs35l32-objs := cs35l32.o
snd-soc-cs35l33-objs := cs35l33.o
snd-soc-cs35l34-objs := cs35l34.o
snd-soc-cs35l35-objs := cs35l35.o
snd-soc-cs42l42-objs := cs42l42.o
snd-soc-cs42l51-objs := cs42l51.o
snd-soc-cs42l51-i2c-objs := cs42l51-i2c.o
@@ -221,6 +222,7 @@ snd-soc-wm9712-objs := wm9712.o
snd-soc-wm9713-objs := wm9713.o
snd-soc-wm-hubs-objs := wm_hubs.o
# Amp
snd-soc-dio2125-objs := dio2125.o
snd-soc-max9877-objs := max9877.o
snd-soc-max98504-objs := max98504.o
snd-soc-tpa6130a2-objs := tpa6130a2.o
@@ -269,6 +271,7 @@ obj-$(CONFIG_SND_SOC_CQ0093VC) += snd-soc-cq93vc.o
obj-$(CONFIG_SND_SOC_CS35L32)	+= snd-soc-cs35l32.o
obj-$(CONFIG_SND_SOC_CS35L33)	+= snd-soc-cs35l33.o
obj-$(CONFIG_SND_SOC_CS35L34)	+= snd-soc-cs35l34.o
obj-$(CONFIG_SND_SOC_CS35L35)	+= snd-soc-cs35l35.o
obj-$(CONFIG_SND_SOC_CS42L42)	+= snd-soc-cs42l42.o
obj-$(CONFIG_SND_SOC_CS42L51)	+= snd-soc-cs42l51.o
obj-$(CONFIG_SND_SOC_CS42L51_I2C)	+= snd-soc-cs42l51-i2c.o
@@ -448,6 +451,7 @@ obj-$(CONFIG_SND_SOC_WM_ADSP) += snd-soc-wm-adsp.o
obj-$(CONFIG_SND_SOC_WM_HUBS)	+= snd-soc-wm-hubs.o

# Amp
obj-$(CONFIG_SND_SOC_DIO2125)	+= snd-soc-dio2125.o
obj-$(CONFIG_SND_SOC_MAX9877)	+= snd-soc-max9877.o
obj-$(CONFIG_SND_SOC_MAX98504)	+= snd-soc-max98504.o
obj-$(CONFIG_SND_SOC_TPA6130A2)	+= snd-soc-tpa6130a2.o
Loading