History log of /linux-master/sound/soc/codecs/max9877.c
Revision Date Author Comments
# 9abcd240 25-Apr-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

ASoC: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de
Link: https://lore.kernel.org/r/20230425095716.331419-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org


# fead49e3 05-Apr-2022 Stephen Kitt <steve@sk2.org>

ASoC: max9*: use simple i2c probe function

The i2c probe functions here don't use the id information provided in
their second argument, so the single-parameter i2c probe function
("probe_new") can be used instead.

This avoids scanning the identifier tables during probes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Link: https://lore.kernel.org/r/20220405165836.2165310-6-steve@sk2.org
Signed-off-by: Mark Brown <broonie@kernel.org>


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d6e3bb7a 02-Aug-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: max9877: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGE

DECLARE_TLV_DB_RANGE() has the advantage over using TLV_DB_RANGE_HEAD()
that it automatically calculates the number of items in the TLV and is
hence less prone to manual error.

Generate using the following coccinelle script

// <smpl>
@@
declarer name DECLARE_TLV_DB_RANGE;
identifier tlv;
constant x;
@@
-unsigned int tlv[] = {
- TLV_DB_RANGE_HEAD(x),
+DECLARE_TLV_DB_RANGE(tlv,
...
-};
+);
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 623436af 16-Jul-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: max9877: Convert to component

The driver does not use any CODEC specific constructs anymore. Convert it
to snd_soc_component.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# df2e2682 16-Jul-2015 Lars-Peter Clausen <lars@metafoo.de>

ASoC: max9877: Make driver global regmap struct local

Use a stack local variable to handle function local state rather than a
global static variable. The later has a potential for race conditions if
the probe function runs for two devices concurrently.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 1c07a4de 14-Jul-2015 Krzysztof Kozlowski <krzk@kernel.org>

ASoC: drivers: Drop owner assignment from i2c_driver

i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>


# c418a84a 05-Jul-2015 Axel Lin <axel.lin@ingics.com>

ASoC: Constify reg_default tables

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Peter Rosin <peda@axentia.se>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>


# 5cf9da8a 13-Aug-2013 Mark Brown <broonie@linaro.org>

ASoC: max9877: Add basic DAPM support

This does not fully map the power control available within the device
but it provides the hooks for routing signals through the device and
allows automatic management of the device low power mode.

Signed-off-by: Mark Brown <broonie@linaro.org>


# d76a9617 13-Aug-2013 Mark Brown <broonie@linaro.org>

ASoC: max9877: Convert to standard CODEC driver

Signed-off-by: Mark Brown <broonie@linaro.org>


# 997288e3 13-Aug-2013 Mark Brown <broonie@linaro.org>

ASoC: max9877: Convert to use regmap API

Signed-off-by: Mark Brown <broonie@linaro.org>


# 7a79e94e 07-Dec-2012 Bill Pemberton <wfp5p@virginia.edu>

ASoC: codecs: remove __dev* attributes

CONFIG_HOTPLUG is going away as an option. As result the __dev*
markings will be going away.

Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst,
and __devexit.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# a3627e9c 06-Aug-2012 Sachin Kamat <sachin.kamat@linaro.org>

ASoC: max9877: Use module_i2c_driver

module_i2c_driver makes the code simpler by eliminating module_init
and module_exit calls.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 022658be 03-Feb-2012 Liam Girdwood <lrg@ti.com>

ASoC: core: Add support for DAI and machine kcontrols.

Currently ASoC can only add kcontrols using codec and platform component device
handles. It's also desirable to add kcontrols for DAIs (i.e. McBSP) and for
SoC card machine drivers too. This allows the kcontrol to have a direct handle to
the parent ASoC component DAI/SoC Card/Platform/Codec device and hence easily
get it's private data.

This change makes snd_soc_add_controls() static and wraps it in the folowing
calls (card and dai are new) :-

snd_soc_add_card_controls()
snd_soc_add_codec_controls()
snd_soc_add_dai_controls()
snd_soc_add_platform_controls()

This patch also does a lot of small mechanical changes in individual codec drivers
to replace snd_soc_add_controls() with snd_soc_add_codec_controls().

It also updates the McBSP DAI driver to use snd_soc_add_dai_controls().

Finally, it updates the existing machine drivers that register controls to either :-

1) Use snd_soc_add_card_controls() where no direct codec control is required.
2) Use snd_soc_add_codec_controls() where there is direct codec control.

In the case of 1) above we also update the machine drivers to get the correct
component data pointers from the kcontrol (rather than getting the machine pointer
via the codec pointer).

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 5c4b2aa3 21-Nov-2011 Axel Lin <axel.lin@gmail.com>

ASoC: max9877: Update register if either val or val2 is changed

In the case of ((max9877_regs[reg] >> shift) & mask) != val
but ((max9877_regs[reg2] >> shift) & mask) == val2,
current code does not update the registers.

Fix the logic to update registers if either val or val2 is changed.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# a7569afa 23-Jul-2009 Joonyoung Shim <jy0922.shim@samsung.com>

ASoC: MAX9877: fix write operation for register

The MAX9877 needs an address of start register when we write values to
registers through i2c_master_send(), but the code for this was missed in
max9877_write_regs().

If the value of control is 0 in the max9877_set_out_mode(), the value is
not increased to 1, but actually the value to write to the register
should be 1.
And the register bits for out_mode and osc_mode should be cleared before
writing.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# e458a48f 21-Jul-2009 Joonyoung Shim <jy0922.shim@samsung.com>

ASoC: MAX9877: separate callback functions

The callback function to control register was used by whole controls in
MAX9877 driver, but this causes using many if statement for double
register control or invert.
So, the callback function for double register control is separate
differently, and the code for invert is added in the callback function.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>


# 9db9ed97 15-Jul-2009 Joonyoung Shim <jy0922.shim@samsung.com>

ASoC: MAX9877: add MAX9877 amp driver

The MAX9877 combines a high-efficiency Class D audio power amplifier
with a stereo Class AB capacitor-less DirectDrive headphone amplifier.

The max9877_add_controls() is called to register the MAX9877 specific
controls on machine specific init() of the machine driver.

The datasheet for the MAX9877 can find at the following url:
http://datasheets.maxim-ic.com/en/ds/MAX9877.pdf

[Slight edit to sort the ALL_CODECS entries -- broonie.]

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>