[linux-sunxi] Re: [PATCH v4 1/3] regulator: Add of_regulator_bulk_get_all

2022-11-18 Thread Mark Brown
On Tue, Nov 15, 2022 at 07:36:01AM +, Corentin Labbe wrote:
> It work exactly like regulator_bulk_get() but instead of working on a
> provided list of names, it seek all consumers properties matching
> xxx-supply.

The following changes since commit 9abf2313adc1ca1b6180c508c25f22f9395cc780:

  Linux 6.1-rc1 (2022-10-16 15:36:24 -0700)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 
tags/of_regulator_bulk_get_all

for you to fetch changes up to 27b9ecc7a9ba1d0014779bfe5a6dbf630899c6e7:

  regulator: Add of_regulator_bulk_get_all (2022-11-18 15:13:34 +)


regulator: Add of_regulator_bulk_get_all()

This adds a new of_regulator_bulk_get_all() which grab all supplies
properties in a DT node, for use in implementing generic handling
for things like MDIO PHYs where the physical standardisation of
the bus does not extend to power supplies.


Corentin Labbe (1):
  regulator: Add of_regulator_bulk_get_all

 drivers/regulator/of_regulator.c   | 92 ++
 include/linux/regulator/consumer.h |  8 
 2 files changed, 100 insertions(+)

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/Y3evbTL4P72xwYWS%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: (subset) [PATCH v4 0/3] arm64: add ethernet to orange pi 3

2022-11-18 Thread Mark Brown
On Tue, 15 Nov 2022 07:36:00 +, Corentin Labbe wrote:
> 2 sunxi board still does not have ethernet working, orangepi 1+ and
> orangepi 3.
> This is due to the fact thoses boards have a PHY which need 2 regulators.
> 
> A first attempt by Ondřej Jirman was made to support them was made by adding 
> support in
> stmmac driver:
> https://lore.kernel.org/lkml/20190820145343.29108-6-meg...@megous.com/
> Proposal rejected, since regulators need to be handled by the PHY core.
> 
> [...]

Applied to

   broonie/regulator.git for-next

Thanks!

[1/3] regulator: Add of_regulator_bulk_get_all
  commit: 27b9ecc7a9ba1d0014779bfe5a6dbf630899c6e7

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/166878791907.1056942.1081365322638542611.b4-ty%40kernel.org.


[linux-sunxi] Re: [PATCH v4 1/3] regulator: Add of_regulator_bulk_get_all

2022-11-15 Thread Mark Brown
On Tue, Nov 15, 2022 at 10:42:50AM +, Russell King (Oracle) wrote:
> On Tue, Nov 15, 2022 at 10:34:41AM +0000, Mark Brown wrote:

> > Well, it's not making this maintainer happy :/  If we know what
> > PHY is there why not just look up the set of supplies based on
> > the compatible of the PHY?

> It looks to me like this series fetches the regulators before the PHY
> is bound to the driver, so what you're proposing would mean that the
> core PHY code would need a table of all compatibles (which is pretty
> hard to do, they encode the vendor/device ID, not some descriptive
> name) and then a list of the regulator names. IMHO that doesn't scale.

Oh, PHYs have interesting enough drivers to dynamically load
here? The last time I was looking at MDIO stuff it was all
running from generic class devices but that was quite a while
ago.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/Y3N1JYVx9tB9pisR%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v4 1/3] regulator: Add of_regulator_bulk_get_all

2022-11-15 Thread Mark Brown
On Tue, Nov 15, 2022 at 11:18:50AM +0100, Corentin LABBE wrote:
> Le Tue, Nov 15, 2022 at 10:03:14AM +0000, Mark Brown a écrit :

> > What's the use case - why would a device not know which supplies
> > it requires?  This just looks like an invitation to badly written
> > consumers TBH.

> The device know which supply it have, but I found only this way to made all 
> maintainers happy.
> See 
> https://lore.kernel.org/netdev/0518eef1-75a6-fbfe-96d8-bb1fc4e51...@linaro.org/t/#m7a2e012f4c7c7058478811929774ab2af9bfcbf6

Well, it's not making this maintainer happy :/  If we know what
PHY is there why not just look up the set of supplies based on
the compatible of the PHY?

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/Y3NrQffcdGIjS64a%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v4 1/3] regulator: Add of_regulator_bulk_get_all

2022-11-15 Thread Mark Brown
On Tue, Nov 15, 2022 at 07:36:01AM +, Corentin Labbe wrote:

> It work exactly like regulator_bulk_get() but instead of working on a
> provided list of names, it seek all consumers properties matching
> xxx-supply.

What's the use case - why would a device not know which supplies
it requires?  This just looks like an invitation to badly written
consumers TBH.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/Y3Nj4pA2%2BWRFvSNd%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: (subset) [PATCH v2 00/52] ARM: dts: Last round of DT schema fixes

2021-09-13 Thread Mark Brown
On Wed, 1 Sep 2021 11:18:00 +0200, Maxime Ripard wrote:
> Here's another round of schema warnings fixes for the Allwinner platform.
> 
> There's a fair share of new schemas in there since the schema tools now warn
> when a compatible is not documented in a schema.
> 
> We don't have any warning anymore if we use the OPP binding Rob submitted, and
> since that means we have all our devices properly validated I don't expect 
> more
> fixes now, aside from the usual bunch of regressions.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[01/52] ASoC: dt-bindings: Add WM8978 Binding
commit: 5bd5699c494f42a3c23e377bb35be5d716b85012
[02/52] ASoC: dt-bindings: Convert Bluetooth SCO Link binding to a schema
commit: 6ef239699102580b104bfca11d9b94abfbc8caec
[03/52] ASoC: dt-bindings: Convert SPDIF Transmitter binding to a schema
commit: 1c02b74ba20838ba194850beb0adfc6b5e11bb2a
[04/52] ASoC: dt-bindings: Convert Simple Amplifier binding to a schema
commit: 50a41ce8c56d07f42a97112077acbaeda8b86ed9

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/163152996583.45703.2271458065369838682.b4-ty%40kernel.org.


[linux-sunxi] Re: [PATCH v2 01/52] ASoC: dt-bindings: Add WM8978 Binding

2021-09-03 Thread Mark Brown
On Fri, Sep 03, 2021 at 12:37:06PM +0200, Maxime Ripard wrote:
> On Wed, Sep 01, 2021 at 03:39:50PM +0100, Mark Brown wrote:

> > What's the story with dependencies here?  I don't have a cover letter or
> > anything and there seem to be a bunch of tangentially related patches in
> > a series here.

> There's no dependency, you can pick the ASoC patches safely

Oh, OK.  In cases like this it's generally better to not combine random
unrelated stuff into one series - as well as making it look like there
are dependencies it can also cause problems for tooling (eg, b4 is going
to want to fetch the whole series and my personal tooling doesn't like
the same series going to more than one of the subsystems I maintain.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210903113611.GG4932%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v2 01/52] ASoC: dt-bindings: Add WM8978 Binding

2021-09-01 Thread Mark Brown
On Wed, Sep 01, 2021 at 11:18:01AM +0200, Maxime Ripard wrote:
> Even though we had the wm8978 driver for some time and a number of
> boards using it already, we never had a binding for it. Let's add it
> based on what the driver expects and the boards are providing.

What's the story with dependencies here?  I don't have a cover letter or
anything and there seem to be a bunch of tangentially related patches in
a series here.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210901143950.GE5976%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH 01/54] ASoC: dt-bindings: Add WM8978 Binding

2021-07-27 Thread Mark Brown
On Tue, Jul 27, 2021 at 01:21:52PM +0100, Richard Fitzgerald wrote:
> On 26/07/2021 01:17, Mark Brown wrote:
> > On Fri, Jul 23, 2021 at 03:32:51PM -0600, Rob Herring wrote:
> > > On Wed, Jul 21, 2021 at 04:03:31PM +0200, Maxime Ripard wrote:

> > > > Even though we had the wm8978 driver for some time and a number of
> > > > boards using it already, we never had a binding for it. Let's add it
> > > > based on what the driver expects and the boards are providing.

> > > > +maintainers:
> > > > +  - Mark Brown 

> > > No one from Wolfson cares about this device?

> > > Otherwise,

> > > Reviewed-by: Rob Herring 

> > Well, Wolfson no longer exists since it was bought by Cirrus but copying
> > in the Cirrus people to see if they want to be listed there.

> People, ownership, and email addresses can change. It's always best to
> check MAINTAINERS to see the current support status. In this case it has
> a section to pick up those Wolfson drivers, with the correct email
> address. The list email will be monitored by multiple people.
> 
> WOLFSON MICROELECTRONICS DRIVERS
> L:patc...@opensource.cirrus.com
> S:Supported
> 
> F:include/sound/wm.h
> 
> F:sound/soc/codecs/wm*

Might be worth updating that to cover the DT bindings too (Arizona is
the only sound driver for some reason, wm8974 already exists but is not
covered).

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210727125837.GS4670%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH 01/54] ASoC: dt-bindings: Add WM8978 Binding

2021-07-25 Thread Mark Brown
On Fri, Jul 23, 2021 at 03:32:51PM -0600, Rob Herring wrote:
> On Wed, Jul 21, 2021 at 04:03:31PM +0200, Maxime Ripard wrote:

> > Even though we had the wm8978 driver for some time and a number of
> > boards using it already, we never had a binding for it. Let's add it
> > based on what the driver expects and the boards are providing.

> > +maintainers:
> > +  - Mark Brown 

> No one from Wolfson cares about this device?

> Otherwise,

> Reviewed-by: Rob Herring 

Well, Wolfson no longer exists since it was bought by Cirrus but copying
in the Cirrus people to see if they want to be listed there.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210726001713.GA8831%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v5 05/20] Input: axp20x-pek: Bail out if AXP has no interrupt line connected

2021-01-28 Thread Mark Brown
On Thu, Jan 28, 2021 at 12:31:36PM +, Andre Przywara wrote:
> Mark Brown  wrote:

> > It sounds like you're trying to register an IRQ chip with a somehow
> > bogus configuration?

> I patched the AXP MFD driver [1] to skip the regmap-irq creation when no
> interrupts DT property was found, but this NULL pointer now
> understandably confuses the -pek driver, and leads to this crash:

> http://lists.infradead.org/pipermail/linux-arm-kernel/2021-January/634969.html

> Hence I wanted to plug this hole, which seems useful regardless of this
> particular issue.

The driver code here looks pretty confused.  It appears to be looking up
the interrupt to use from a resource (which is what I'd expect for a MFD
child) then for reasons I can't fathom trying to pass that resource into
regmap_irq_get_virq() which is at best going to just return the value
that was passed in but may potentially end up just returning a random
interrupt other than the one that was asked for since we're passing in a
global interrupt number rather than a controller relative one.  I really
can't tell what's supposed to be going on there.  A driver should either
use resources or it should use regmap_irq_get_virq(), using both is a
bug.

The MFD for this device is also just plain buggy in that it is providing
IRQ resources to the children when there is in fact no support for the
interrupts on the device in the system.  This means that the MFD core
sees that it has no interrupt domain, assumes that those interrupt
resources are in fact absolute interrupt numbers and passes them
straight through to the children.  This means that the children will
just be requesting random interrupts in the system which may actually
exist and be requestable which probably isn't going to end well.  When
there is no interrupt controller the parent should not be trying to
supply interrupt resources to the children at all.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210128150555.GD4537%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v5 05/20] Input: axp20x-pek: Bail out if AXP has no interrupt line connected

2021-01-28 Thread Mark Brown
On Thu, Jan 28, 2021 at 11:11:28AM +, Andre Przywara wrote:
> Dmitry Torokhov  wrote:
> > On Wed, Jan 27, 2021 at 05:24:45PM +, Andre Przywara wrote:

> > > Check for the regmap_irqc member to be not NULL before proceeding with
> > > probe. This gets normally filled by the call to regmap_add_irq_chip(),
> > > which we allow to skip now, when the DT node lacks an interrupt
> > > property.  

It sounds like you're trying to register an IRQ chip with a somehow
bogus configuration?

> > No, the driver is not the right place to patch this; regmap should be
> > fixed so it does not crash instead.

> I am not sure this is the right approach, those regmap functions look
> more like an internal interface to me, with lots of wrapper functions
> happily dereferencing pointers and reaching into structs. Moving
> NULL checks into those does not sound like the right thing. CC:ing Mark
> for more opinions on this.

Without having seen the actual issue if you're trying to register an
interrupt controller with a known broken hardware configuration that
does seem like something the caller just shouldn't be doing, it's not
something that's going to transiently happen at runtime and we're very
much trusting that the caller got things right.

> A more general solution would be to not instantiate this driver here
> at all, when we don't have an interrupt line.
> However at the moment the AXP MFD driver uses a const struct to hold
> all MFD cells, so there is no easy way of omitting the power key
> device dynamically. And even then it would hard code the requirement
> for an interrupt into the MFD driver, when this could be considered an
> implementation detail of the axp20x-pek driver.

Another approach is to just register the optional device separately.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210128113601.GA4537%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: (subset) [PATCH v4 00/21] arm64: sunxi: Initial Allwinner H616 SoC support

2021-01-27 Thread Mark Brown
On Mon, 25 Jan 2021 15:17:50 +, Andre Przywara wrote:
> an update from the v3 last week, to add support for the Allwinner H616
> SoC. Still based on the (updated) sunxi/for-next branch.
> I am omitting the MMC and pinctrl patches now, as they have been taken
> by Ulf and LinusW already into their trees.
> 
> I addressed the comments from the list, though not sure if the HOSC clock
> coming from the RTC is really a good idea (didn't change it).
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[13/21] dt-bindings: spi: sunxi: Add H616 compatible string
commit: 6589daf8bb98c75ad1065edad87c099ffb9f5d87

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/161176773014.34911.3613594986317961710.b4-ty%40kernel.org.


[linux-sunxi] Re: [PATCH v3 18/21] dt-bindings: allwinner: Add H616 compatible strings

2021-01-18 Thread Mark Brown
On Mon, Jan 18, 2021 at 02:08:45AM +, Andre Przywara wrote:
> Add simple "allwinner,sun50i-h616-xxx" compatible names to existing
> bindings, and pair them with an existing fallback compatible string,
> as the devices are compatible.
> This covers I2C, infrared, RTC and SPI.
> 
> Use enums to group all compatible devices together.

Please submit normal, per subsystem patches for things like this.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20210118120558.GD4455%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v10 14/15] dt-bindings: sound: sun4i-i2s: Document H3 with missing RX channel possibility

2020-10-30 Thread Mark Brown
On Fri, Oct 30, 2020 at 08:05:31PM +0100, Clément Péron wrote:

> But basically for the next dt-bindings change you will prefer somethings like:
> "ASoC: dt-bindings: sun4i-i2s: Document H3 with missing RX channel 
> possibility"

Yes.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20201030195127.GM4405%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v10 00/15] Add Allwinner H3/H5/H6/A64 HDMI audio

2020-10-30 Thread Mark Brown
On Fri, 30 Oct 2020 15:46:33 +0100, Clément Péron wrote:
> This series add H6 I2S support and the I2S node missing to support
> HDMI audio in different Allwinner SoC.
> 
> As we first use some TDM property to make the I2S working with the
> simple soundcard. We have now drop this simple sound card and a
> proper dedicated soundcard will be introduce later.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[01/11] ASoC: sun4i-i2s: Fix lrck_period computation for I2S justified mode
commit: 93c0210671d8f3ec2262da703fab93a1497158a8
[02/11] ASoC: sun4i-i2s: Change set_chan_cfg() params
commit: c779e2de0ac6156bea63e759481ee383587336cc
[03/11] ASoC: sun4i-i2s: Add support for H6 I2S
commit: 73adf87b7a5882408b0a17da59e69df4be12a968
[04/11] ASoC: sun4i-i2s: Change get_sr() and get_wss() to be more explicit
commit: 9c2d255f0e63f8e54bd8345f9c59c4060cf4bbd4
[05/11] ASoC: sun4i-i2s: Set sign extend sample
commit: d8659dd9a13ce7a92c017c352aea1c390f300937
[06/11] ASoC: sun4i-i2s: Add 20 and 24 bit support
commit: 6ad7ca6297f8679162ee62ed672b603e8d004146
[07/11] ASoC: sun4i-i2s: Fix sun8i volatile regs
commit: 64359246abe4421ad409be5b0bc9a534caa18b7d
[08/11] ASoC: sun4i-i2s: Fix setting of FIFO modes
commit: 38d7adc0a003298013786cfffe5f4cc907009d30
[09/11] ASoC: sun4i-i2s: fix coding-style for callback definition
commit: 08c7b7d546fddce76d500e5e5767aa08836f7cae
[10/11] ASoC: sun4i-i2s: Add H6 compatible
commit: e84f44ba4604e55a51e7caf01464f220d0eabef4
[11/11] ASoC: sun4i-i2s: Document H3 with missing RX channel possibility
commit: 0bc1bf241de551842535c3d0b080e0f38c11aed1

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/160408688151.11950.1284919768798155829.b4-ty%40kernel.org.


[linux-sunxi] Re: [PATCH v10 14/15] dt-bindings: sound: sun4i-i2s: Document H3 with missing RX channel possibility

2020-10-30 Thread Mark Brown
On Fri, Oct 30, 2020 at 03:46:47PM +0100, Clément Péron wrote:
> Like A83T the Allwinner H3 doesn't have the DMA reception available for
> some audio interfaces.

Please if you're going to mix dts updates in with subsystem changes like
this keep the bits for different subsystems grouped, this makes it much
easier to handle things.

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20201030181935.GJ4405%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH] regulator: axp20x: fix LDO2/4 description

2020-09-23 Thread Mark Brown
On Wed, 23 Sep 2020 08:51:42 +0800, Icenowy Zheng wrote:
> Currently we wrongly set the mask of value of LDO2/4 both to the mask of
> LDO2, and the LDO4 voltage configuration is left untouched. This leads
> to conflict when LDO2/4 are both in use.
> 
> Fix this issue by setting different vsel_mask to both regulators.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 
for-next

Thanks!

[1/1] regulator: axp20x: fix LDO2/4 description
  commit: fbb5a79d2fe7b01c6424fbbc04368373b1672d61

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/160088763759.36155.1482459215779599768.b4-ty%40kernel.org.


[linux-sunxi] Re: [PATCH v4 09/22] arm64: dts: allwinner: h6: Add HDMI audio node

2020-09-21 Thread Mark Brown
On Mon, Sep 21, 2020 at 12:27:18PM +0200, Clément Péron wrote:
> From: Jernej Skrabec 
> 
> Add a simple-soundcard to link audio between HDMI and I2S.

It makes life a lot easier if you batch all the DTS changes together
rather than randomly mixing them in with code changes, it both makes
it clearer what's going on and makes things easier to handle.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200921182924.GG4792%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v4 02/22] ASoC: sun4i-i2s: Change set_chan_cfg() params

2020-09-21 Thread Mark Brown
On Mon, Sep 21, 2020 at 07:15:13PM +0200, Clément Péron wrote:
> On Mon, 21 Sep 2020 at 14:29, Maxime Ripard  wrote:

> > Also, Fixes tag?

> I think this only happens when 20/24bit is enabled so the issue has been
> introduced in this series.

For a situation like that a note in the changelog about "in preparation
for adding X support which will make this matter" helps.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200921182309.GF4792%40sirena.org.uk.


signature.asc
Description: PGP signature


Re: [linux-sunxi] [PATCH 05/16] ASoc: sun4i-i2s: Add 20 and 24 bit support

2020-09-04 Thread Mark Brown
On Fri, Sep 04, 2020 at 04:16:49PM +, Charles Keepax wrote:

> My understanding is physical_width refers to the in memory
> representation, but shouldn't be used to control the slot width
> on the bus. If not specified otherwise (say through the set_tdm
> callback), and if the appropriate BCLK is supported, then the slot
> should be just large enough to hold the data.

Indeed.  The framework isn't great here in tying the memory and wire
formats together, ideally there would be more support for them being
unrelated without DPCM.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200904162355.GA49830%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH] spi: sun4i: update max transfer size reported

2020-07-27 Thread Mark Brown
On Mon, 27 Jul 2020 17:23:28 +1000, Jonathan Liu wrote:
> The spi-sun4i driver already has the ability to do large transfers.
> However, the max transfer size reported is still fifo depth - 1.
> 
> Update the max transfer size reported to the max value possible.

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: sun4i: update max transfer size reported
  commit: 241b888791ee2fa47b97b3b9dc0e857d241db18d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/159585821344.22560.5654112245536281167.b4-ty%40kernel.org.


Re: [linux-sunxi] Re: Audio sound card name [was [PATCH 4/7] arm64: dts: allwinner: a64: Add HDMI audio]

2020-04-29 Thread Mark Brown
On Wed, Apr 29, 2020 at 11:43:06AM +0100, Robin Murphy wrote:
> On 2020-04-29 9:17 am, Maxime Ripard wrote:
> > On Wed, Apr 29, 2020 at 02:24:00PM +0800, Chen-Yu Tsai wrote:

Please delete unneeded context from mails when replying.  Doing this
makes it much easier to find your reply in the message, helping ensure
it won't be missed by people scrolling through the irrelevant quoted
material.

> > If we also end up with "HDMI" as our card name, then the userspace has no 
> > way to
> > tell anymore if it's running from an rk3328 or an allwinner SoC, or 
> > something
> > else entirely. And therefore it cannot really configure anything to work 
> > out of
> > the box anymore.

> OK, you're a userspace audio application - enlighten me as to what exact
> chip you're running on here, and why you need to know:

> card 0: HDMI [HDA ATI HDMI]

> or how about here?

> card 0: Intel [HDA Intel]

In the case of HDMI for embedded platforms since there is generally no
control in the audio path it is unlikely to make a *huge* difference,
though if there are expansion buses or multiple HDMI ports it can be
useful to help people identify which particular HDMI port it is.  For
other cards the names are part of userspace working out which config
file to apply to the card so deduplication can help, and also the
plastics tend to matter.

> With simple-audio-card we're talking about trivial interfaces that often
> don't expose any controls at all, so there's unlikely to be much
> 'configuration' for userspace to do beyond choosing which card to output to.

This is a reasonable assumption for HDMI but it is not at all a
reasonable assumption for simple-audio-card in general - just because
the links between the SoC and the external components are simple that
doesn't mean that any of those components are simple, and even if the
hardware is simple that does not mean that configuration is unimportant
- the difference between full scale output and appropriate headphone
volumes is for example *extremely* important.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200429120511.GG4201%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: Audio sound card name [was [PATCH 4/7] arm64: dts: allwinner: a64: Add HDMI audio]

2020-04-28 Thread Mark Brown
On Tue, Apr 28, 2020 at 06:49:10PM +0200, Clément Péron wrote:

> I have a question regarding the simple-audio-card,name.
> In this patch, I would like to introduce a simple-audio-card for the
> Allwinner A64 HDMI.

> What should be the preferred name for this sound card?
> "sun50i-a64-hdmi" ? "allwinner, sun50i-a64-hdmi" ?

The former is more idiomatic for ALSA.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200428165745.GM5677%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v2 2/2] drm: sun4i: hdmi: Add support for sun4i HDMI encoder audio

2020-01-21 Thread Mark Brown
On Tue, Jan 21, 2020 at 07:29:37PM +0100, Maxime Ripard wrote:

> > Mark, our issue here is that we have a driver tied to a device that is
> > an HDMI encoder. Obviously, we'll want to register into DRM, which is
> > what we were doing so far, with the usual case where at remove /
> > unbind time, in order to free the resources, we just retrieve our
> > pointer to our private structure using the device's drvdata.

> > Now, snd_soc_register_card also sets that pointer to the card we try
> > to register, which is problematic. It seems that it's used to handle
> > suspend / resume automatically, which in this case would be also not
> > really fit for us (or rather, we would need to do more that just
> > suspend the audio part).

There's a drvdata field in the snd_soc_card for cases like this - would
that work for you?

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20200121183247.GL4656%40sirena.org.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH] ASoC: sun4i-i2s: incorrect regmap for A83t

2019-08-30 Thread Mark Brown
On Wed, Aug 21, 2019 at 06:23:20PM +0200, codekip...@gmail.com wrote:
> From: Marcus Cooper 
> 
> Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
> Signed-off-by: Marcus Cooper 
> ---

This doesn't apply against current code, please check and resend.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20190830114457.GB5182%40sirena.co.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v5 03/15] ASoC: sun4i-i2s: Correct divider calculations

2019-08-14 Thread Mark Brown
On Wed, Aug 14, 2019 at 08:08:42AM +0200, codekip...@gmail.com wrote:

> + if (i2s->variant->has_fmt_set_lrck_period)
> + bclk_div = sun4i_i2s_get_bclk_div(i2s, clk_rate / rate,
> +   word_size,
> +   sun8i_i2s_clk_div,
> +   
> ARRAY_SIZE(sun8i_i2s_clk_div));
> + else
> + bclk_div = sun4i_i2s_get_bclk_div(i2s, oversample_rate,
> +   word_size,
> +   sun4i_i2s_bclk_div,
> +   
> ARRAY_SIZE(sun4i_i2s_bclk_div));

Are we sure there'll never be any new variants which would make a switch
statement for the variant work better?

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20190814093117.GE4640%40sirena.co.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v5 02/15] ASoC: sun4i-i2s: Add set_tdm_slot functionality

2019-08-14 Thread Mark Brown
On Wed, Aug 14, 2019 at 08:08:41AM +0200, codekip...@gmail.com wrote:
> From: Marcus Cooper 
> 
> Codecs without a control connection such as i2s based HDMI audio and
> the Pine64 DAC require a different amount of bit clocks per frame than

This isn't a universal property of CODECs without a control, and it's
something that CODECs with control can require too.

>   return sun4i_i2s_set_clk_rate(dai, params_rate(params),
> -   params_width(params));
> +   i2s->tdm_slots ?
> +   i2s->slot_width : params_width(params));

Please write normal conditional statements unless there's a strong
reason to do otherwise, it makes things more legible.

> +static int sun4i_i2s_set_dai_tdm_slot(struct snd_soc_dai *dai,
> +   unsigned int tx_mask,
> +   unsigned int rx_mask,
> +   int slots, int width)
> +{
> + struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai);
> +
> + i2s->tdm_slots = slots;
> +
> + i2s->slot_width = width;
> +
> + return 0;
> +}

No validation of the parameters here?

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20190814093011.GD4640%40sirena.co.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v4 0/7] Allwinner H6 SPDIF support

2019-08-12 Thread Mark Brown
On Sat, Aug 10, 2019 at 10:45:23AM +0200, Clément Péron wrote:

> Hi,

Please don't top post, reply in line with needed context.  This allows
readers to readily follow the flow of conversation and understand what
you are talking about and also helps ensure that everything in the
discussion is being addressed.

> Sorry, I just discovered that the ASoC patches have been merged into
> the broonie and linus tree in 5.3.

> I'm still quite new in the sending of patches to the Kernel but
> souldn't be a ack or a mail sent to warn the sender when the series
> are accepted?

Not every maintainer will send those, I do but you might find they've
gone into your spam folder if you're using gmail.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20190812110103.GD4592%40sirena.co.uk.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "regulator: axp20x: fix DCDC5 and DCDC6 for AXP803" to the regulator tree

2019-07-16 Thread Mark Brown
The patch

   regulator: axp20x: fix DCDC5 and DCDC6 for AXP803

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 8f46e22b5ac692b48d04bb722547ca17b66dda02 Mon Sep 17 00:00:00 2001
From: Jernej Skrabec 
Date: Sat, 13 Jul 2019 11:07:17 +0200
Subject: [PATCH] regulator: axp20x: fix DCDC5 and DCDC6 for AXP803

Refactoring of axp20x driver introduced a bug in AXP803's DCDC6
regulator definition. AXP803_DCDC6_1120mV_STEPS was obtained by
subtracting 0x47 and 0x33. This should be 0x14 (hex) and not 14
(dec).

Refactoring also carried over a bug in DCDC5 regulator definition.
Number of possible voltages must be for 1 bigger than maximum valid
voltage index, because 0 is also valid and it means lowest voltage.

Fixes: 1dbe0ccb0631 ("regulator: axp20x-regulator: add support for AXP803")
Fixes: db4a555f7c4c ("regulator: axp20x: use defines for masks")
Signed-off-by: Jernej Skrabec 
Link: https://lore.kernel.org/r/20190713090717.347-3-jernej.skra...@siol.net
Signed-off-by: Mark Brown 
---
 drivers/regulator/axp20x-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c 
b/drivers/regulator/axp20x-regulator.c
index c951568994a1..989506bd90b1 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -174,14 +174,14 @@
 #define AXP803_DCDC5_1140mV_STEPS  35
 #define AXP803_DCDC5_1140mV_END\
(AXP803_DCDC5_1140mV_START + AXP803_DCDC5_1140mV_STEPS)
-#define AXP803_DCDC5_NUM_VOLTAGES  68
+#define AXP803_DCDC5_NUM_VOLTAGES  69
 
 #define AXP803_DCDC6_600mV_START   0x00
 #define AXP803_DCDC6_600mV_STEPS   50
 #define AXP803_DCDC6_600mV_END \
(AXP803_DCDC6_600mV_START + AXP803_DCDC6_600mV_STEPS)
 #define AXP803_DCDC6_1120mV_START  0x33
-#define AXP803_DCDC6_1120mV_STEPS  14
+#define AXP803_DCDC6_1120mV_STEPS  20
 #define AXP803_DCDC6_1120mV_END\
(AXP803_DCDC6_1120mV_START + AXP803_DCDC6_1120mV_STEPS)
 #define AXP803_DCDC6_NUM_VOLTAGES  72
-- 
2.20.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20190716181813.80E062742BD2%40ypsilon.sirena.org.uk.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "regulator: axp20x: fix DCDCA and DCDCD for AXP806" to the regulator tree

2019-07-16 Thread Mark Brown
The patch

   regulator: axp20x: fix DCDCA and DCDCD for AXP806

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-5.3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 1ef55fed9219963359a7b3bc7edca8517c6e45ac Mon Sep 17 00:00:00 2001
From: Jernej Skrabec 
Date: Sat, 13 Jul 2019 11:07:16 +0200
Subject: [PATCH] regulator: axp20x: fix DCDCA and DCDCD for AXP806

Refactoring of the driver introduced bugs in AXP806's DCDCA and DCDCD
regulator definitions.

In DCDCA case, AXP806_DCDCA_1120mV_STEPS was obtained by subtracting
0x47 and 0x33. This should be 0x14 (hex) and not 14 (dec).

In DCDCD case, axp806_dcdcd_ranges[] contains two ranges with same
start and end macros, which is clearly wrong. Second range starts at
1.6V so it should use AXP806_DCDCD_1600mV_[START|END] macros. They are
already defined but unused.

Fixes: db4a555f7c4c ("regulator: axp20x: use defines for masks")
Signed-off-by: Jernej Skrabec 
Link: https://lore.kernel.org/r/20190713090717.347-2-jernej.skra...@siol.net
Signed-off-by: Mark Brown 
---
 drivers/regulator/axp20x-regulator.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c 
b/drivers/regulator/axp20x-regulator.c
index 152053361862..c951568994a1 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -240,7 +240,7 @@
 #define AXP806_DCDCA_600mV_END \
(AXP806_DCDCA_600mV_START + AXP806_DCDCA_600mV_STEPS)
 #define AXP806_DCDCA_1120mV_START  0x33
-#define AXP806_DCDCA_1120mV_STEPS  14
+#define AXP806_DCDCA_1120mV_STEPS  20
 #define AXP806_DCDCA_1120mV_END\
(AXP806_DCDCA_1120mV_START + AXP806_DCDCA_1120mV_STEPS)
 #define AXP806_DCDCA_NUM_VOLTAGES  72
@@ -774,8 +774,8 @@ static const struct regulator_linear_range 
axp806_dcdcd_ranges[] = {
   AXP806_DCDCD_600mV_END,
   2),
REGULATOR_LINEAR_RANGE(160,
-  AXP806_DCDCD_600mV_START,
-  AXP806_DCDCD_600mV_END,
+  AXP806_DCDCD_1600mV_START,
+  AXP806_DCDCD_1600mV_END,
   10),
 };
 
-- 
2.20.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20190716181813.B1E0E2742BD4%40ypsilon.sirena.org.uk.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v4 0/7] Allwinner H6 SPDIF support

2019-07-15 Thread Mark Brown
On Mon, Jul 15, 2019 at 09:21:01PM +0200, Clément Péron wrote:
> Hi,
> 
> I'm missing ACK from ASoC Maintainers patch 2-3-4.
> 
> It's really small paches, if you could have a look at it.

Please don't send content free pings and please allow a reasonable time
for review.  People get busy, go on holiday, attend conferences and so 
on so unless there is some reason for urgency (like critical bug fixes)
please allow at least a couple of weeks for review.  If there have been
review comments then people may be waiting for those to be addressed.

Sending content free pings adds to the mail volume (if they are seen at
all) which is often the problem and since they can't be reviewed
directly if something has gone wrong you'll have to resend the patches
anyway, so sending again is generally a better approach though there are
some other maintainers who like them - if in doubt look at how patches
for the subsystem are normally handled.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20190715193842.GC4503%40sirena.org.uk.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "ASoC: sun4i-i2s: Fix sun8i tx channel offset mask" to the asoc tree

2019-06-05 Thread Mark Brown
The patch

   ASoC: sun4i-i2s: Fix sun8i tx channel offset mask

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 7e46169a5f35762f335898a75d1b8a242f2ae0f5 Mon Sep 17 00:00:00 2001
From: Marcus Cooper 
Date: Mon, 3 Jun 2019 19:47:27 +0200
Subject: [PATCH] ASoC: sun4i-i2s: Fix sun8i tx channel offset mask

Although not causing any noticeable issues, the mask for the
channel offset is covering too many bits.

Signed-off-by: Marcus Cooper 
Acked-by: Maxime Ripard 
Acked-by: Chen-Yu Tsai 
Signed-off-by: Mark Brown 
---
 sound/soc/sunxi/sun4i-i2s.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index d5ec1a20499d..8162e107e50b 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -110,7 +110,7 @@
 
 #define SUN8I_I2S_TX_CHAN_MAP_REG  0x44
 #define SUN8I_I2S_TX_CHAN_SEL_REG  0x34
-#define SUN8I_I2S_TX_CHAN_OFFSET_MASK  GENMASK(13, 11)
+#define SUN8I_I2S_TX_CHAN_OFFSET_MASK  GENMASK(13, 12)
 #define SUN8I_I2S_TX_CHAN_OFFSET(offset)   (offset << 12)
 #define SUN8I_I2S_TX_CHAN_EN_MASK  GENMASK(11, 4)
 #define SUN8I_I2S_TX_CHAN_EN(num_chan) (((1 << num_chan) - 1) << 4)
-- 
2.20.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20190604145857.84383440049%40finisterre.sirena.org.uk.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sun4i-i2s: Add offset to RX channel select" to the asoc tree

2019-06-05 Thread Mark Brown
The patch

   ASoC: sun4i-i2s: Add offset to RX channel select

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From f9927000cb35f250051f0f1878db12ee2626eea1 Mon Sep 17 00:00:00 2001
From: Marcus Cooper 
Date: Mon, 3 Jun 2019 19:47:28 +0200
Subject: [PATCH] ASoC: sun4i-i2s: Add offset to RX channel select

Whilst testing the capture functionality of the i2s on the newer
SoCs it was noticed that the recording was somewhat distorted.
This was due to the offset not being set correctly on the receiver
side.

Signed-off-by: Marcus Cooper 
Acked-by: Maxime Ripard 
Acked-by: Chen-Yu Tsai 
Signed-off-by: Mark Brown 
---
 sound/soc/sunxi/sun4i-i2s.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index 8162e107e50b..bc128e2a6096 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -460,6 +460,10 @@ static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, 
unsigned int fmt)
regmap_update_bits(i2s->regmap, SUN8I_I2S_TX_CHAN_SEL_REG,
   SUN8I_I2S_TX_CHAN_OFFSET_MASK,
   SUN8I_I2S_TX_CHAN_OFFSET(offset));
+
+   regmap_update_bits(i2s->regmap, SUN8I_I2S_RX_CHAN_SEL_REG,
+  SUN8I_I2S_TX_CHAN_OFFSET_MASK,
+  SUN8I_I2S_TX_CHAN_OFFSET(offset));
}
 
regmap_field_write(i2s->field_fmt_mode, val);
-- 
2.20.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/20190604145856.F07A6440046%40finisterre.sirena.org.uk.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sunxi: sun50i-codec-analog: Rename hpvcc regulator supply to cpvdd" to the asoc tree

2019-02-23 Thread Mark Brown
The patch

   ASoC: sunxi: sun50i-codec-analog: Rename hpvcc regulator supply to cpvdd

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 5fd812e6f5ae0376134234ceb70e8de541ccb10d Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai 
Date: Wed, 13 Feb 2019 15:04:56 +0800
Subject: [PATCH] ASoC: sunxi: sun50i-codec-analog: Rename hpvcc regulator
 supply to cpvdd

The A64 datasheet lists the supply rail for the headphone amp's charge
pump as "CPVDD". cpvdd-supply is the name of the property for this power
rail specified in the device tree bindings. "HPVCC" was the name used in
the A33 datasheet for the same function.

Rename the supply so it matches the datasheet, bindings, and the subject
from the original commit.

Fixes: ca0412a05756 ("ASoC: sunxi: sun50i-codec-analog: Add support for cpvdd 
regulator supply")
Signed-off-by: Chen-Yu Tsai 
Signed-off-by: Mark Brown 
---
 sound/soc/sunxi/sun50i-codec-analog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sunxi/sun50i-codec-analog.c 
b/sound/soc/sunxi/sun50i-codec-analog.c
index df1fed0aa001..d105c90c3706 100644
--- a/sound/soc/sunxi/sun50i-codec-analog.c
+++ b/sound/soc/sunxi/sun50i-codec-analog.c
@@ -274,7 +274,7 @@ static const struct snd_soc_dapm_widget 
sun50i_a64_codec_widgets[] = {
 * stream widgets at the card level.
 */
 
-   SND_SOC_DAPM_REGULATOR_SUPPLY("hpvcc", 0, 0),
+   SND_SOC_DAPM_REGULATOR_SUPPLY("cpvdd", 0, 0),
SND_SOC_DAPM_MUX("Headphone Source Playback Route",
 SND_SOC_NOPM, 0, 0, sun50i_codec_hp_src),
SND_SOC_DAPM_OUT_DRV("Headphone Amp", SUN50I_ADDA_HP_CTRL,
@@ -362,7 +362,7 @@ static const struct snd_soc_dapm_route 
sun50i_a64_codec_routes[] = {
{ "Headphone Source Playback Route", "Mixer", "Left Mixer" },
{ "Headphone Source Playback Route", "Mixer", "Right Mixer" },
{ "Headphone Amp", NULL, "Headphone Source Playback Route" },
-   { "Headphone Amp", NULL, "hpvcc" },
+   { "Headphone Amp", NULL, "cpvdd" },
{ "HP", NULL, "Headphone Amp" },
 
/* Microphone Routes */
-- 
2.20.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [alsa-devel] [PATCH v3 1/9] ASoC: sun4i-i2s: Adjust regmap settings

2019-01-10 Thread Mark Brown
On Sun, Dec 23, 2018 at 11:16:31AM +0800, Chen-Yu Tsai wrote:

> This sounds like the flush is happening after DMA transfers and/or I2S
> operations have started, disrupting the order of the audio samples. I
> think that might be the case since the regcache is synced sequentially,
> and the FIFO control register is after the enable bits. That would imply
> that the device is taken out of runtime suspend after the .start_capture
> or .start_playback callbacks. Not sure if that's the case, but that would
> mean the bus clocks are still off at this point, and bypassing the cache
> and updating the bits is basically moot.

I would expect that the device needs to be resumed from suspend before
we start actually trying to transfer audio - there is stuff in the ASoC
core which is supposed to have appropriate gets but it's possible
something is going wrong there.

> I think there's something else happening here, but we need to figure it
> out instead of papering over it with something that "just works" but
> we don't know why it works.

I agree.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v3 4/9] ASoC: sun4i-i2s: Fix offset mask

2019-01-10 Thread Mark Brown
On Sat, Dec 22, 2018 at 12:54:48AM +0800, Chen-Yu Tsai wrote:
> On Fri, Dec 21, 2018 at 11:21 PM  wrote:

> > Also add offset to RX channel select

> Commit log seems a bit lacking. You could probably explain how you
> found this, either when comparing datasheet macros, or some actual
> error manifested and you "heard" it. You could also state what the
> fixed outcome should be.

> Also please add a fixes tag.

Plus send this at the start of the series so it can be applied as a fix
and sent to Linus during the development cycle.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v3 1/9] ASoC: sun4i-i2s: Adjust regmap settings

2019-01-10 Thread Mark Brown
On Sat, Dec 22, 2018 at 12:44:07AM +0800, Chen-Yu Tsai wrote:
> On Fri, Dec 21, 2018 at 11:21 PM  wrote:

> > +   regcache_cache_bypass(i2s->regmap, true);
> > regmap_update_bits(i2s->regmap, SUN4I_I2S_FIFO_CTRL_REG,
> >SUN4I_I2S_FIFO_CTRL_FLUSH_RX,
> >SUN4I_I2S_FIFO_CTRL_FLUSH_RX);
> > +   regcache_cache_bypass(i2s->regmap, false);

> IIRC the flush cache bit is self-clearing. So you likely want to mark
> this register as volatile. If it is marked as volatile, then all access
> to that register bypasses the cache, so the regcache_cache_bypass calls
> are unneeded.

Yes, that should be the case.

> However, looking at the code, the write would seem to be ignored if the
> regmap is in the cache_only state. We only set this when the bus clock
> is disabled. Under such a condition, bypassing the cache and forcing a
> write would be unwise, as the system either drops the write, or stalls
> altogether.

Right, access to a cache only register while the device is in cache only
mode is not a great idea - the usual reason we're in cache only mode is
that the device is in a state where I/O isn't going to work.  One thing
that can work for this if you need the register to be cached (but is a
bit gross) is to do a write setting the self clearing bit then another
immediately after resetting it back to the cleared state.  That works OK
for cases where the bit is a strobe and never retains state, though if
the device isn't operational then needing to write to the register might
indicate a bigger picture logic error (or it could be that the register
map mixes random things into one register).

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH 1/8] mfd: axp20x: name voltage ramping define properly

2018-12-13 Thread Mark Brown
On Mon, Dec 10, 2018 at 08:42:12PM +0200, Priit Laes wrote:

> Signed-off-by: Olliver Schinagl 
> Signed-off-by: Priit Laes 
> Acked-for-MFD-by: Lee Jones 

What's going on with this patch?  Will you be applying it or is this an
ack for it to be applied with the rest of the series?

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "ASoC: dt-bindings: sun50i-codec-analog: Add headphone amp regulator supply" to the asoc tree

2018-11-23 Thread Mark Brown
The patch

   ASoC: dt-bindings: sun50i-codec-analog: Add headphone amp regulator supply

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 21dd30200e3d350fe420d23a2a00b17633a3d1a2 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai 
Date: Thu, 22 Nov 2018 18:23:18 +0800
Subject: [PATCH] ASoC: dt-bindings: sun50i-codec-analog: Add headphone amp
 regulator supply

On the Allwinner A64 SoC, the audio codec has a built-in headphone
amplifier. This amplifier has a power supply separate from the rest of
the analog audio circuitry.

Add a regulator supply property to handle this.

Signed-off-by: Chen-Yu Tsai 
Signed-off-by: Mark Brown 
---
 Documentation/devicetree/bindings/sound/sun50i-codec-analog.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/sun50i-codec-analog.txt 
b/Documentation/devicetree/bindings/sound/sun50i-codec-analog.txt
index 4f8ad0e04d20..056a098495cc 100644
--- a/Documentation/devicetree/bindings/sound/sun50i-codec-analog.txt
+++ b/Documentation/devicetree/bindings/sound/sun50i-codec-analog.txt
@@ -4,9 +4,11 @@ Required properties:
 - compatible: must be one of the following compatibles:
- "allwinner,sun50i-a64-codec-analog"
 - reg: must contain the registers location and length
+- cpvdd-supply: Regulator supply for the headphone amplifier
 
 Example:
codec_analog: codec-analog@1f015c0 {
compatible = "allwinner,sun50i-a64-codec-analog";
reg = <0x01f015c0 0x4>;
+   cpvdd-supply = <_eldo1>;
};
-- 
2.19.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sunxi: sun50i-codec-analog: Add support for cpvdd regulator supply" to the asoc tree

2018-11-23 Thread Mark Brown
The patch

   ASoC: sunxi: sun50i-codec-analog: Add support for cpvdd regulator supply

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From ca0412a05756cd0b94751ca4d54fe6522f00b1f4 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai 
Date: Thu, 22 Nov 2018 18:23:19 +0800
Subject: [PATCH] ASoC: sunxi: sun50i-codec-analog: Add support for cpvdd
 regulator supply

On the Allwinner A64 SoCs, the audio codec has a built-in headphone
amplifier. This amplifier has a power supply separate from the rest of
the analog audio circuitry, labeled cpvdd.

This patch adds a DAPM widget for this supply, and ties it to the
headphone amp widget.

Signed-off-by: Chen-Yu Tsai 
Acked-by: Maxime Ripard 
Signed-off-by: Mark Brown 
---
 sound/soc/sunxi/sun50i-codec-analog.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/sunxi/sun50i-codec-analog.c 
b/sound/soc/sunxi/sun50i-codec-analog.c
index 8f5f999df631..df1fed0aa001 100644
--- a/sound/soc/sunxi/sun50i-codec-analog.c
+++ b/sound/soc/sunxi/sun50i-codec-analog.c
@@ -274,6 +274,7 @@ static const struct snd_soc_dapm_widget 
sun50i_a64_codec_widgets[] = {
 * stream widgets at the card level.
 */
 
+   SND_SOC_DAPM_REGULATOR_SUPPLY("hpvcc", 0, 0),
SND_SOC_DAPM_MUX("Headphone Source Playback Route",
 SND_SOC_NOPM, 0, 0, sun50i_codec_hp_src),
SND_SOC_DAPM_OUT_DRV("Headphone Amp", SUN50I_ADDA_HP_CTRL,
@@ -361,6 +362,7 @@ static const struct snd_soc_dapm_route 
sun50i_a64_codec_routes[] = {
{ "Headphone Source Playback Route", "Mixer", "Left Mixer" },
{ "Headphone Source Playback Route", "Mixer", "Right Mixer" },
{ "Headphone Amp", NULL, "Headphone Source Playback Route" },
+   { "Headphone Amp", NULL, "hpvcc" },
{ "HP", NULL, "Headphone Amp" },
 
/* Microphone Routes */
-- 
2.19.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v9 1/8] ASoC: dt-bindings: sun50i-codec-analog: Add headphone amp regulator supply

2018-11-23 Thread Mark Brown
On Thu, Nov 22, 2018 at 04:32:41PM +0100, Maxime Ripard wrote:
> On Thu, Nov 22, 2018 at 06:23:18PM +0800, Chen-Yu Tsai wrote:

> > +- cpvdd-supply: Regulator supply for the headphone amplifier

> I guess we should make this optional, since even if it's missing, it's
> going to create a dummy regulator. and that allows to have backward
> compatibility.

Regulators should never be marked as optional unless they can be
physically absent.  It is true that Linux has code to handle partially
defined device trees but we shouldn't rely on other OSs having similar
code and it's better practice to have board device trees be fully
specified, it means that if we need the regulator information for some
future thing it's more likely to be there and it's less likely that bugs
which do things like cause the regulator to be powered off incorrectly
will be introduced in future.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [REGRESSION] boot fail due to commit efdfeb079cc3("regulator: fixed: Convert to use GPIO descriptor only")

2018-10-04 Thread Mark Brown
On Tue, Oct 02, 2018 at 08:39:17PM +0200, Corentin Labbe wrote:

> The following boards fails to boot due to commit efdfeb079cc3("regulator: 
> fixed: Convert to use GPIO descriptor only")
> - sun8i-h3-libretech-all-h3-cc
> - sun50i-h5-libretech-all-h3-cc

I applied a fix for some issues with that commit from Linus today,
hopefully it also helps these systems.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "regulator: add support for SY8106A regulator" to the regulator tree

2018-05-11 Thread Mark Brown
The patch

   regulator: add support for SY8106A regulator

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 8878302ebbc580d64f390c0acc509e5e8276598c Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <meg...@megous.com>
Date: Mon, 7 May 2018 20:29:41 +0800
Subject: [PATCH] regulator: add support for SY8106A regulator

SY8106A is an I2C attached single output regulator made by Silergy Corp,
which is used on several Allwinner H3/H5 SBCs to control the power
supply of the ARM cores.

Add a driver for it.

Signed-off-by: Ondrej Jirman <meg...@megous.com>
[Icenowy: Change commit message, remove enable/disable code, add default
 ramp_delay, add comment for go bit, add code for fixed mode voltage]
Signed-off-by: Icenowy Zheng <icen...@aosc.io>
Reviewed-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 MAINTAINERS   |   6 +
 drivers/regulator/Kconfig |   7 ++
 drivers/regulator/Makefile|   2 +-
 drivers/regulator/sy8106a-regulator.c | 167 ++
 4 files changed, 181 insertions(+), 1 deletion(-)
 create mode 100644 drivers/regulator/sy8106a-regulator.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 0a1410d5a621..971300930067 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13461,6 +13461,12 @@ S: Supported
 F: net/switchdev/
 F: include/net/switchdev.h
 
+SY8106A REGULATOR DRIVER
+M: Icenowy Zheng <icen...@aosc.io>
+S: Maintained
+F: drivers/regulator/sy8106a-regulator.c
+F: Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt
+
 SYNC FILE FRAMEWORK
 M: Sumit Semwal <sumit.sem...@linaro.org>
 R: Gustavo Padovan <gust...@padovan.org>
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 097f61784a7d..4efae3b7e746 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -801,6 +801,13 @@ config REGULATOR_STW481X_VMMC
  This driver supports the internal VMMC regulator in the STw481x
  PMIC chips.
 
+config REGULATOR_SY8106A
+   tristate "Silergy SY8106A regulator"
+   depends on I2C && (OF || COMPILE_TEST)
+   select REGMAP_I2C
+   help
+ This driver supports SY8106A single output regulator.
+
 config REGULATOR_TPS51632
tristate "TI TPS51632 Power Regulator"
depends on I2C
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 590674fbecd7..d81fb02bd6e9 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -100,6 +100,7 @@ obj-$(CONFIG_REGULATOR_SC2731) += sc2731-regulator.o
 obj-$(CONFIG_REGULATOR_SKY81452) += sky81452-regulator.o
 obj-$(CONFIG_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o
 obj-$(CONFIG_REGULATOR_STW481X_VMMC) += stw481x-vmmc.o
+obj-$(CONFIG_REGULATOR_SY8106A) += sy8106a-regulator.o
 obj-$(CONFIG_REGULATOR_TI_ABB) += ti-abb-regulator.o
 obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o
 obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o
@@ -125,5 +126,4 @@ obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o
 obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o
 obj-$(CONFIG_REGULATOR_WM8994) += wm8994-regulator.o
 
-
 ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
diff --git a/drivers/regulator/sy8106a-regulator.c 
b/drivers/regulator/sy8106a-regulator.c
new file mode 100644
index ..65fbd1f0b612
--- /dev/null
+++ b/drivers/regulator/sy8106a-regulator.c
@@ -0,0 +1,167 @@
+// SPDX-License-Identifier: GPL-2.0+
+//
+// sy8106a-regulator.c - Regulator device driver for SY8106A
+//
+// Copyright (C) 2016 Ondřej Jirman <meg...@megous.com>
+// Copyright (c) 2017-2018 Icenowy Zheng <icen...@aosc.io>
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define SY8106A_REG_VOUT1_SEL  0x01
+#define SY8106A_REG_VOUT_COM   0x02
+#define SY8106A_REG_VOUT1_SEL_MASK 0x7f
+#define SY8106A_DISABLE_REGBIT(0)
+/*
+ * The I2C controlled voltage will only work when this bit is set; otherwise
+ * it will behave like a fixed regulator.
+ */
+#define S

[linux-sunxi] Applied "regulator: add support for SY8106A regulator" to the regulator tree

2018-05-11 Thread Mark Brown
The patch

   regulator: add support for SY8106A regulator

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 8878302ebbc580d64f390c0acc509e5e8276598c Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <meg...@megous.com>
Date: Mon, 7 May 2018 20:29:41 +0800
Subject: [PATCH] regulator: add support for SY8106A regulator

SY8106A is an I2C attached single output regulator made by Silergy Corp,
which is used on several Allwinner H3/H5 SBCs to control the power
supply of the ARM cores.

Add a driver for it.

Signed-off-by: Ondrej Jirman <meg...@megous.com>
[Icenowy: Change commit message, remove enable/disable code, add default
 ramp_delay, add comment for go bit, add code for fixed mode voltage]
Signed-off-by: Icenowy Zheng <icen...@aosc.io>
Reviewed-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 MAINTAINERS   |   6 +
 drivers/regulator/Kconfig |   7 ++
 drivers/regulator/Makefile|   2 +-
 drivers/regulator/sy8106a-regulator.c | 167 ++
 4 files changed, 181 insertions(+), 1 deletion(-)
 create mode 100644 drivers/regulator/sy8106a-regulator.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 0a1410d5a621..971300930067 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13461,6 +13461,12 @@ S: Supported
 F: net/switchdev/
 F: include/net/switchdev.h
 
+SY8106A REGULATOR DRIVER
+M: Icenowy Zheng <icen...@aosc.io>
+S: Maintained
+F: drivers/regulator/sy8106a-regulator.c
+F: Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt
+
 SYNC FILE FRAMEWORK
 M: Sumit Semwal <sumit.sem...@linaro.org>
 R: Gustavo Padovan <gust...@padovan.org>
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index 097f61784a7d..4efae3b7e746 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -801,6 +801,13 @@ config REGULATOR_STW481X_VMMC
  This driver supports the internal VMMC regulator in the STw481x
  PMIC chips.
 
+config REGULATOR_SY8106A
+   tristate "Silergy SY8106A regulator"
+   depends on I2C && (OF || COMPILE_TEST)
+   select REGMAP_I2C
+   help
+ This driver supports SY8106A single output regulator.
+
 config REGULATOR_TPS51632
tristate "TI TPS51632 Power Regulator"
depends on I2C
diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile
index 590674fbecd7..d81fb02bd6e9 100644
--- a/drivers/regulator/Makefile
+++ b/drivers/regulator/Makefile
@@ -100,6 +100,7 @@ obj-$(CONFIG_REGULATOR_SC2731) += sc2731-regulator.o
 obj-$(CONFIG_REGULATOR_SKY81452) += sky81452-regulator.o
 obj-$(CONFIG_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o
 obj-$(CONFIG_REGULATOR_STW481X_VMMC) += stw481x-vmmc.o
+obj-$(CONFIG_REGULATOR_SY8106A) += sy8106a-regulator.o
 obj-$(CONFIG_REGULATOR_TI_ABB) += ti-abb-regulator.o
 obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o
 obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o
@@ -125,5 +126,4 @@ obj-$(CONFIG_REGULATOR_WM8350) += wm8350-regulator.o
 obj-$(CONFIG_REGULATOR_WM8400) += wm8400-regulator.o
 obj-$(CONFIG_REGULATOR_WM8994) += wm8994-regulator.o
 
-
 ccflags-$(CONFIG_REGULATOR_DEBUG) += -DDEBUG
diff --git a/drivers/regulator/sy8106a-regulator.c 
b/drivers/regulator/sy8106a-regulator.c
new file mode 100644
index ..65fbd1f0b612
--- /dev/null
+++ b/drivers/regulator/sy8106a-regulator.c
@@ -0,0 +1,167 @@
+// SPDX-License-Identifier: GPL-2.0+
+//
+// sy8106a-regulator.c - Regulator device driver for SY8106A
+//
+// Copyright (C) 2016 Ondřej Jirman <meg...@megous.com>
+// Copyright (c) 2017-2018 Icenowy Zheng <icen...@aosc.io>
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define SY8106A_REG_VOUT1_SEL  0x01
+#define SY8106A_REG_VOUT_COM   0x02
+#define SY8106A_REG_VOUT1_SEL_MASK 0x7f
+#define SY8106A_DISABLE_REGBIT(0)
+/*
+ * The I2C controlled voltage will only work when this bit is set; otherwise
+ * it will behave like a fixed regulator.
+ */
+#define S

[linux-sunxi] Applied "regulator: add binding for the SY8106A voltage regulator" to the regulator tree

2018-05-11 Thread Mark Brown
The patch

   regulator: add binding for the SY8106A voltage regulator

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 32aba834f2a9fe126ff5e624371113ac1defa06e Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <meg...@megous.com>
Date: Mon, 7 May 2018 20:29:40 +0800
Subject: [PATCH] regulator: add binding for the SY8106A voltage regulator

SY8106A is an I2C-controlled adjustable voltage regulator made by
Silergy Corp.

Add its device tree binding.

Signed-off-by: Ondrej Jirman <meg...@megous.com>
[Icenowy: Change commit message and slight fixes]
Signed-off-by: Icenowy Zheng <icen...@aosc.io>
Reviewed-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Rob Herring <r...@kernel.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 .../bindings/regulator/sy8106a-regulator.txt  | 23 +++
 1 file changed, 23 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt

diff --git a/Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt 
b/Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt
new file mode 100644
index ..39a8ca73f572
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt
@@ -0,0 +1,23 @@
+SY8106A Voltage regulator
+
+Required properties:
+- compatible: Must be "silergy,sy8106a"
+- reg: I2C slave address - must be <0x65>
+- silergy,fixed-microvolt - the voltage when I2C regulating is disabled (set
+  by external resistor like a fixed voltage)
+
+Any property defined as part of the core regulator binding, defined in
+./regulator.txt, can also be used.
+
+Example:
+
+   sy8106a {
+   compatible = "silergy,sy8106a";
+   reg = <0x65>;
+   regulator-name = "sy8106a-vdd";
+   silergy,fixed-microvolt = <120>;
+   regulator-min-microvolt = <100>;
+   regulator-max-microvolt = <140>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
-- 
2.17.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "regulator: add binding for the SY8106A voltage regulator" to the regulator tree

2018-05-11 Thread Mark Brown
The patch

   regulator: add binding for the SY8106A voltage regulator

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 32aba834f2a9fe126ff5e624371113ac1defa06e Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <meg...@megous.com>
Date: Mon, 7 May 2018 20:29:40 +0800
Subject: [PATCH] regulator: add binding for the SY8106A voltage regulator

SY8106A is an I2C-controlled adjustable voltage regulator made by
Silergy Corp.

Add its device tree binding.

Signed-off-by: Ondrej Jirman <meg...@megous.com>
[Icenowy: Change commit message and slight fixes]
Signed-off-by: Icenowy Zheng <icen...@aosc.io>
Reviewed-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Rob Herring <r...@kernel.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 .../bindings/regulator/sy8106a-regulator.txt  | 23 +++
 1 file changed, 23 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt

diff --git a/Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt 
b/Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt
new file mode 100644
index ..39a8ca73f572
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/sy8106a-regulator.txt
@@ -0,0 +1,23 @@
+SY8106A Voltage regulator
+
+Required properties:
+- compatible: Must be "silergy,sy8106a"
+- reg: I2C slave address - must be <0x65>
+- silergy,fixed-microvolt - the voltage when I2C regulating is disabled (set
+  by external resistor like a fixed voltage)
+
+Any property defined as part of the core regulator binding, defined in
+./regulator.txt, can also be used.
+
+Example:
+
+   sy8106a {
+   compatible = "silergy,sy8106a";
+   reg = <0x65>;
+   regulator-name = "sy8106a-vdd";
+   silergy,fixed-microvolt = <120>;
+   regulator-min-microvolt = <100>;
+   regulator-max-microvolt = <140>;
+   regulator-boot-on;
+   regulator-always-on;
+   };
-- 
2.17.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v3 2/3] regulator: add support for SY8106A regulator

2018-04-27 Thread Mark Brown
On Mon, Apr 23, 2018 at 10:46:56PM +0800, Icenowy Zheng wrote:

> --- /dev/null
> +++ b/drivers/regulator/sy8106a-regulator.c
> @@ -0,0 +1,176 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + * sy8106a-regulator.c - Regulator device driver for SY8106A

Just make the entire thing a C++ comment so it looks consistent and
joined up.

> +static int sy8106a_set_voltage_sel(struct regulator_dev *rdev, unsigned int 
> sel)
> +{
> + /* We use our set_voltage_sel in order to avoid unnecessary I2C
> +  * chatter, because the regulator_get_voltage_sel_regmap using
> +  * apply_bit would perform 4 unnecessary transfers instead of one,
> +  * increasing the chance of error.
> +  */
> + return regmap_write(rdev->regmap, rdev->desc->vsel_reg,
> + sel | SY8106A_GO_BIT);

Why would it do these extra transfers?  Is this just the fact that you
didn't set up a register cache (though the r/m/w cycle should only add
the read)?  We could put some logic in the core regmap code to detect
that an _update_bits() call is going to write to the whole register,
though it'd be even easier to just let this register be cached.

Generally if we can usefully optimize things we should do it at the
framework level.

> + if (reg & SY8106A_GO_BIT)
> + return reg & rdev->desc->vsel_mask;
> + else
> + return (chip->fixed_voltage - rdev->desc->min_uV) /
> +rdev->desc->uV_step;

You could use the standard get_voltage_sel() if you provide a mapping
operation that set everything with _GO_BIT set to return the fixed
voltage.  Though looking at this it seems that the fixed voltage will
always be one that could be set via the register anyway so I'm wondering
if the easiest thing here isn't to just have the driver turn off _GO_BIT
during probe() and not worry about the special case at runtime.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v3 2/3] regulator: add support for SY8106A regulator

2018-04-27 Thread Mark Brown
On Wed, Apr 25, 2018 at 06:55:10PM +0800, Icenowy Zheng wrote:
> 于 2018年4月25日 GMT+08:00 下午6:53:09, Mark Brown <broo...@kernel.org> 写到:

> >> SPDX identifier is special -- it should be in a seperated
> >> comment block.

> >No, it just needs to be a C++ comment on the first line to ease machine
> >parsing.  The rest of the file doesn't matter for that.

> Okay. Thus I will use a seperate /* */ block for it in the
> next revision, to follow the rule.

Just make the whole copyright block a C++ comment.  It's much easier and
even with a blank line between the SPDX line and the rest of it it'll
still look messy and odd.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v3 2/3] regulator: add support for SY8106A regulator

2018-04-27 Thread Mark Brown
On Wed, Apr 25, 2018 at 07:41:35AM +0800, Icenowy Zheng wrote:
> 于 2018年4月25日 GMT+08:00 上午1:07:33, Mark Brown <broo...@kernel.org> 写到:
> >On Mon, Apr 23, 2018 at 10:46:56PM +0800, Icenowy Zheng wrote:

> >> --- /dev/null
> >> +++ b/drivers/regulator/sy8106a-regulator.c
> >> @@ -0,0 +1,176 @@
> >> +// SPDX-License-Identifier: GPL-2.0+
> >> +/*
> >> + * sy8106a-regulator.c - Regulator device driver for SY8106A

> >Just make the entire thing a C++ comment so it looks consistent and
> >joined up.

> SPDX identifier is special -- it should be in a seperated
> comment block.

No, it just needs to be a C++ comment on the first line to ease machine
parsing.  The rest of the file doesn't matter for that.

> >> +  if (reg & SY8106A_GO_BIT)
> >> +  return reg & rdev->desc->vsel_mask;
> >> +  else
> >> +  return (chip->fixed_voltage - rdev->desc->min_uV) /
> >> + rdev->desc->uV_step;

> >You could use the standard get_voltage_sel() if you provide a mapping
> >operation that set everything with _GO_BIT set to return the fixed
> >voltage.  Though looking at this it seems that the fixed voltage will
> >always be one that could be set via the register anyway so I'm
> >wondering
> >if the easiest thing here isn't to just have the driver turn off
> >_GO_BIT

> Do you mean "turn on" here?

Yes.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "regulator: axp20x: add drivevbus support for axp803" to the regulator tree

2018-04-24 Thread Mark Brown
The patch

   regulator: axp20x: add drivevbus support for axp803

has been applied to the regulator tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 1f5d6462b5856ddd44d4500ac80b7862faff351b Mon Sep 17 00:00:00 2001
From: Jagan Teki <ja...@amarulasolutions.com>
Date: Mon, 23 Apr 2018 12:02:37 +0530
Subject: [PATCH] regulator: axp20x: add drivevbus support for axp803

Like axp221, axp223, axp813 the axp803 is also supporting external
regulator to drive the  OTG VBus through N_VBUSEN PMIC pin.

Add support for it.

Signed-off-by: Jagan Teki <ja...@amarulasolutions.com>
Reviewed-by: Rob Herring <r...@kernel.org>
Reviewed-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 Documentation/devicetree/bindings/mfd/axp20x.txt | 3 ++-
 drivers/regulator/axp20x-regulator.c | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt 
b/Documentation/devicetree/bindings/mfd/axp20x.txt
index 9455503b0299..d1762f3b30af 100644
--- a/Documentation/devicetree/bindings/mfd/axp20x.txt
+++ b/Documentation/devicetree/bindings/mfd/axp20x.txt
@@ -43,7 +43,7 @@ Optional properties:
  regulator to drive the OTG VBus, rather then
  as an input pin which signals whether the
  board is driving OTG VBus or not.
- (axp221 / axp223 / axp813 only)
+ (axp221 / axp223 / axp803/ axp813 only)
 
 - x-powers,master-mode: Boolean (axp806 only). Set this when the PMIC is
wired for master mode. The default is slave mode.
@@ -132,6 +132,7 @@ FLDO2   : LDO   : fldoin-supply 
: shared supply
 LDO_IO0: LDO   : ips-supply: GPIO 0
 LDO_IO1: LDO   : ips-supply: GPIO 1
 RTC_LDO: LDO   : ips-supply: always on
+DRIVEVBUS  : Enable output : drivevbus-supply  : external regulator
 
 AXP806 regulators, type, and corresponding input supply names:
 
diff --git a/drivers/regulator/axp20x-regulator.c 
b/drivers/regulator/axp20x-regulator.c
index 181622b2813d..91b8ff8bac15 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -721,6 +721,8 @@ static int axp20x_regulator_probe(struct platform_device 
*pdev)
case AXP803_ID:
regulators = axp803_regulators;
nregulators = AXP803_REG_ID_MAX;
+   drivevbus = of_property_read_bool(pdev->dev.parent->of_node,
+ "x-powers,drive-vbus-en");
break;
case AXP806_ID:
regulators = axp806_regulators;
-- 
2.17.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v2 6/6] ASoC: sun4i-i2s: Add support for loopback

2018-03-13 Thread Mark Brown
On Mon, Mar 12, 2018 at 04:57:53PM +0100, codekip...@gmail.com wrote:

> +- loopback:  if this property is present then the dai is configured in
> + loopback mode where the output fifo is redirected to the input
> + fifo.

This really doesn't seem like something that ought to go into the DT
and hence ABI given that there's obviously no reason to use this in
production.  Just make it be a #define in the code or something.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v2 1/6] ASoC: sun4i-i2s: Add slot width override

2018-03-13 Thread Mark Brown
On Mon, Mar 12, 2018 at 04:57:48PM +0100, codekip...@gmail.com wrote:

> Some codecs require a different amount of a bit clocks per frame
> than what is calculated by using the sample width. Use a slot
> width override property to provide this mechanism.

If this is a CODEC requirement we should really be working this out from
the CODEC rather than adding a DT property on the I2S controller, or at
the very least putting this in the machine drivers.  The generic drivers
already have support for mclk-fs and there's an operation set_bclk_ratio() 
for them to use though we don't have a DT binding for that yet.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [linux-sunxi] [PATCH 1/3] ASoC: sun4i-i2s: Add set_tdm_slot functionality

2018-01-29 Thread Mark Brown
On Mon, Jan 29, 2018 at 01:28:51PM +0100, Code Kipper wrote:
> On 29 January 2018 at 12:32, Mark Brown <broo...@kernel.org> wrote:

> > You're looking for set_bclk_ratio() I think.

> I'm looking for a mechanism to be able to override the bclk width
> (usually it's based on param_width) from the device tree. The tdm slot
> functionality looked just what I needed.

The simple and graph cards have support for bclk ratio configuration as
well.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: [linux-sunxi] [PATCH 1/3] ASoC: sun4i-i2s: Add set_tdm_slot functionality

2018-01-29 Thread Mark Brown
On Mon, Jan 29, 2018 at 08:34:00AM +0100, Code Kipper wrote:

> I'm not sure..I was looking for a clean example of being able to
> override the number of bclks in the lrclk width and some other
> devices(Rpi) were doing it this way.  I open to suggestions,

You're looking for set_bclk_ratio() I think.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "regmap: add iopoll-like polling macro for regmap_field" to the regmap tree

2017-10-06 Thread Mark Brown
The patch

   regmap: add iopoll-like polling macro for regmap_field

has been applied to the regmap tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 667063acb81931e2f8fd0cb91df9fcccad131d9a Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Fri, 29 Sep 2017 16:23:01 +0800
Subject: [PATCH] regmap: add iopoll-like polling macro for regmap_field

This patch adds a macro regmap_field_read_poll_timeout that works
similar to the readx_poll_timeout defined in linux/iopoll.h, except
that this can also return the error value returned by a failed
regmap_field_read.

Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 include/linux/regmap.h | 39 +++
 1 file changed, 39 insertions(+)

diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 978abfbac617..93a4663d7acb 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -139,6 +139,45 @@ struct reg_sequence {
pollret ?: ((cond) ? 0 : -ETIMEDOUT); \
 })
 
+/**
+ * regmap_field_read_poll_timeout - Poll until a condition is met or timeout
+ *
+ * @field: Regmap field to read from
+ * @val: Unsigned integer variable to read the value into
+ * @cond: Break condition (usually involving @val)
+ * @sleep_us: Maximum time to sleep between reads in us (0
+ *tight-loops).  Should be less than ~20ms since usleep_range
+ *is used (see Documentation/timers/timers-howto.txt).
+ * @timeout_us: Timeout in us, 0 means never timeout
+ *
+ * Returns 0 on success and -ETIMEDOUT upon a timeout or the regmap_field_read
+ * error return value in case of a error read. In the two former cases,
+ * the last read value at @addr is stored in @val. Must not be called
+ * from atomic context if sleep_us or timeout_us are used.
+ *
+ * This is modelled after the readx_poll_timeout macros in linux/iopoll.h.
+ */
+#define regmap_field_read_poll_timeout(field, val, cond, sleep_us, timeout_us) 
\
+({ \
+   ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \
+   int pollret; \
+   might_sleep_if(sleep_us); \
+   for (;;) { \
+   pollret = regmap_field_read((field), &(val)); \
+   if (pollret) \
+   break; \
+   if (cond) \
+   break; \
+   if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \
+   pollret = regmap_field_read((field), &(val)); \
+   break; \
+   } \
+   if (sleep_us) \
+   usleep_range((sleep_us >> 2) + 1, sleep_us); \
+   } \
+   pollret ?: ((cond) ? 0 : -ETIMEDOUT); \
+})
+
 #ifdef CONFIG_REGMAP
 
 enum regmap_endian {
-- 
2.14.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "regulator: axp20x: Add support for AXP813 regulators" to the regulator tree

2017-10-06 Thread Mark Brown
The patch

   regulator: axp20x: Add support for AXP813 regulators

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From d81851c1764b26b46670c0b3bd6701308ddaab98 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Fri, 29 Sep 2017 11:25:09 +0800
Subject: [PATCH] regulator: axp20x: Add support for AXP813 regulators

The AXP813 PMIC has 7 DC-DC buck regulators, 16 LDOs (including the
fixed RTC LDO and 2 GPIO LDOs), and 1 switchable. The drive-vbus
feature is also supported. All the hardware details are very similar
to the AXP803, with the following exceptions:

  - Extra DCDC7 buck regulator, with the same range as DCDC6

  - SWitch now has a separate supply pin, instead of being chained
internaly from DCDC1

  - RTC LDO output voltage is now 1.8V

  - FLDO3 is an LDO with switchable supplies, but unconfigurable output
voltage. The voltage is always half that of its supply.

Support for FLDO3 is currently unimplemented, as it requires runtime
switching of its supplies, something the regulator subsystem does not
support. It is not used in either the reference designs nor actually
produced boards available.

Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Tested-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 drivers/regulator/axp20x-regulator.c | 102 +--
 include/linux/mfd/axp20x.h   |   3 ++
 2 files changed, 101 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c 
b/drivers/regulator/axp20x-regulator.c
index 376a99b7cf5d..e1761df4cbfd 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -244,6 +244,7 @@ static const struct regulator_desc 
axp22x_drivevbus_regulator = {
.ops= _ops_sw,
 };
 
+/* DCDC ranges shared with AXP813 */
 static const struct regulator_linear_range axp803_dcdc234_ranges[] = {
REGULATOR_LINEAR_RANGE(50, 0x0, 0x46, 1),
REGULATOR_LINEAR_RANGE(122, 0x47, 0x4b, 2),
@@ -426,6 +427,69 @@ static const struct regulator_desc axp809_regulators[] = {
AXP_DESC_SW(AXP809, SW, "sw", "swin", AXP22X_PWR_OUT_CTRL2, BIT(6)),
 };
 
+static const struct regulator_desc axp813_regulators[] = {
+   AXP_DESC(AXP813, DCDC1, "dcdc1", "vin1", 1600, 3400, 100,
+AXP803_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(0)),
+   AXP_DESC_RANGES(AXP813, DCDC2, "dcdc2", "vin2", axp803_dcdc234_ranges,
+   76, AXP803_DCDC2_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+   BIT(1)),
+   AXP_DESC_RANGES(AXP813, DCDC3, "dcdc3", "vin3", axp803_dcdc234_ranges,
+   76, AXP803_DCDC3_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+   BIT(2)),
+   AXP_DESC_RANGES(AXP813, DCDC4, "dcdc4", "vin4", axp803_dcdc234_ranges,
+   76, AXP803_DCDC4_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+   BIT(3)),
+   AXP_DESC_RANGES(AXP813, DCDC5, "dcdc5", "vin5", axp803_dcdc5_ranges,
+   68, AXP803_DCDC5_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+   BIT(4)),
+   AXP_DESC_RANGES(AXP813, DCDC6, "dcdc6", "vin6", axp803_dcdc6_ranges,
+   72, AXP803_DCDC6_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+   BIT(5)),
+   AXP_DESC_RANGES(AXP813, DCDC7, "dcdc7", "vin7", axp803_dcdc6_ranges,
+   72, AXP813_DCDC7_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+   BIT(6)),
+   AXP_DESC(AXP813, ALDO1, "aldo1", "aldoin", 700, 3300, 100,
+AXP22X_ALDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL3, BIT(5)),
+   AXP_DESC(AXP813, ALDO2, "aldo2", "aldoin", 700, 3300, 100,
+AXP22X_ALDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL3, BIT(6)),
+   AXP_DESC(AXP813, ALDO3, "aldo3&q

[linux-sunxi] Applied "regulator: axp20x: Fix poly-phase bit offset for AXP803 DCDC5/6" to the regulator tree

2017-10-06 Thread Mark Brown
The patch

   regulator: axp20x: Fix poly-phase bit offset for AXP803 DCDC5/6

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 986e7b7e4991a5d3abab26f97a671512e09e4417 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Fri, 29 Sep 2017 11:25:08 +0800
Subject: [PATCH] regulator: axp20x: Fix poly-phase bit offset for AXP803
 DCDC5/6

The bit offset used to check if DCDC5 and DCDC6 are tied together in
poly-phase output is wrong. It was checking against a reserved bit,
which is always false.

In reality, neither the reference design layout nor actually produced
boards tie these two buck regulators together. But we should still
fix it, just in case.

Fixes: 1dbe0ccb0631 ("regulator: axp20x-regulator: add support for AXP803")
Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Tested-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 drivers/regulator/axp20x-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/axp20x-regulator.c 
b/drivers/regulator/axp20x-regulator.c
index f18b36dd57dd..376a99b7cf5d 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -590,7 +590,7 @@ static bool axp20x_is_polyphase_slave(struct axp20x_dev 
*axp20x, int id)
case AXP803_DCDC3:
return !!(reg & BIT(6));
case AXP803_DCDC6:
-   return !!(reg & BIT(7));
+   return !!(reg & BIT(5));
}
break;
 
-- 
2.14.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v3 09/14] regmap: add iopoll-like polling macro for regmap_field

2017-10-06 Thread Mark Brown
On Fri, Sep 29, 2017 at 04:23:01PM +0800, Chen-Yu Tsai wrote:
> This patch adds a macro regmap_field_read_poll_timeout that works
> similar to the readx_poll_timeout defined in linux/iopoll.h, except
> that this can also return the error value returned by a failed
> regmap_field_read.

The following changes since commit 2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e:

  Linux 4.14-rc1 (2017-09-16 15:47:51 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git 
tags/regmap-poll-field

for you to fetch changes up to 667063acb81931e2f8fd0cb91df9fcccad131d9a:

  regmap: add iopoll-like polling macro for regmap_field (2017-10-04 11:46:32 
+0100)


regmap: Add field polling macro


Chen-Yu Tsai (1):
  regmap: add iopoll-like polling macro for regmap_field

 include/linux/regmap.h | 39 +++
 1 file changed, 39 insertions(+)

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "ASoC: sun4i-i2s: Add clkdiv offsets to quirks" to the asoc tree

2017-08-14 Thread Mark Brown
The patch

   ASoC: sun4i-i2s: Add clkdiv offsets to quirks

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 0aef27cab880d9612331350c008aec00cbb3d247 Mon Sep 17 00:00:00 2001
From: Marcus Cooper <codekip...@gmail.com>
Date: Sat, 12 Aug 2017 13:00:49 +0200
Subject: [PATCH] ASoC: sun4i-i2s: Add clkdiv offsets to quirks

The BCLKDIV and MCLKDIV found on newer SoCs start from an offset of 1.
Add the functionality to adjust the division values according to the
needs to the device being used.

Signed-off-by: Marcus Cooper <codekip...@gmail.com>
Reviewed-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-i2s.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index d7ee7a443e4e..9a35313c4f9b 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -94,9 +94,13 @@
  * struct sun4i_i2s_quirks - Differences between SoC variants.
  *
  * @has_reset: SoC needs reset deasserted.
+ * @mclk_offset: Value by which mclkdiv needs to be adjusted.
+ * @bclk_offset: Value by which bclkdiv needs to be adjusted.
  */
 struct sun4i_i2s_quirks {
boolhas_reset;
+   unsigned intmclk_offset;
+   unsigned intbclk_offset;
 };
 
 struct sun4i_i2s {
@@ -237,6 +241,10 @@ static int sun4i_i2s_set_clk_rate(struct sun4i_i2s *i2s,
if (mclk_div < 0)
return -EINVAL;
 
+   /* Adjust the clock division values if needed */
+   bclk_div += i2s->variant->bclk_offset;
+   mclk_div += i2s->variant->mclk_offset;
+
regmap_write(i2s->regmap, SUN4I_I2S_CLK_DIV_REG,
 SUN4I_I2S_CLK_DIV_BCLK(bclk_div) |
 SUN4I_I2S_CLK_DIV_MCLK(mclk_div) |
-- 
2.13.2

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sun4i-i2s: Add regmap config to quirks" to the asoc tree

2017-08-14 Thread Mark Brown
The patch

   ASoC: sun4i-i2s: Add regmap config to quirks

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From cd1c63df5fa8196d8ed5138f1ecc22bbabf5f6df Mon Sep 17 00:00:00 2001
From: Marcus Cooper <codekip...@gmail.com>
Date: Sat, 12 Aug 2017 13:00:50 +0200
Subject: [PATCH] ASoC: sun4i-i2s: Add regmap config to quirks

The newer SoCs have a larger range than the original SoC that this
driver was developed for. By adding the regmap config to the quirks
then the driver can initialise the managed register map correctly.

Signed-off-by: Marcus Cooper <codekip...@gmail.com>
Reviewed-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-i2s.c | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index 9a35313c4f9b..f6f3c409f25e 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -94,11 +94,13 @@
  * struct sun4i_i2s_quirks - Differences between SoC variants.
  *
  * @has_reset: SoC needs reset deasserted.
+ * @sun4i_i2s_regmap: regmap config to use.
  * @mclk_offset: Value by which mclkdiv needs to be adjusted.
  * @bclk_offset: Value by which bclkdiv needs to be adjusted.
  */
 struct sun4i_i2s_quirks {
boolhas_reset;
+   const struct regmap_config  *sun4i_i2s_regmap;
unsigned intmclk_offset;
unsigned intbclk_offset;
 };
@@ -674,11 +676,13 @@ static int sun4i_i2s_runtime_suspend(struct device *dev)
 }
 
 static const struct sun4i_i2s_quirks sun4i_a10_i2s_quirks = {
-   .has_reset  = false,
+   .has_reset  = false,
+   .sun4i_i2s_regmap   = _i2s_regmap_config,
 };
 
 static const struct sun4i_i2s_quirks sun6i_a31_i2s_quirks = {
-   .has_reset  = true,
+   .has_reset  = true,
+   .sun4i_i2s_regmap   = _i2s_regmap_config,
 };
 
 static int sun4i_i2s_probe(struct platform_device *pdev)
@@ -717,7 +721,7 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
}
 
i2s->regmap = devm_regmap_init_mmio(>dev, regs,
-   _i2s_regmap_config);
+   i2s->variant->sun4i_i2s_regmap);
if (IS_ERR(i2s->regmap)) {
dev_err(>dev, "Regmap initialisation failed\n");
return PTR_ERR(i2s->regmap);
-- 
2.13.2

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sun4i-i2s: Add TX FIFO offset to quirks" to the asoc tree

2017-08-14 Thread Mark Brown
The patch

   ASoC: sun4i-i2s: Add TX FIFO offset to quirks

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 3509476e522baaa68813609801c48aa428bae81a Mon Sep 17 00:00:00 2001
From: Marcus Cooper <codekip...@gmail.com>
Date: Sat, 12 Aug 2017 13:00:51 +0200
Subject: [PATCH] ASoC: sun4i-i2s: Add TX FIFO offset to quirks

It has been seen that the newer SoCs have a different TX FIFO
address. Add this to the quirks structure.

Signed-off-by: Marcus Cooper <codekip...@gmail.com>
Reviewed-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-i2s.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index f6f3c409f25e..dfb79492 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -94,12 +94,14 @@
  * struct sun4i_i2s_quirks - Differences between SoC variants.
  *
  * @has_reset: SoC needs reset deasserted.
+ * @reg_offset_txdata: offset of the tx fifo.
  * @sun4i_i2s_regmap: regmap config to use.
  * @mclk_offset: Value by which mclkdiv needs to be adjusted.
  * @bclk_offset: Value by which bclkdiv needs to be adjusted.
  */
 struct sun4i_i2s_quirks {
boolhas_reset;
+   unsigned intreg_offset_txdata;  /* TX FIFO */
const struct regmap_config  *sun4i_i2s_regmap;
unsigned intmclk_offset;
unsigned intbclk_offset;
@@ -677,11 +679,13 @@ static int sun4i_i2s_runtime_suspend(struct device *dev)
 
 static const struct sun4i_i2s_quirks sun4i_a10_i2s_quirks = {
.has_reset  = false,
+   .reg_offset_txdata  = SUN4I_I2S_FIFO_TX_REG,
.sun4i_i2s_regmap   = _i2s_regmap_config,
 };
 
 static const struct sun4i_i2s_quirks sun6i_a31_i2s_quirks = {
.has_reset  = true,
+   .reg_offset_txdata  = SUN4I_I2S_FIFO_TX_REG,
.sun4i_i2s_regmap   = _i2s_regmap_config,
 };
 
@@ -750,7 +754,8 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
}
}
 
-   i2s->playback_dma_data.addr = res->start + SUN4I_I2S_FIFO_TX_REG;
+   i2s->playback_dma_data.addr = res->start +
+   i2s->variant->reg_offset_txdata;
i2s->playback_dma_data.maxburst = 8;
 
i2s->capture_dma_data.addr = res->start + SUN4I_I2S_FIFO_RX_REG;
-- 
2.13.2

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sun4i-i2s: Extend quirks scope" to the asoc tree

2017-08-02 Thread Mark Brown
The patch

   ASoC: sun4i-i2s: Extend quirks scope

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 47bea0c836867b6b1cdb714d58f2bfc8e2f5c386 Mon Sep 17 00:00:00 2001
From: Marcus Cooper <codekip...@gmail.com>
Date: Sat, 29 Jul 2017 16:17:42 +0200
Subject: [PATCH] ASoC: sun4i-i2s: Extend quirks scope

In preparation for the changes required to support newer SoCs then
quirks has been moved and also added to the device structure.

Signed-off-by: Marcus Cooper <codekip...@gmail.com>
Reviewed-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-i2s.c | 22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index 62b307b0c846..d7ee7a443e4e 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -90,6 +90,15 @@
 #define SUN4I_I2S_RX_CHAN_SEL_REG  0x38
 #define SUN4I_I2S_RX_CHAN_MAP_REG  0x3c
 
+/**
+ * struct sun4i_i2s_quirks - Differences between SoC variants.
+ *
+ * @has_reset: SoC needs reset deasserted.
+ */
+struct sun4i_i2s_quirks {
+   boolhas_reset;
+};
+
 struct sun4i_i2s {
struct clk  *bus_clk;
struct clk  *mod_clk;
@@ -100,6 +109,8 @@ struct sun4i_i2s {
 
struct snd_dmaengine_dai_dma_data   capture_dma_data;
struct snd_dmaengine_dai_dma_data   playback_dma_data;
+
+   const struct sun4i_i2s_quirks   *variant;
 };
 
 struct sun4i_i2s_clk_div {
@@ -654,10 +665,6 @@ static int sun4i_i2s_runtime_suspend(struct device *dev)
return 0;
 }
 
-struct sun4i_i2s_quirks {
-   bool has_reset;
-};
-
 static const struct sun4i_i2s_quirks sun4i_a10_i2s_quirks = {
.has_reset  = false,
 };
@@ -669,7 +676,6 @@ static const struct sun4i_i2s_quirks sun6i_a31_i2s_quirks = 
{
 static int sun4i_i2s_probe(struct platform_device *pdev)
 {
struct sun4i_i2s *i2s;
-   const struct sun4i_i2s_quirks *quirks;
struct resource *res;
void __iomem *regs;
int irq, ret;
@@ -690,8 +696,8 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
return irq;
}
 
-   quirks = of_device_get_match_data(>dev);
-   if (!quirks) {
+   i2s->variant = of_device_get_match_data(>dev);
+   if (!i2s->variant) {
dev_err(>dev, "Failed to determine the quirks to use\n");
return -ENODEV;
}
@@ -715,7 +721,7 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
return PTR_ERR(i2s->mod_clk);
}
 
-   if (quirks->has_reset) {
+   if (i2s->variant->has_reset) {
i2s->rst = devm_reset_control_get_exclusive(>dev, NULL);
if (IS_ERR(i2s->rst)) {
dev_err(>dev, "Failed to get reset control\n");
-- 
2.13.2

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] [PATCH 02/10] regulator: add support for SY8106A regulator

2017-07-24 Thread Mark Brown
On Mon, Jul 24, 2017 at 11:03:24AM +0800, Chen-Yu Tsai wrote:
> On Sun, Jul 23, 2017 at 6:27 PM, Icenowy Zheng  wrote:
> > From: Ondrej Jirman 
> >
> > SY8106A is an I2C attached single output regulator made by Silergy Corp,
> > which is used on several Allwinner H3/H5 SBCs to control the power
> > supply of the ARM cores.
> >
> > Add a driver for it.

Please delete unneeded context from mails when replying.  Doing this
makes it much easier to find your reply in the message, helping ensure
it won't be missed by people scrolling through the irrelevant quoted
material.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v13 05/14] ASoC: sun4i-codec: Merge sun4i_codec_left_mixer_controls and sun4i_codec_right_mixer_controls into sun4i_codec_mixer_controls.

2017-06-28 Thread Mark Brown
On Mon, Jun 26, 2017 at 09:48:59AM +0800, Chen-Yu Tsai wrote:
> On Sat, Jun 24, 2017 at 2:24 PM, Danny Milosavljevic

> > +static const struct snd_kcontrol_new sun4i_codec_mixer_controls[] = {
> > +   SOC_DAPM_DOUBLE("DAC Playback Switch", SUN4I_CODEC_DAC_ACTL,
> > +   SUN4I_CODEC_DAC_ACTL_LDACLMIXS,
> > SUN4I_CODEC_DAC_ACTL_RDACRMIXS, 1, 0),

> This changes the mixer control names exposed to userspace. While I think
> consolidating mixer controls is nice, giving the user a less cluttered
> view, I'm not sure about the changing a possible userspace ABI.

> Maxime, ALSA and ASoC people, any comments about this?

It's better not to change things but on the other hand it really depends
if there's any users who will notice - if nobody notices it doesn't
matter.

Can we *please* get some review of the rest of this series?  It's
enormous, we're on version *13* and the first review on this version
here is on patch 5.  If the first four patches are fine then please says
so, if they're not then let's have some review comments so things can
move towards merging them.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "ASoC: sun4i-codec: Add support for V3s codec" to the asoc tree

2017-06-06 Thread Mark Brown
The patch

   ASoC: sun4i-codec: Add support for V3s codec

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 8b2840b6daca728cecfa925b50bf638189e2fbca Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icen...@aosc.xyz>
Date: Mon, 5 Jun 2017 21:27:22 +0800
Subject: [PATCH] ASoC: sun4i-codec: Add support for V3s codec

The codec in the V3s is similar to the one found on the A31. One key
difference is the analog path controls are routed through the PRCM
block. This is supported by the sun8i-codec-analog driver, and tied
into this codec driver with the audio card's aux_dev.

In addition, the V3s does not have LINEIN, LINEOUT, MBIAS and MIC2,
MIC3, and the FIFO related registers are like H3.

Signed-off-by: Icenowy Zheng <icen...@aosc.xyz>
Reviewed-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Rob Herring <r...@kernel.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 .../devicetree/bindings/sound/sun4i-codec.txt  | 11 ++--
 sound/soc/sunxi/sun4i-codec.c  | 63 ++
 2 files changed, 70 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/sun4i-codec.txt 
b/Documentation/devicetree/bindings/sound/sun4i-codec.txt
index 3863531d1e6d..2d4e10deb6f4 100644
--- a/Documentation/devicetree/bindings/sound/sun4i-codec.txt
+++ b/Documentation/devicetree/bindings/sound/sun4i-codec.txt
@@ -7,6 +7,7 @@ Required properties:
- "allwinner,sun7i-a20-codec"
- "allwinner,sun8i-a23-codec"
- "allwinner,sun8i-h3-codec"
+   - "allwinner,sun8i-v3s-codec"
 - reg: must contain the registers location and length
 - interrupts: must contain the codec interrupt
 - dmas: DMA channels for tx and rx dma. See the DMA client binding,
@@ -25,6 +26,7 @@ Required properties for the following compatibles:
- "allwinner,sun6i-a31-codec"
- "allwinner,sun8i-a23-codec"
- "allwinner,sun8i-h3-codec"
+   - "allwinner,sun8i-v3s-codec"
 - resets: phandle to the reset control for this device
 - allwinner,audio-routing: A list of the connections between audio components.
   Each entry is a pair of strings, the first being the
@@ -34,15 +36,15 @@ Required properties for the following compatibles:
   Audio pins on the SoC:
   "HP"
   "HPCOM"
-  "LINEIN"
-  "LINEOUT"(not on sun8i-a23)
+  "LINEIN" (not on sun8i-v3s)
+  "LINEOUT"(not on sun8i-a23 or sun8i-v3s)
   "MIC1"
-  "MIC2"
+  "MIC2"   (not on sun8i-v3s)
   "MIC3"   (sun6i-a31 only)
 
   Microphone biases from the SoC:
   "HBIAS"
-  "MBIAS"
+  "MBIAS"  (not on sun8i-v3s)
 
   Board connectors:
   "Headphone"
@@ -55,6 +57,7 @@ Required properties for the following compatibles:
 Required properties for the following compatibles:
- "allwinner,sun8i-a23-codec"
- "allwinner,sun8i-h3-codec"
+   - "allwinner,sun8i-v3s-codec"
 - allwinner,codec-analog-controls: A phandle to the codec analog controls
   block in the PRCM.
 
diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index c3aab10fa085..150069987c0c 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -1339,6 +1339,44 @@ static struct snd_soc_card 
*sun8i_h3_codec_create_card(struct device *dev)
return card;
 };
 
+static struct snd_soc_card *sun8i_

[linux-sunxi] Applied "ASoC: sun8i-codec-analog: prepare a mixer control/widget/route set for V3s" to the asoc tree

2017-06-06 Thread Mark Brown
The patch

   ASoC: sun8i-codec-analog: prepare a mixer control/widget/route set for V3s

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 50aadc14cee74009c72e7d66954b15f27d45c02f Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icen...@aosc.io>
Date: Mon, 5 Jun 2017 21:27:20 +0800
Subject: [PATCH] ASoC: sun8i-codec-analog: prepare a mixer
 control/widget/route set for V3s

Allwinner V3s has an analog codec without MIC2 and Line In, which will
need a special set of mixer controls/widgets/routes, otherwise meaningless
controls will be exported to userspace and confuse the user.

Add the special set, and use it when the SoC has no MIC2 and Line In.

Signed-off-by: Icenowy Zheng <icen...@aosc.io>
Reviewed-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun8i-codec-analog.c | 101 ++-
 1 file changed, 100 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sunxi/sun8i-codec-analog.c 
b/sound/soc/sunxi/sun8i-codec-analog.c
index edcc3eb7cd9a..29c446068151 100644
--- a/sound/soc/sunxi/sun8i-codec-analog.c
+++ b/sound/soc/sunxi/sun8i-codec-analog.c
@@ -219,6 +219,22 @@ static const struct snd_kcontrol_new 
sun8i_codec_mixer_controls[] = {
  SUN8I_ADDA_LOMIXSC_MIC2, 1, 0),
 };
 
+/* mixer controls */
+static const struct snd_kcontrol_new sun8i_v3s_codec_mixer_controls[] = {
+   SOC_DAPM_DOUBLE_R("DAC Playback Switch",
+ SUN8I_ADDA_LOMIXSC,
+ SUN8I_ADDA_ROMIXSC,
+ SUN8I_ADDA_LOMIXSC_DACL, 1, 0),
+   SOC_DAPM_DOUBLE_R("DAC Reversed Playback Switch",
+ SUN8I_ADDA_LOMIXSC,
+ SUN8I_ADDA_ROMIXSC,
+ SUN8I_ADDA_LOMIXSC_DACR, 1, 0),
+   SOC_DAPM_DOUBLE_R("Mic1 Playback Switch",
+ SUN8I_ADDA_LOMIXSC,
+ SUN8I_ADDA_ROMIXSC,
+ SUN8I_ADDA_LOMIXSC_MIC1, 1, 0),
+};
+
 /* ADC mixer controls */
 static const struct snd_kcontrol_new sun8i_codec_adc_mixer_controls[] = {
SOC_DAPM_DOUBLE_R("Mixer Capture Switch",
@@ -243,6 +259,22 @@ static const struct snd_kcontrol_new 
sun8i_codec_adc_mixer_controls[] = {
  SUN8I_ADDA_LADCMIXSC_MIC2, 1, 0),
 };
 
+/* ADC mixer controls */
+static const struct snd_kcontrol_new sun8i_v3s_codec_adc_mixer_controls[] = {
+   SOC_DAPM_DOUBLE_R("Mixer Capture Switch",
+ SUN8I_ADDA_LADCMIXSC,
+ SUN8I_ADDA_RADCMIXSC,
+ SUN8I_ADDA_LADCMIXSC_OMIXRL, 1, 0),
+   SOC_DAPM_DOUBLE_R("Mixer Reversed Capture Switch",
+ SUN8I_ADDA_LADCMIXSC,
+ SUN8I_ADDA_RADCMIXSC,
+ SUN8I_ADDA_LADCMIXSC_OMIXRR, 1, 0),
+   SOC_DAPM_DOUBLE_R("Mic1 Capture Switch",
+ SUN8I_ADDA_LADCMIXSC,
+ SUN8I_ADDA_RADCMIXSC,
+ SUN8I_ADDA_LADCMIXSC_MIC1, 1, 0),
+};
+
 /* volume / mute controls */
 static const DECLARE_TLV_DB_SCALE(sun8i_codec_out_mixer_pregain_scale,
  -450, 150, 0);
@@ -292,8 +324,9 @@ static const struct snd_soc_dapm_widget 
sun8i_codec_common_widgets[] = {
/* Mic input path */
SND_SOC_DAPM_PGA("Mic1 Amplifier", SUN8I_ADDA_MIC1G_MICBIAS_CTRL,
 SUN8I_ADDA_MIC1G_MICBIAS_CTRL_MIC1AMPEN, 0, NULL, 0),
+};
 
-   /* Mixers */
+static const struct snd_soc_dapm_widget sun8i_codec_mixer_widgets[] = {
SND_SOC_DAPM_MIXER("Left Mixer", SUN8I_ADDA_DAC_PA_SRC,
   SUN8I_ADDA_DAC_PA_SRC_LMIXEN, 0,
   sun8i_codec_mixer_controls,
@@ -312,10 +345,31 @@ static const struct snd_soc_dapm_widget 
sun8i_codec_common_widgets[] = {
   ARRAY_SIZE(sun8i_codec_adc_mixer_controls)),
 };
 
+static const struct snd_soc_dapm_widget sun8i_v3s_codec_mixer_widgets[] = {
+

[linux-sunxi] Applied "ASoC: sun8i-codec-analog: add support for V3s SoC" to the asoc tree

2017-06-06 Thread Mark Brown
The patch

   ASoC: sun8i-codec-analog: add support for V3s SoC

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 2cfeaec0ec896bc0b8aad2de28a3de4572c7e4a1 Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icen...@aosc.xyz>
Date: Mon, 5 Jun 2017 21:27:21 +0800
Subject: [PATCH] ASoC: sun8i-codec-analog: add support for V3s SoC

The V3s SoC features an analog codec with headphone support but without
mic2 and linein.

Add support for it.

Signed-off-by: Icenowy Zheng <icen...@aosc.xyz>
Reviewed-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Rob Herring <r...@kernel.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt | 1 +
 sound/soc/sunxi/sun8i-codec-analog.c   | 9 +
 2 files changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt 
b/Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt
index 779b735781ba..1b6e7c4e50ab 100644
--- a/Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt
+++ b/Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt
@@ -4,6 +4,7 @@ Required properties:
 - compatible: must be one of the following compatibles:
- "allwinner,sun8i-a23-codec-analog"
- "allwinner,sun8i-h3-codec-analog"
+   - "allwinner,sun8i-v3s-codec-analog"
 
 Required properties if not a sub-node of the PRCM node:
 - reg: must contain the registers location and length
diff --git a/sound/soc/sunxi/sun8i-codec-analog.c 
b/sound/soc/sunxi/sun8i-codec-analog.c
index 29c446068151..485e79f292c4 100644
--- a/sound/soc/sunxi/sun8i-codec-analog.c
+++ b/sound/soc/sunxi/sun8i-codec-analog.c
@@ -810,6 +810,11 @@ static int sun8i_codec_analog_add_mixer(struct 
snd_soc_component *cmpnt,
return 0;
 }
 
+static const struct sun8i_codec_analog_quirks sun8i_v3s_quirks = {
+   .has_headphone  = true,
+   .has_hmic   = true,
+};
+
 static int sun8i_codec_analog_cmpnt_probe(struct snd_soc_component *cmpnt)
 {
struct device *dev = cmpnt->dev;
@@ -886,6 +891,10 @@ static const struct of_device_id 
sun8i_codec_analog_of_match[] = {
.compatible = "allwinner,sun8i-h3-codec-analog",
.data = _h3_quirks,
},
+   {
+   .compatible = "allwinner,sun8i-v3s-codec-analog",
+   .data = _v3s_quirks,
+   },
{}
 };
 MODULE_DEVICE_TABLE(of, sun8i_codec_analog_of_match);
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "regulator: axp20x-regulator: add support for AXP803" to the regulator tree

2017-05-19 Thread Mark Brown
The patch

   regulator: axp20x-regulator: add support for AXP803

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 1dbe0ccb0631c4ed399261934fe16f07407b078d Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icen...@aosc.io>
Date: Thu, 18 May 2017 15:16:49 +0800
Subject: [PATCH] regulator: axp20x-regulator: add support for AXP803

AXP803 PMIC also have a series of regulators (DCDCs and LDOs)
controllable via I2C/RSB bus.

Add support for them.

Signed-off-by: Icenowy Zheng <icen...@aosc.io>
Acked-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 drivers/regulator/axp20x-regulator.c | 153 ++-
 include/linux/mfd/axp20x.h   |  37 +
 2 files changed, 168 insertions(+), 22 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c 
b/drivers/regulator/axp20x-regulator.c
index 0b9d4e3e52c7..e2608fe770b9 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -244,6 +244,82 @@ static const struct regulator_desc 
axp22x_drivevbus_regulator = {
.ops= _ops_sw,
 };
 
+static const struct regulator_linear_range axp803_dcdc234_ranges[] = {
+   REGULATOR_LINEAR_RANGE(50, 0x0, 0x46, 1),
+   REGULATOR_LINEAR_RANGE(122, 0x47, 0x4b, 2),
+};
+
+static const struct regulator_linear_range axp803_dcdc5_ranges[] = {
+   REGULATOR_LINEAR_RANGE(80, 0x0, 0x20, 1),
+   REGULATOR_LINEAR_RANGE(114, 0x21, 0x44, 2),
+};
+
+static const struct regulator_linear_range axp803_dcdc6_ranges[] = {
+   REGULATOR_LINEAR_RANGE(60, 0x0, 0x32, 1),
+   REGULATOR_LINEAR_RANGE(112, 0x33, 0x47, 2),
+};
+
+/* AXP806's CLDO2 and AXP809's DLDO1 shares the same range */
+static const struct regulator_linear_range axp803_dldo2_ranges[] = {
+   REGULATOR_LINEAR_RANGE(70, 0x0, 0x1a, 10),
+   REGULATOR_LINEAR_RANGE(340, 0x1b, 0x1f, 20),
+};
+
+static const struct regulator_desc axp803_regulators[] = {
+   AXP_DESC(AXP803, DCDC1, "dcdc1", "vin1", 1600, 3400, 100,
+AXP803_DCDC1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL1, BIT(0)),
+   AXP_DESC_RANGES(AXP803, DCDC2, "dcdc2", "vin2", axp803_dcdc234_ranges,
+   76, AXP803_DCDC2_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+   BIT(1)),
+   AXP_DESC_RANGES(AXP803, DCDC3, "dcdc3", "vin3", axp803_dcdc234_ranges,
+   76, AXP803_DCDC3_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+   BIT(2)),
+   AXP_DESC_RANGES(AXP803, DCDC4, "dcdc4", "vin4", axp803_dcdc234_ranges,
+   76, AXP803_DCDC4_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+   BIT(3)),
+   AXP_DESC_RANGES(AXP803, DCDC5, "dcdc5", "vin5", axp803_dcdc5_ranges,
+   68, AXP803_DCDC5_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+   BIT(4)),
+   AXP_DESC_RANGES(AXP803, DCDC6, "dcdc6", "vin6", axp803_dcdc6_ranges,
+   72, AXP803_DCDC6_V_OUT, 0x7f, AXP22X_PWR_OUT_CTRL1,
+   BIT(5)),
+   /* secondary switchable output of DCDC1 */
+   AXP_DESC_SW(AXP803, DC1SW, "dc1sw", NULL, AXP22X_PWR_OUT_CTRL2,
+   BIT(7)),
+   AXP_DESC(AXP803, ALDO1, "aldo1", "aldoin", 700, 3300, 100,
+AXP22X_ALDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL3, BIT(5)),
+   AXP_DESC(AXP803, ALDO2, "aldo2", "aldoin", 700, 3300, 100,
+AXP22X_ALDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL3, BIT(6)),
+   AXP_DESC(AXP803, ALDO3, "aldo3", "aldoin", 700, 3300, 100,
+AXP22X_ALDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL3, BIT(7)),
+   AXP_DESC(AXP803, DLDO1, "dldo1", "dldoin", 700, 3300, 100,
+AXP22X_DLDO1_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(3)),
+   AXP_DESC_RANGES(AXP803, DLDO2, "dldo2", "dldoin", axp803_dldo2_ranges,
+

[linux-sunxi] Re: [PATCH v3 08/12] regulator: axp20x-regulator: add support for AXP803

2017-04-26 Thread Mark Brown
On Mon, Apr 17, 2017 at 07:57:43PM +0800, Icenowy Zheng wrote:
> AXP803 PMIC also have a series of regulators (DCDCs and LDOs)
> controllable via I2C/RSB bus.
> 
> Add support for them.
> 
> Signed-off-by: Icenowy Zheng <icen...@aosc.io>

Acked-by: Mark Brown <broo...@kernel.org>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "ASoC: sun8i-codec-analog: split out line in" to the asoc tree

2017-03-15 Thread Mark Brown
The patch

   ASoC: sun8i-codec-analog: split out line in

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 6ff4eb7e5d8aa4e5f4d6eb22be1deaae735de92c Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icen...@aosc.xyz>
Date: Sun, 5 Mar 2017 21:36:59 +0800
Subject: [PATCH] ASoC: sun8i-codec-analog: split out line in

Allwinner V3s features an analog codec without LINEIN.

Split out this part, in order to prepare for the V3s analog codec.

Signed-off-by: Icenowy Zheng <icen...@aosc.xyz>
Acked-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun8i-codec-analog.c | 76 ++--
 1 file changed, 65 insertions(+), 11 deletions(-)

diff --git a/sound/soc/sunxi/sun8i-codec-analog.c 
b/sound/soc/sunxi/sun8i-codec-analog.c
index b95ff045cd7f..6c17c99c2c8d 100644
--- a/sound/soc/sunxi/sun8i-codec-analog.c
+++ b/sound/soc/sunxi/sun8i-codec-analog.c
@@ -252,10 +252,7 @@ static const 
DECLARE_TLV_DB_RANGE(sun8i_codec_mic_gain_scale,
 );
 
 static const struct snd_kcontrol_new sun8i_codec_common_controls[] = {
-   /* Mixer pre-gains */
-   SOC_SINGLE_TLV("Line In Playback Volume", SUN8I_ADDA_LINEIN_GCTRL,
-  SUN8I_ADDA_LINEIN_GCTRL_LINEING,
-  0x7, 0, sun8i_codec_out_mixer_pregain_scale),
+   /* Mixer pre-gain */
SOC_SINGLE_TLV("Mic1 Playback Volume", SUN8I_ADDA_MICIN_GCTRL,
   SUN8I_ADDA_MICIN_GCTRL_MIC1G,
   0x7, 0, sun8i_codec_out_mixer_pregain_scale),
@@ -289,9 +286,6 @@ static const struct snd_soc_dapm_widget 
sun8i_codec_common_widgets[] = {
 * stream widgets at the card level.
 */
 
-   /* Line In */
-   SND_SOC_DAPM_INPUT("LINEIN"),
-
/* Microphone input */
SND_SOC_DAPM_INPUT("MIC1"),
 
@@ -330,25 +324,21 @@ static const struct snd_soc_dapm_route 
sun8i_codec_common_routes[] = {
/* Left Mixer Routes */
{ "Left Mixer", "DAC Playback Switch", "Left DAC" },
{ "Left Mixer", "DAC Reversed Playback Switch", "Right DAC" },
-   { "Left Mixer", "Line In Playback Switch", "LINEIN" },
{ "Left Mixer", "Mic1 Playback Switch", "Mic1 Amplifier" },
 
/* Right Mixer Routes */
{ "Right Mixer", "DAC Playback Switch", "Right DAC" },
{ "Right Mixer", "DAC Reversed Playback Switch", "Left DAC" },
-   { "Right Mixer", "Line In Playback Switch", "LINEIN" },
{ "Right Mixer", "Mic1 Playback Switch", "Mic1 Amplifier" },
 
/* Left ADC Mixer Routes */
{ "Left ADC Mixer", "Mixer Capture Switch", "Left Mixer" },
{ "Left ADC Mixer", "Mixer Reversed Capture Switch", "Right Mixer" },
-   { "Left ADC Mixer", "Line In Capture Switch", "LINEIN" },
{ "Left ADC Mixer", "Mic1 Capture Switch", "Mic1 Amplifier" },
 
/* Right ADC Mixer Routes */
{ "Right ADC Mixer", "Mixer Capture Switch", "Right Mixer" },
{ "Right ADC Mixer", "Mixer Reversed Capture Switch", "Left Mixer" },
-   { "Right ADC Mixer", "Line In Capture Switch", "LINEIN" },
{ "Right ADC Mixer", "Mic1 Capture Switch", "Mic1 Amplifier" },
 
/* ADC Routes */
@@ -484,6 +474,61 @@ static int sun8i_codec_add_hmic(struct snd_soc_component 
*cmpnt)
return ret;
 }
 
+/* line in specific controls, widgets and rines */
+static const struct snd_kcontrol_new sun8i_codec_linein_controls[] = {
+   /* Mixer pre-gain */
+   SOC_SINGLE_TLV("Line In Playback Volume", SUN8I_ADDA_LINEIN_GCTRL,
+  SUN8I_ADDA_LINEIN_GCTRL_LINEING,
+   

[linux-sunxi] Applied "ASoC: sun8i-codec-analog: split out mic2" to the asoc tree

2017-03-15 Thread Mark Brown
The patch

   ASoC: sun8i-codec-analog: split out mic2

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 3f48947d56ff3e42e2e490714025e984af817f5d Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icen...@aosc.xyz>
Date: Sun, 5 Mar 2017 21:36:58 +0800
Subject: [PATCH] ASoC: sun8i-codec-analog: split out mic2

Allwinner V3s features an analog codec without MIC2.

Split out this part, in order to prepare for the V3s analog codec.

Signed-off-by: Icenowy Zheng <icen...@aosc.xyz>
Acked-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun8i-codec-analog.c | 92 +---
 1 file changed, 76 insertions(+), 16 deletions(-)

diff --git a/sound/soc/sunxi/sun8i-codec-analog.c 
b/sound/soc/sunxi/sun8i-codec-analog.c
index 72331332b72e..b95ff045cd7f 100644
--- a/sound/soc/sunxi/sun8i-codec-analog.c
+++ b/sound/soc/sunxi/sun8i-codec-analog.c
@@ -259,17 +259,11 @@ static const struct snd_kcontrol_new 
sun8i_codec_common_controls[] = {
SOC_SINGLE_TLV("Mic1 Playback Volume", SUN8I_ADDA_MICIN_GCTRL,
   SUN8I_ADDA_MICIN_GCTRL_MIC1G,
   0x7, 0, sun8i_codec_out_mixer_pregain_scale),
-   SOC_SINGLE_TLV("Mic2 Playback Volume",
-  SUN8I_ADDA_MICIN_GCTRL, SUN8I_ADDA_MICIN_GCTRL_MIC2G,
-  0x7, 0, sun8i_codec_out_mixer_pregain_scale),
 
-   /* Microphone Amp boost gains */
+   /* Microphone Amp boost gain */
SOC_SINGLE_TLV("Mic1 Boost Volume", SUN8I_ADDA_MIC1G_MICBIAS_CTRL,
   SUN8I_ADDA_MIC1G_MICBIAS_CTRL_MIC1BOOST, 0x7, 0,
   sun8i_codec_mic_gain_scale),
-   SOC_SINGLE_TLV("Mic2 Boost Volume", SUN8I_ADDA_MIC2G_CTRL,
-  SUN8I_ADDA_MIC2G_CTRL_MIC2BOOST, 0x7, 0,
-  sun8i_codec_mic_gain_scale),
 
/* ADC */
SOC_SINGLE_TLV("ADC Gain Capture Volume", SUN8I_ADDA_ADC_AP_EN,
@@ -298,9 +292,8 @@ static const struct snd_soc_dapm_widget 
sun8i_codec_common_widgets[] = {
/* Line In */
SND_SOC_DAPM_INPUT("LINEIN"),
 
-   /* Microphone inputs */
+   /* Microphone input */
SND_SOC_DAPM_INPUT("MIC1"),
-   SND_SOC_DAPM_INPUT("MIC2"),
 
/* Microphone Bias */
SND_SOC_DAPM_SUPPLY("MBIAS", SUN8I_ADDA_MIC1G_MICBIAS_CTRL,
@@ -310,8 +303,6 @@ static const struct snd_soc_dapm_widget 
sun8i_codec_common_widgets[] = {
/* Mic input path */
SND_SOC_DAPM_PGA("Mic1 Amplifier", SUN8I_ADDA_MIC1G_MICBIAS_CTRL,
 SUN8I_ADDA_MIC1G_MICBIAS_CTRL_MIC1AMPEN, 0, NULL, 0),
-   SND_SOC_DAPM_PGA("Mic2 Amplifier", SUN8I_ADDA_MIC2G_CTRL,
-SUN8I_ADDA_MIC2G_CTRL_MIC2AMPEN, 0, NULL, 0),
 
/* Mixers */
SND_SOC_DAPM_MIXER("Left Mixer", SUN8I_ADDA_DAC_PA_SRC,
@@ -335,35 +326,30 @@ static const struct snd_soc_dapm_widget 
sun8i_codec_common_widgets[] = {
 static const struct snd_soc_dapm_route sun8i_codec_common_routes[] = {
/* Microphone Routes */
{ "Mic1 Amplifier", NULL, "MIC1"},
-   { "Mic2 Amplifier", NULL, "MIC2"},
 
/* Left Mixer Routes */
{ "Left Mixer", "DAC Playback Switch", "Left DAC" },
{ "Left Mixer", "DAC Reversed Playback Switch", "Right DAC" },
{ "Left Mixer", "Line In Playback Switch", "LINEIN" },
{ "Left Mixer", "Mic1 Playback Switch", "Mic1 Amplifier" },
-   { "Left Mixer", "Mic2 Playback Switch", "Mic2 Amplifier" },
 
/* Right Mixer Routes */
{ "Right Mixer", "DAC Playback Switch", "Right DAC" },
{ "Right Mixer", "DAC Reversed Playback Switch", "Left DAC" },
{ "Right Mixer", "Line In Playback Switch", "LINEIN" },
{

[linux-sunxi] Re: How to handle quirky behavior with boards.

2017-03-15 Thread Mark Brown
On Fri, Mar 03, 2017 at 04:31:43PM +0100, Olliver Schinagl wrote:

> So my question is, what is there against moving some of the constrants
> before the always-on, so that the enable can atleast function properly
> according to its parameters?

No, and in general please don't ask to send patches - just send patches
with any explanation/discussion in the cover letter and/or commit log.
That tends to make things go faster as the code can make any issues more
obvious and if there's no problem then patches can just be applied
immediately.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH] spi/sun6i: Add Master Sample Data Mode for SPI

2017-02-13 Thread Mark Brown
On Mon, Feb 13, 2017 at 04:00:09PM -0300, Vinicius Maciel wrote:
> Hi Mark,

Please don't top post, reply in line with needed context.  This allows
readers to readily follow the flow of conversation and understand what
you are talking about and also helps ensure that everything in the
discussion is being addressed.

> Sorry for the mess up. sun6i is a reference to the Allwinner A31 processor
> and sun7i is a reference to the Allwinner A20 processor. A31 uses
> spi-sun6i.c code, while A20 uses spi-sun4i.c code. Therefore, this is a
> different patch.
> About your recommedantion, I have to check with Maxine what can be done.

Usually duplicate patches to the two drivers are sent as a series to
make sure it's the same thing being done twice.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v2] ARM: spi/sun7i: Add Master Sample Data Mode for SPI

2017-02-13 Thread Mark Brown
On Sat, Feb 11, 2017 at 12:54:47AM -0300, Vinicius Maciel wrote:
> In order to work appropriately, the max11043 ADC chip and probably
> others, needs SPI master samples the data at the correct edge. From
> max11043 datasheet: "The data at DIN is latched on the rising edge
> of SCLK". Same to DOUT.
> 
> This patch add Master Sample Data Mode bit in normal sample mode.
> It will affect only A20.

This should be controlled by the SPI mode settings, different chips have
different requirements.  If the controller supports multiple modes then
it should expose that and let the drivers and system integrations
choose.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "ASoC: sunxi: allow the analog codec driver to be built on ARM64" to the asoc tree

2017-02-08 Thread Mark Brown
The patch

   ASoC: sunxi: allow the analog codec driver to be built on ARM64

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From e5028a259733ec2324893cb481023ed6cf7e9723 Mon Sep 17 00:00:00 2001
From: Icenowy Zheng <icen...@aosc.xyz>
Date: Wed, 8 Feb 2017 02:30:40 +0800
Subject: [PATCH] ASoC: sunxi: allow the analog codec driver to be built on
 ARM64

As the 64-bit Allwinner H5 SoC has the same analog codec part (also the
same digital part) as H3, enable the driver to be built on ARM64
Allwinner platform, so that it can be used on H5.

Signed-off-by: Icenowy Zheng <icen...@aosc.xyz>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Acked-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sunxi/Kconfig b/sound/soc/sunxi/Kconfig
index 13a8267f17c7..22408bc2d6ec 100644
--- a/sound/soc/sunxi/Kconfig
+++ b/sound/soc/sunxi/Kconfig
@@ -22,7 +22,7 @@ config SND_SUN8I_CODEC
 
 config SND_SUN8I_CODEC_ANALOG
tristate "Allwinner sun8i Codec Analog Controls Support"
-   depends on MACH_SUN8I || COMPILE_TEST
+   depends on MACH_SUN8I || (ARM64 && ARCH_SUNXI) || COMPILE_TEST
select REGMAP
help
  Say Y or M if you want to add support for the analog controls for
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sun8i-codec-analog: Add amplifier event to fix first delay" to the asoc tree

2017-02-03 Thread Mark Brown
The patch

   ASoC: sun8i-codec-analog: Add amplifier event to fix first delay

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From bf14da7e55169964a1e6f35dc9d7428dc9e9013c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Myl=C3=A8ne=20Josserand?=
 <mylene.josser...@free-electrons.com>
Date: Thu, 2 Feb 2017 10:24:18 +0100
Subject: [PATCH] ASoC: sun8i-codec-analog: Add amplifier event to fix first
 delay
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When playing a sound for the first time, a short delay, where the audio
file is not played, can be noticed.
On a second play (right after), the sound is played correctly.
If we wait a short time (~5 sec which corresponds to the aplay
timeout), the delay is back.

This patch fixes it by using an event on headphone amplifier.
It allows to keep the amplifier enable while playing a sound.
A delay of 700ms allows to wait that the amplifier is powered-up
before playing the sound.

Signed-off-by: Mylène Josserand <mylene.josser...@free-electrons.com>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun8i-codec-analog.c | 30 --
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sunxi/sun8i-codec-analog.c 
b/sound/soc/sunxi/sun8i-codec-analog.c
index af02290ebe49..72331332b72e 100644
--- a/sound/soc/sunxi/sun8i-codec-analog.c
+++ b/sound/soc/sunxi/sun8i-codec-analog.c
@@ -398,11 +398,37 @@ static const struct snd_kcontrol_new sun8i_codec_hp_src[] 
= {
  sun8i_codec_hp_src_enum),
 };
 
+static int sun8i_headphone_amp_event(struct snd_soc_dapm_widget *w,
+struct snd_kcontrol *k, int event)
+{
+   struct snd_soc_component *component = 
snd_soc_dapm_to_component(w->dapm);
+
+   if (SND_SOC_DAPM_EVENT_ON(event)) {
+   snd_soc_component_update_bits(component, 
SUN8I_ADDA_PAEN_HP_CTRL,
+ 
BIT(SUN8I_ADDA_PAEN_HP_CTRL_HPPAEN),
+ 
BIT(SUN8I_ADDA_PAEN_HP_CTRL_HPPAEN));
+   /*
+* Need a delay to have the amplifier up. 700ms seems the best
+* compromise between the time to let the amplifier up and the
+* time not to feel this delay while playing a sound.
+*/
+   msleep(700);
+   } else if (SND_SOC_DAPM_EVENT_OFF(event)) {
+   snd_soc_component_update_bits(component, 
SUN8I_ADDA_PAEN_HP_CTRL,
+ 
BIT(SUN8I_ADDA_PAEN_HP_CTRL_HPPAEN),
+ 0x0);
+   }
+
+   return 0;
+}
+
 static const struct snd_soc_dapm_widget sun8i_codec_headphone_widgets[] = {
SND_SOC_DAPM_MUX("Headphone Source Playback Route",
 SND_SOC_NOPM, 0, 0, sun8i_codec_hp_src),
-   SND_SOC_DAPM_OUT_DRV("Headphone Amp", SUN8I_ADDA_PAEN_HP_CTRL,
-SUN8I_ADDA_PAEN_HP_CTRL_HPPAEN, 0, NULL, 0),
+   SND_SOC_DAPM_OUT_DRV_E("Headphone Amp", SUN8I_ADDA_PAEN_HP_CTRL,
+  SUN8I_ADDA_PAEN_HP_CTRL_HPPAEN, 0, NULL, 0,
+  sun8i_headphone_amp_event,
+  SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD),
SND_SOC_DAPM_SUPPLY("HPCOM Protection", SUN8I_ADDA_PAEN_HP_CTRL,
SUN8I_ADDA_PAEN_HP_CTRL_COMPTEN, 0, NULL, 0),
SND_SOC_DAPM_REG(snd_soc_dapm_supply, "HPCOM", SUN8I_ADDA_PAEN_HP_CTRL,
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "regulator: axp20x: AXP806: Fix dcdcb being set instead of dcdce" to the regulator tree

2017-01-24 Thread Mark Brown
The patch

   regulator: axp20x: AXP806: Fix dcdcb being set instead of dcdce

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From d0e287a401d9acf67b75180b26e2d62b7d482652 Mon Sep 17 00:00:00 2001
From: Rask Ingemann Lambertsen <r...@formelder.dk>
Date: Sat, 21 Jan 2017 17:11:43 +0100
Subject: [PATCH] regulator: axp20x: AXP806: Fix dcdcb being set instead of
 dcdce

A typo or copy-paste bug means that the register access intended for
regulator dcdce goes to dcdcb instead. This patch corrects it.

Fixes: 2ca342d391e3 (regulator: axp20x: Support AXP806 variant)
Signed-off-by: Rask Ingemann Lambertsen <r...@formelder.dk>
Acked-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
Cc: sta...@vger.kernel.org
---
 drivers/regulator/axp20x-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/axp20x-regulator.c 
b/drivers/regulator/axp20x-regulator.c
index e6a512ebeae2..a3ade9e4ef47 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -272,7 +272,7 @@ static const struct regulator_desc axp806_regulators[] = {
64, AXP806_DCDCD_V_CTRL, 0x3f, AXP806_PWR_OUT_CTRL1,
BIT(3)),
AXP_DESC(AXP806, DCDCE, "dcdce", "vine", 1100, 3400, 100,
-AXP806_DCDCB_V_CTRL, 0x1f, AXP806_PWR_OUT_CTRL1, BIT(4)),
+AXP806_DCDCE_V_CTRL, 0x1f, AXP806_PWR_OUT_CTRL1, BIT(4)),
AXP_DESC(AXP806, ALDO1, "aldo1", "aldoin", 700, 3300, 100,
 AXP806_ALDO1_V_CTRL, 0x1f, AXP806_PWR_OUT_CTRL1, BIT(5)),
AXP_DESC(AXP806, ALDO2, "aldo2", "aldoin", 700, 3400, 100,
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sunxi: Add bindings for sun8i to SPDIF" to the asoc tree

2017-01-20 Thread Mark Brown
The patch

   ASoC: sunxi: Add bindings for sun8i to SPDIF

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From cb5c978f9a56c459d5f13901efcfe44b97c4182d Mon Sep 17 00:00:00 2001
From: Marcus Cooper <codekip...@gmail.com>
Date: Thu, 19 Jan 2017 20:52:57 +0100
Subject: [PATCH] ASoC: sunxi: Add bindings for sun8i to SPDIF

The H3 SoC uses the same SPDIF block as found in earlier SoCs, but the
transmit fifo is at a different address.

Signed-off-by: Marcus Cooper <codekip...@gmail.com>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 Documentation/devicetree/bindings/sound/sunxi,sun4i-spdif.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/sound/sunxi,sun4i-spdif.txt 
b/Documentation/devicetree/bindings/sound/sunxi,sun4i-spdif.txt
index 0230c4d20506..fe0a65e6d629 100644
--- a/Documentation/devicetree/bindings/sound/sunxi,sun4i-spdif.txt
+++ b/Documentation/devicetree/bindings/sound/sunxi,sun4i-spdif.txt
@@ -10,6 +10,7 @@ Required properties:
   - compatible : should be one of the following:
 - "allwinner,sun4i-a10-spdif": for the Allwinner A10 SoC
 - "allwinner,sun6i-a31-spdif": for the Allwinner A31 SoC
+- "allwinner,sun8i-h3-spdif": for the Allwinner H3 SoC
 
   - reg: Offset and length of the register set for the 
device.
 
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sun4i-spdif: Add support for the H3 SoC" to the asoc tree

2017-01-20 Thread Mark Brown
The patch

   ASoC: sun4i-spdif: Add support for the H3 SoC

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 1bd92af877abfeddcc4b83a35482ed4139591acf Mon Sep 17 00:00:00 2001
From: Marcus Cooper <codekip...@gmail.com>
Date: Thu, 19 Jan 2017 20:52:58 +0100
Subject: [PATCH] ASoC: sun4i-spdif: Add support for the H3 SoC

The H3 SoC uses the same SPDIF block as found in earlier SoCs, but its
TXFIFO is mapped to another address.

Signed-off-by: Marcus Cooper <codekip...@gmail.com>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-spdif.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
index fec62ee1fc72..c03cd07a9b19 100644
--- a/sound/soc/sunxi/sun4i-spdif.c
+++ b/sound/soc/sunxi/sun4i-spdif.c
@@ -103,6 +103,8 @@
#define SUN4I_SPDIF_ISTA_RXOSTA BIT(1)
#define SUN4I_SPDIF_ISTA_RXASTA BIT(0)
 
+#define SUN8I_SPDIF_TXFIFO (0x20)
+
 #define SUN4I_SPDIF_TXCNT  (0x24)
 
 #define SUN4I_SPDIF_RXCNT  (0x28)
@@ -417,6 +419,11 @@ static const struct sun4i_spdif_quirks 
sun6i_a31_spdif_quirks = {
.has_reset  = true,
 };
 
+static const struct sun4i_spdif_quirks sun8i_h3_spdif_quirks = {
+   .reg_dac_txdata = SUN8I_SPDIF_TXFIFO,
+   .has_reset  = true,
+};
+
 static const struct of_device_id sun4i_spdif_of_match[] = {
{
.compatible = "allwinner,sun4i-a10-spdif",
@@ -426,6 +433,10 @@ static const struct of_device_id sun4i_spdif_of_match[] = {
.compatible = "allwinner,sun6i-a31-spdif",
.data = _a31_spdif_quirks,
},
+   {
+   .compatible = "allwinner,sun8i-h3-spdif",
+   .data = _h3_spdif_quirks,
+   },
{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, sun4i_spdif_of_match);
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: [PATCH] ASoC: sunxi: Add bindings for sun8i to SPDIF

2017-01-19 Thread Mark Brown
On Wed, Jan 18, 2017 at 08:09:00AM +0100, Code Kipper wrote:

> I missed the binding documentation on the patch for the driver so I
> pushed it separately instead of pushing a new patch version.
> You can find it under the subject heading 'ASoC: sun4i-spdif: Add
> support for the H3 SoC' and Maxime has ACK it (on the condition that I
> add the binding doc).

I don't seem to have that patch.  If Maxime said it needed changes for
him to ack it there's every chance I just deleted it waiting for you to
resend, it's certainly confusing to see a patch like this without the
matching code.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "ASoC: sun4i-i2s: Increase DMA max burst to 8" to the asoc tree

2017-01-17 Thread Mark Brown
The patch

   ASoC: sun4i-i2s: Increase DMA max burst to 8

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From ebad64d19377957976963f99ce1fcf2f09796357 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Myl=C3=A8ne=20Josserand?=
 <mylene.josser...@free-electrons.com>
Date: Tue, 17 Jan 2017 15:02:21 +0100
Subject: [PATCH] ASoC: sun4i-i2s: Increase DMA max burst to 8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As done previously for sun4i-codec, the DMA maxburst of 4
is not supported by every SoCs so the DMA controller engine
returns "unsupported value".

As a maxburst of 8 is supported by all variants, this patch
increases it to 8.

For more details, see commit from Chen-Yu Tsai:
commit 730e2dd0cbc7 ("ASoC: sun4i-codec: Increase DMA max burst to 8")

Signed-off-by: Mylène Josserand <mylene.josser...@free-electrons.com>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-i2s.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index f24d19526603..4237323ef594 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -694,10 +694,10 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
}

i2s->playback_dma_data.addr = res->start + SUN4I_I2S_FIFO_TX_REG;
-   i2s->playback_dma_data.maxburst = 4;
+   i2s->playback_dma_data.maxburst = 8;
 
i2s->capture_dma_data.addr = res->start + SUN4I_I2S_FIFO_RX_REG;
-   i2s->capture_dma_data.maxburst = 4;
+   i2s->capture_dma_data.maxburst = 8;
 
pm_runtime_enable(>dev);
if (!pm_runtime_enabled(>dev)) {
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH] ASoC: sunxi: Add bindings for sun8i to SPDIF

2017-01-17 Thread Mark Brown
On Thu, Jan 12, 2017 at 06:33:43PM +0100, codekip...@gmail.com wrote:
> From: Marcus Cooper 
> 
> The H3 SoC uses the same SPDIF block as found in earlier SoCs, but the
> transmit fifo is at a different address.
> 
> Signed-off-by: Marcus Cooper 
> ---
>  Documentation/devicetree/bindings/sound/sunxi,sun4i-spdif.txt | 1 +
>  1 file changed, 1 insertion(+)

This is fine but it doesn't actually add the compatible string to the
driver which I'd expect.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v2 07/10] dt-bindings: sound: Add sun8i audio documentation

2017-01-17 Thread Mark Brown
On Tue, Jan 17, 2017 at 03:02:27PM +0100, Mylène Josserand wrote:
> Add the documentation for dt-binding of the digital audio codec driver
> and the audio card driver for Sun8i SoCs.


Please submit patches using subject lines reflecting the style for the
subsystem.  This makes it easier for people to identify relevant
patches.  Look at what existing commits in the area you're changing are
doing and make sure your subject lines visually resemble what they're
doing.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "ASoC: sun4i-codec: Add "Right Mixer" to "Line Out Mono Diff." route" to the asoc tree

2017-01-09 Thread Mark Brown
The patch

   ASoC: sun4i-codec: Add "Right Mixer" to "Line Out Mono Diff." route

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 19426bdedb72b965db0ebf2106e95e9eeb3b5935 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Sun, 8 Jan 2017 02:57:06 +0800
Subject: [PATCH] ASoC: sun4i-codec: Add "Right Mixer" to "Line Out Mono Diff."
 route

The mono differential output for "Line Out" downmixes the stereo audio
from the mixer, instead of just taking the left channel.

Add a route from the "Right Mixer" to "Line Out Source Playback Route"
through the "Mono Differential" path, so DAPM doesn't shut down
everything if the left channel is muted.

Fixes: 0f909f98d7cb ("ASoC: sun4i-codec: Add support for A31 Line Out
  playback")
Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-codec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 848af01692a0..c3aab10fa085 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -1058,6 +1058,7 @@ static const struct snd_soc_dapm_route 
sun6i_codec_codec_dapm_routes[] = {
{ "Line Out Source Playback Route", "Stereo", "Left Mixer" },
{ "Line Out Source Playback Route", "Stereo", "Right Mixer" },
{ "Line Out Source Playback Route", "Mono Differential", "Left Mixer" },
+   { "Line Out Source Playback Route", "Mono Differential", "Right Mixer" 
},
{ "LINEOUT", NULL, "Line Out Source Playback Route" },
 
/* ADC Routes */
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sun4i-spdif: remove legacy dapm components" to the asoc tree

2016-12-31 Thread Mark Brown
The patch

   ASoC: sun4i-spdif: remove legacy dapm components

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 96e53c41e1f81c9e9d1ce38d3f28b95668b71dcf Mon Sep 17 00:00:00 2001
From: Marcus Cooper <codekip...@gmail.com>
Date: Tue, 20 Dec 2016 15:49:13 +0100
Subject: [PATCH] ASoC: sun4i-spdif: remove legacy dapm components

The dapm components are now handled by the ALSA SoC SPDIF DIT driver
so can be removed.

Signed-off-by: Marcus Cooper <codekip...@gmail.com>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-spdif.c | 8 
 1 file changed, 8 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
index 88fbb3a1e660..048de15d6937 100644
--- a/sound/soc/sunxi/sun4i-spdif.c
+++ b/sound/soc/sunxi/sun4i-spdif.c
@@ -403,14 +403,6 @@ static struct snd_soc_dai_driver sun4i_spdif_dai = {
.name = "spdif",
 };
 
-static const struct snd_soc_dapm_widget dit_widgets[] = {
-   SND_SOC_DAPM_OUTPUT("spdif-out"),
-};
-
-static const struct snd_soc_dapm_route dit_routes[] = {
-   { "spdif-out", NULL, "Playback" },
-};
-
 static const struct of_device_id sun4i_spdif_of_match[] = {
{ .compatible = "allwinner,sun4i-a10-spdif", },
{ .compatible = "allwinner,sun6i-a31-spdif", },
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sun4i-spdif: Add quirks to the spdif driver" to the asoc tree

2016-12-31 Thread Mark Brown
The patch

   ASoC: sun4i-spdif: Add quirks to the spdif driver

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 7762681a3ada5fca6017e75ea7f9cdac08fc50b9 Mon Sep 17 00:00:00 2001
From: Marcus Cooper <codekip...@gmail.com>
Date: Tue, 20 Dec 2016 15:49:14 +0100
Subject: [PATCH] ASoC: sun4i-spdif: Add quirks to the spdif driver

It has been seen that some newer SoCs have a different TX FIFO
address and we already have the difference with the A31 requiring
a reset. Add a quirks structure so that these can be managed
easily.

Signed-off-by: Marcus Cooper <codekip...@gmail.com>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-spdif.c | 36 +++-
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c
index 048de15d6937..fec62ee1fc72 100644
--- a/sound/soc/sunxi/sun4i-spdif.c
+++ b/sound/soc/sunxi/sun4i-spdif.c
@@ -403,9 +403,29 @@ static struct snd_soc_dai_driver sun4i_spdif_dai = {
.name = "spdif",
 };
 
+struct sun4i_spdif_quirks {
+   unsigned int reg_dac_txdata;/* TX FIFO offset for DMA config */
+   bool has_reset;
+};
+
+static const struct sun4i_spdif_quirks sun4i_a10_spdif_quirks = {
+   .reg_dac_txdata = SUN4I_SPDIF_TXFIFO,
+};
+
+static const struct sun4i_spdif_quirks sun6i_a31_spdif_quirks = {
+   .reg_dac_txdata = SUN4I_SPDIF_TXFIFO,
+   .has_reset  = true,
+};
+
 static const struct of_device_id sun4i_spdif_of_match[] = {
-   { .compatible = "allwinner,sun4i-a10-spdif", },
-   { .compatible = "allwinner,sun6i-a31-spdif", },
+   {
+   .compatible = "allwinner,sun4i-a10-spdif",
+   .data = _a10_spdif_quirks,
+   },
+   {
+   .compatible = "allwinner,sun6i-a31-spdif",
+   .data = _a31_spdif_quirks,
+   },
{ /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, sun4i_spdif_of_match);
@@ -438,6 +458,7 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
 {
struct sun4i_spdif_dev *host;
struct resource *res;
+   const struct sun4i_spdif_quirks *quirks;
int ret;
void __iomem *base;
 
@@ -459,6 +480,12 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
if (IS_ERR(base))
return PTR_ERR(base);
 
+   quirks = of_device_get_match_data(>dev);
+   if (quirks == NULL) {
+   dev_err(>dev, "Failed to determine the quirks to use\n");
+   return -ENODEV;
+   }
+
host->regmap = devm_regmap_init_mmio(>dev, base,
_spdif_regmap_config);
 
@@ -476,14 +503,13 @@ static int sun4i_spdif_probe(struct platform_device *pdev)
goto err_disable_apb_clk;
}
 
-   host->dma_params_tx.addr = res->start + SUN4I_SPDIF_TXFIFO;
+   host->dma_params_tx.addr = res->start + quirks->reg_dac_txdata;
host->dma_params_tx.maxburst = 8;
host->dma_params_tx.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
 
platform_set_drvdata(pdev, host);
 
-   if (of_device_is_compatible(pdev->dev.of_node,
-   "allwinner,sun6i-a31-spdif")) {
+   if (quirks->has_reset) {
host->rst = devm_reset_control_get_optional(>dev, NULL);
if (IS_ERR(host->rst) && PTR_ERR(host->rst) == -EPROBE_DEFER) {
ret = -EPROBE_DEFER;
-- 
2.11.0

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v2 2/2] mfd: axp20x: Fix AXP806 access errors on cold boot

2016-12-14 Thread Mark Brown
On Wed, Dec 14, 2016 at 09:52:31PM +0800, Chen-Yu Tsai wrote:

> What this patch does is make sure the registers match, to guarantee
> access, and then reinitialize the regmap cache to get rid of any
> stale data.

So what you're saying is that previous writes may have been ignored?

> > If the chip has been reset then you'd want to reset the cache too.  I've
> > no idea if that's needed here or not though, it depends what happens to
> > the global state of the chip when this reconfiguration happens.

> It is not a reset in the general sense. I suppose a better way would
> be to do an explicit write to the register first, then initialize
> the regmap. I'd have to export the write function from the RSB bus
> driver first though.

Surely just doing a write immediately after initializing the regmap
would have the same effect?  That'd ensure that the hardware has the
desired value before there are any other writes.  But I might be missing
something here.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v2 2/2] mfd: axp20x: Fix AXP806 access errors on cold boot

2016-12-13 Thread Mark Brown
On Fri, Dec 09, 2016 at 11:20:18AM +, Lee Jones wrote:

> Is the following valid/necessary?

> On Wed, 23 Nov 2016, Chen-Yu Tsai wrote:
> > The AXP806 supports either master/standalone or slave mode.
> > Slave mode allows sharing the serial bus, even with multiple
> > AXP806 which all have the same hardware address.

> > This is done with extra "serial interface address extension",
> > or AXP806_BUS_ADDR_EXT, and "register address extension", or
> > AXP806_REG_ADDR_EXT, registers. The former is read-only, with
> > 1 bit customizable at the factory, and 1 bit depending on the

I don't really know anything about the details of this chip, sorry.

> > This patch sets AXP806_REG_ADDR_EXT to 0x10, which is what we
> > know to be the proper value for a standard AXP806 in slave mode.
> > Afterwards it will reinitialize the regmap cache, to purge any
> > invalid stale values.

If the chip has been reset then you'd want to reset the cache too.  I've
no idea if that's needed here or not though, it depends what happens to
the global state of the chip when this reconfiguration happens.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH resend v3] ASoC: sun4i-codec: Add "Right Mixer" to "Line Out Mono Diff." route

2016-11-24 Thread Mark Brown
On Thu, Nov 24, 2016 at 07:46:49PM +0800, Chen-Yu Tsai wrote:

> This patch seems to have fallen through the cracks.

No, nobody has reviewed it and normally there's some review for sunxi
patches.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


[linux-sunxi] Applied "regulator: axp20x: Fix axp809 ldo_io registration error on cold boot" to the regulator tree

2016-11-11 Thread Mark Brown
The patch

   regulator: axp20x: Fix axp809 ldo_io registration error on cold boot

has been applied to the regulator tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 618c808968852609d2d9f0e5cfc351a4807ef8d0 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Fri, 11 Nov 2016 11:12:43 +0800
Subject: [PATCH] regulator: axp20x: Fix axp809 ldo_io registration error on
 cold boot

The maximum supported voltage for ldo_io# is 3.3V, but on cold boot
the selector comes up at 0x1f, which maps to 3.8V. This was previously
corrected by Allwinner's U-boot, which set all regulators on the PMICs
to some pre-configured voltage. With recent progress in U-boot SPL
support, this is no longer the case. In any case we should handle
this quirk in the kernel driver as well.

This invalid setting causes _regulator_get_voltage() to fail with -EINVAL
which causes regulator registration to fail when constrains are used:

[1.054181] vcc-pg: failed to get the current voltage(-22)
[1.059670] axp20x-regulator axp20x-regulator.0: Failed to register ldo_io0
[1.069749] axp20x-regulator: probe of axp20x-regulator.0 failed with error 
-22

This commits makes the axp20x regulator driver accept the 0x1f register
value, fixing this.

The datasheet does not guarantee reliable operation above 3.3V, so on
boards where this regulator is used the regulator-max-microvolt setting
must be 3.3V or less.

This is essentially the same as the commit f40d4896bf32 ("regulator:
axp20x: Fix axp22x ldo_io registration error on cold boot") for AXP22x
PMICs.

Fixes: a51f9f4622a3 ("regulator: axp20x: support AXP809 variant")
Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 drivers/regulator/axp20x-regulator.c | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/axp20x-regulator.c 
b/drivers/regulator/axp20x-regulator.c
index 54382ef902c6..e6a512ebeae2 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -337,10 +337,18 @@ static const struct regulator_desc axp809_regulators[] = {
 AXP22X_ELDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(1)),
AXP_DESC(AXP809, ELDO3, "eldo3", "eldoin", 700, 3300, 100,
 AXP22X_ELDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(2)),
-   AXP_DESC_IO(AXP809, LDO_IO0, "ldo_io0", "ips", 700, 3300, 100,
+   /*
+* Note the datasheet only guarantees reliable operation up to
+* 3.3V, this needs to be enforced via dts provided constraints
+*/
+   AXP_DESC_IO(AXP809, LDO_IO0, "ldo_io0", "ips", 700, 3800, 100,
AXP22X_LDO_IO0_V_OUT, 0x1f, AXP20X_GPIO0_CTRL, 0x07,
AXP22X_IO_ENABLED, AXP22X_IO_DISABLED),
-   AXP_DESC_IO(AXP809, LDO_IO1, "ldo_io1", "ips", 700, 3300, 100,
+   /*
+* Note the datasheet only guarantees reliable operation up to
+* 3.3V, this needs to be enforced via dts provided constraints
+*/
+   AXP_DESC_IO(AXP809, LDO_IO1, "ldo_io1", "ips", 700, 3800, 100,
AXP22X_LDO_IO1_V_OUT, 0x1f, AXP20X_GPIO1_CTRL, 0x07,
AXP22X_IO_ENABLED, AXP22X_IO_DISABLED),
AXP_DESC_FIXED(AXP809, RTC_LDO, "rtc_ldo", "ips", 1800),
-- 
2.10.2

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sun4i-codec: Add support for optional reset control to quirks" to the asoc tree

2016-11-09 Thread Mark Brown
The patch

   ASoC: sun4i-codec: Add support for optional reset control to quirks

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 9aead156c0665a362c8b007b51fe3396fea4d346 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Mon, 7 Nov 2016 18:06:58 +0800
Subject: [PATCH] ASoC: sun4i-codec: Add support for optional reset control to
 quirks

The later Allwinner SoCs have a dedicated reset controller, and
peripherals have dedicated reset controls which need to be deasserted
before the associated peripheral can be used.

Add support for this to the quirks structure and probe/remove functions.

Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-codec.c | 28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 735115244b17..6379efd21f00 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -217,6 +218,7 @@ struct sun4i_codec {
struct regmap   *regmap;
struct clk  *clk_apb;
struct clk  *clk_module;
+   struct reset_control *rst;
struct gpio_desc *gpio_pa;
 
/* ADC_FIFOC register is at different offset on different SoCs */
@@ -1232,6 +1234,7 @@ struct sun4i_codec_quirks {
struct reg_field reg_adc_fifoc; /* used for regmap_field */
unsigned int reg_dac_txdata;/* TX FIFO offset for DMA config */
unsigned int reg_adc_rxdata;/* RX FIFO offset for DMA config */
+   bool has_reset;
 };
 
 static const struct sun4i_codec_quirks sun4i_codec_quirks = {
@@ -1327,6 +1330,14 @@ static int sun4i_codec_probe(struct platform_device 
*pdev)
return PTR_ERR(scodec->clk_module);
}
 
+   if (quirks->has_reset) {
+   scodec->rst = devm_reset_control_get(>dev, NULL);
+   if (IS_ERR(scodec->rst)) {
+   dev_err(>dev, "Failed to get reset control\n");
+   return PTR_ERR(scodec->rst);
+   }
+   };
+
scodec->gpio_pa = devm_gpiod_get_optional(>dev, "allwinner,pa",
  GPIOD_OUT_LOW);
if (IS_ERR(scodec->gpio_pa)) {
@@ -1353,6 +1364,16 @@ static int sun4i_codec_probe(struct platform_device 
*pdev)
return -EINVAL;
}
 
+   /* Deassert the reset control */
+   if (scodec->rst) {
+   ret = reset_control_deassert(scodec->rst);
+   if (ret) {
+   dev_err(>dev,
+   "Failed to deassert the reset control\n");
+   goto err_clk_disable;
+   }
+   }
+
/* DMA configuration for TX FIFO */
scodec->playback_dma_data.addr = res->start + quirks->reg_dac_txdata;
scodec->playback_dma_data.maxburst = 8;
@@ -1367,7 +1388,7 @@ static int sun4i_codec_probe(struct platform_device *pdev)
 _codec_dai, 1);
if (ret) {
dev_err(>dev, "Failed to register our codec\n");
-   goto err_clk_disable;
+   goto err_assert_reset;
}
 
ret = devm_snd_soc_register_component(>dev,
@@ -1404,6 +1425,9 @@ static int sun4i_codec_probe(struct platform_device *pdev)
 
 err_unregister_codec:
snd_soc_unregister_codec(>dev);
+err_assert_reset:
+   if (scodec->rst)
+   reset_control_assert(scodec->rst);
 err_clk_disable:
clk_disable_unprepare(scodec->clk_apb);
return ret;
@@ -1416,6 +1440,8 @@ static int sun4i_codec_remove(struct platform_device 
*pdev)
 
snd_soc_unregister_card(card);
snd_soc_unregister_codec(>dev);
+   if (scodec->rst)
+   reset_control_assert(scodec->rst);
clk_disable_unprep

[linux-sunxi] Applied "ASoC: sun4i-codec: Add support for A31 ADC capture path" to the asoc tree

2016-11-09 Thread Mark Brown
The patch

   ASoC: sun4i-codec: Add support for A31 ADC capture path

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 24c99f843208df70ec7d1e04aa405f7e4c36f228 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Mon, 7 Nov 2016 18:06:59 +0800
Subject: [PATCH] ASoC: sun4i-codec: Add support for A31 ADC capture path

The A31's internal codec capture path has a mixer in front of the ADC
for each channel, capable of selecting various inputs, including
microphones, line in, phone in, and the main output mixer.

This patch adds the various controls, widgets and routes needed for
audio capture from the already supported inputs on the A31.

Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-codec.c | 65 +++
 1 file changed, 65 insertions(+)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 1934db29b2b5..735115244b17 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -786,6 +786,30 @@ static const struct snd_kcontrol_new 
sun6i_codec_mixer_controls[] = {
SUN6I_CODEC_OM_DACA_CTRL_RMIX_MIC2, 1, 0),
 };
 
+/* ADC mixer controls */
+static const struct snd_kcontrol_new sun6i_codec_adc_mixer_controls[] = {
+   SOC_DAPM_DOUBLE("Mixer Capture Switch",
+   SUN6I_CODEC_ADC_ACTL,
+   SUN6I_CODEC_ADC_ACTL_LADCMIX_OMIXL,
+   SUN6I_CODEC_ADC_ACTL_RADCMIX_OMIXR, 1, 0),
+   SOC_DAPM_DOUBLE("Mixer Reversed Capture Switch",
+   SUN6I_CODEC_ADC_ACTL,
+   SUN6I_CODEC_ADC_ACTL_LADCMIX_OMIXR,
+   SUN6I_CODEC_ADC_ACTL_RADCMIX_OMIXL, 1, 0),
+   SOC_DAPM_DOUBLE("Line In Capture Switch",
+   SUN6I_CODEC_ADC_ACTL,
+   SUN6I_CODEC_ADC_ACTL_LADCMIX_LINEINL,
+   SUN6I_CODEC_ADC_ACTL_RADCMIX_LINEINR, 1, 0),
+   SOC_DAPM_DOUBLE("Mic1 Capture Switch",
+   SUN6I_CODEC_ADC_ACTL,
+   SUN6I_CODEC_ADC_ACTL_LADCMIX_MIC1,
+   SUN6I_CODEC_ADC_ACTL_RADCMIX_MIC1, 1, 0),
+   SOC_DAPM_DOUBLE("Mic2 Capture Switch",
+   SUN6I_CODEC_ADC_ACTL,
+   SUN6I_CODEC_ADC_ACTL_LADCMIX_MIC2,
+   SUN6I_CODEC_ADC_ACTL_RADCMIX_MIC2, 1, 0),
+};
+
 /* headphone controls */
 static const char * const sun6i_codec_hp_src_enum_text[] = {
"DAC", "Mixer",
@@ -885,6 +909,10 @@ static const struct snd_kcontrol_new 
sun6i_codec_codec_widgets[] = {
SOC_SINGLE_TLV("Mic2 Boost Volume", SUN6I_CODEC_MIC_CTRL,
   SUN6I_CODEC_MIC_CTRL_MIC2BOOST, 0x7, 0,
   sun6i_codec_mic_gain_scale),
+   SOC_DOUBLE_TLV("ADC Capture Volume",
+  SUN6I_CODEC_ADC_ACTL, SUN6I_CODEC_ADC_ACTL_ADCLG,
+  SUN6I_CODEC_ADC_ACTL_ADCRG, 0x7, 0,
+  sun6i_codec_out_mixer_pregain_scale),
 };
 
 static const struct snd_soc_dapm_widget sun6i_codec_codec_dapm_widgets[] = {
@@ -910,6 +938,23 @@ static const struct snd_soc_dapm_widget 
sun6i_codec_codec_dapm_widgets[] = {
/* Line In */
SND_SOC_DAPM_INPUT("LINEIN"),
 
+   /* Digital parts of the ADCs */
+   SND_SOC_DAPM_SUPPLY("ADC Enable", SUN6I_CODEC_ADC_FIFOC,
+   SUN6I_CODEC_ADC_FIFOC_EN_AD, 0,
+   NULL, 0),
+
+   /* Analog parts of the ADCs */
+   SND_SOC_DAPM_ADC("Left ADC", "Codec Capture", SUN6I_CODEC_ADC_ACTL,
+SUN6I_CODEC_ADC_ACTL_ADCLEN, 0),
+   SND_SOC_DAPM_ADC("Right ADC", "Codec Capture", SUN6I_CODEC_ADC_ACTL,
+SUN6I_CODEC_ADC_ACTL_ADCREN, 0),
+
+   /* ADC Mixers */
+   SOC_MIXER_ARRAY("Left ADC Mixer", SND_SOC_NOPM, 0, 0,
+ 

[linux-sunxi] Applied "ASoC: sun4i-codec: Add support for A31 board level audio routing" to the asoc tree

2016-11-04 Thread Mark Brown
The patch

   ASoC: sun4i-codec: Add support for A31 board level audio routing

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 300a18d13f7eaec789e79dc45bce026e098b45da Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Thu, 3 Nov 2016 15:55:53 +0800
Subject: [PATCH] ASoC: sun4i-codec: Add support for A31 board level audio
 routing

The A31 SoC's codec has various inputs, outputs and microphone bias
supplies. These can be routed on the board in different ways, such as:

  - HPCOM may be connected to have the headphone DC coupled.

  - Microphones all use the MBIAS main microphone supply or one mic may
use the HBIAS supply, which supports headset detection and buttons.

  - Line Out may be routed to an audio jack, or an onboard speaker amp
with power controls.

Add support for specifying the audio routes in the device tree.

Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 .../devicetree/bindings/sound/sun4i-codec.txt  | 33 ++
 sound/soc/sunxi/sun4i-codec.c  | 21 --
 2 files changed, 52 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/sun4i-codec.txt 
b/Documentation/devicetree/bindings/sound/sun4i-codec.txt
index bf480e9683a3..d91a95377f49 100644
--- a/Documentation/devicetree/bindings/sound/sun4i-codec.txt
+++ b/Documentation/devicetree/bindings/sound/sun4i-codec.txt
@@ -22,6 +22,31 @@ Optional properties:
 Required properties for the following compatibles:
- "allwinner,sun6i-a31-codec"
 - resets: phandle to the reset control for this device
+- allwinner,audio-routing: A list of the connections between audio components.
+  Each entry is a pair of strings, the first being the
+  connection's sink, the second being the connection's
+  source. Valid names include:
+
+  Audio pins on the SoC:
+  "HP"
+  "HPCOM"
+  "LINEIN"
+  "LINEOUT"
+  "MIC1"
+  "MIC2"
+  "MIC3"
+
+  Microphone biases from the SoC:
+  "HBIAS"
+  "MBIAS"
+
+  Board connectors:
+  "Headphone"
+  "Headset Mic"
+  "Line In"
+  "Line Out"
+  "Mic"
+  "Speaker"
 
 Example:
 codec: codec@01c22c00 {
@@ -45,4 +70,12 @@ codec: codec@01c22c00 {
resets = < RST_APB1_CODEC>;
dmas = < 15>, < 15>;
dma-names = "rx", "tx";
+   allwinner,audio-routing =
+   "Headphone", "HP",
+   "Speaker", "LINEOUT",
+   "LINEIN", "Line In",
+   "MIC1", "MBIAS",
+   "MIC1", "Mic",
+   "MIC2", "HBIAS",
+   "MIC2", "Headset Mic";
 };
diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index f55718fe7c5b..1934db29b2b5 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -1104,9 +1104,19 @@ static struct snd_soc_card 
*sun4i_codec_create_card(struct device *dev)
return card;
 };
 
+static const struct snd_soc_dapm_widget sun6i_codec_card_dapm_widgets[] = {
+   SND_SOC_DAPM_HP("Headphone", NULL),
+   SND_SOC_DAPM_LINE("Line In", NULL),
+   SND_SOC_DAPM_LINE("Line Out", NULL),
+   SND_SOC_DAPM_MIC("Headset Mic", NULL),
+   SND_SOC_DAPM_MIC("Mi

[linux-sunxi] Applied "ASoC: sun4i-codec: Add support for A31 analog microphone inputs" to the asoc tree

2016-11-04 Thread Mark Brown
The patch

   ASoC: sun4i-codec: Add support for A31 analog microphone inputs

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From ecd5cdb4fd818b1cec55863d5de3683dad1c2f53 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Thu, 3 Nov 2016 15:55:51 +0800
Subject: [PATCH] ASoC: sun4i-codec: Add support for A31 analog microphone
 inputs

The A31 internal codec has 3 microphone outputs, of which MIC2 and MIC3
are muxed internally. The resulting two microphone inputs have separate
gain controls and mixer inputs.

The codec also has 2 microphone bias pins. HBIAS is specifically for the
headphone jack, which also supports headphone detection and control
buttons. These extra functions are not supported yet. The other, MBIAS,
is for all other analog microphones.

There is also mention of digital microphone support, but documentation
is scarce, and no hardware with it is available.

Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-codec.c | 70 +++
 1 file changed, 70 insertions(+)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index a10251f4932e..f55718fe7c5b 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -776,6 +776,14 @@ static const struct snd_kcontrol_new 
sun6i_codec_mixer_controls[] = {
SUN6I_CODEC_OM_DACA_CTRL,
SUN6I_CODEC_OM_DACA_CTRL_LMIX_LINEINL,
SUN6I_CODEC_OM_DACA_CTRL_RMIX_LINEINR, 1, 0),
+   SOC_DAPM_DOUBLE("Mic1 Playback Switch",
+   SUN6I_CODEC_OM_DACA_CTRL,
+   SUN6I_CODEC_OM_DACA_CTRL_LMIX_MIC1,
+   SUN6I_CODEC_OM_DACA_CTRL_RMIX_MIC1, 1, 0),
+   SOC_DAPM_DOUBLE("Mic2 Playback Switch",
+   SUN6I_CODEC_OM_DACA_CTRL,
+   SUN6I_CODEC_OM_DACA_CTRL_LMIX_MIC2,
+   SUN6I_CODEC_OM_DACA_CTRL_RMIX_MIC2, 1, 0),
 };
 
 /* headphone controls */
@@ -794,6 +802,21 @@ static const struct snd_kcontrol_new sun6i_codec_hp_src[] 
= {
  sun6i_codec_hp_src_enum),
 };
 
+/* microphone controls */
+static const char * const sun6i_codec_mic2_src_enum_text[] = {
+   "Mic2", "Mic3",
+};
+
+static SOC_ENUM_SINGLE_DECL(sun6i_codec_mic2_src_enum,
+   SUN6I_CODEC_MIC_CTRL,
+   SUN6I_CODEC_MIC_CTRL_MIC2SLT,
+   sun6i_codec_mic2_src_enum_text);
+
+static const struct snd_kcontrol_new sun6i_codec_mic2_src[] = {
+   SOC_DAPM_ENUM("Mic2 Amplifier Source Route",
+ sun6i_codec_mic2_src_enum),
+};
+
 /* line out controls */
 static const char * const sun6i_codec_lineout_src_enum_text[] = {
"Stereo", "Mono Differential",
@@ -819,6 +842,10 @@ static const 
DECLARE_TLV_DB_RANGE(sun6i_codec_lineout_vol_scale,
0, 1, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1),
2, 31, TLV_DB_SCALE_ITEM(-4350, 150, 0),
 );
+static const DECLARE_TLV_DB_RANGE(sun6i_codec_mic_gain_scale,
+   0, 0, TLV_DB_SCALE_ITEM(0, 0, 0),
+   1, 7, TLV_DB_SCALE_ITEM(2400, 300, 0),
+);
 
 static const struct snd_kcontrol_new sun6i_codec_codec_widgets[] = {
SOC_SINGLE_TLV("DAC Playback Volume", SUN4I_CODEC_DAC_DPC,
@@ -844,9 +871,42 @@ static const struct snd_kcontrol_new 
sun6i_codec_codec_widgets[] = {
SOC_SINGLE_TLV("Line In Playback Volume",
   SUN6I_CODEC_OM_PA_CTRL, SUN6I_CODEC_OM_PA_CTRL_LINEING,
   0x7, 0, sun6i_codec_out_mixer_pregain_scale),
+   SOC_SINGLE_TLV("Mic1 Playback Volume",
+  SUN6I_CODEC_OM_PA_CTRL, SUN6I_CODEC_OM_PA_CTRL_MIC1G,
+  0x7, 0, sun6i_codec_out_mixer_pregain_scale),
+   SOC_SINGLE_TLV("Mic2 Playback Volume",
+  SUN6I_CODEC_OM_PA_CTRL, SUN6I_CODEC_OM_PA_CTRL_MIC2G,
+  0x7, 0, sun6i_codec_ou

[linux-sunxi] Applied "ASoC: sun4i-codec: Add support for A31 Line Out playback" to the asoc tree

2016-11-04 Thread Mark Brown
The patch

   ASoC: sun4i-codec: Add support for A31 Line Out playback

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 0f909f98d7cbabc3641a45da9c6891444b929a92 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Thu, 3 Nov 2016 15:55:50 +0800
Subject: [PATCH] ASoC: sun4i-codec: Add support for A31 Line Out playback

The A31 integrated codec has a second "Line Out" output which does not
include an integrated amplifier in its path. This path does have a
separate volume control.

This patch adds support for the playback path from the DAC to the Line
Out pins.

Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-codec.c | 39 +++
 1 file changed, 39 insertions(+)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 72a84f76aa57..a10251f4932e 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -794,11 +794,31 @@ static const struct snd_kcontrol_new sun6i_codec_hp_src[] 
= {
  sun6i_codec_hp_src_enum),
 };
 
+/* line out controls */
+static const char * const sun6i_codec_lineout_src_enum_text[] = {
+   "Stereo", "Mono Differential",
+};
+
+static SOC_ENUM_DOUBLE_DECL(sun6i_codec_lineout_src_enum,
+   SUN6I_CODEC_MIC_CTRL,
+   SUN6I_CODEC_MIC_CTRL_LINEOUTLSRC,
+   SUN6I_CODEC_MIC_CTRL_LINEOUTRSRC,
+   sun6i_codec_lineout_src_enum_text);
+
+static const struct snd_kcontrol_new sun6i_codec_lineout_src[] = {
+   SOC_DAPM_ENUM("Line Out Source Playback Route",
+ sun6i_codec_lineout_src_enum),
+};
+
 /* volume / mute controls */
 static const DECLARE_TLV_DB_SCALE(sun6i_codec_dvol_scale, -7308, 116, 0);
 static const DECLARE_TLV_DB_SCALE(sun6i_codec_hp_vol_scale, -6300, 100, 1);
 static const DECLARE_TLV_DB_SCALE(sun6i_codec_out_mixer_pregain_scale,
  -450, 150, 0);
+static const DECLARE_TLV_DB_RANGE(sun6i_codec_lineout_vol_scale,
+   0, 1, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 1),
+   2, 31, TLV_DB_SCALE_ITEM(-4350, 150, 0),
+);
 
 static const struct snd_kcontrol_new sun6i_codec_codec_widgets[] = {
SOC_SINGLE_TLV("DAC Playback Volume", SUN4I_CODEC_DAC_DPC,
@@ -808,10 +828,18 @@ static const struct snd_kcontrol_new 
sun6i_codec_codec_widgets[] = {
   SUN6I_CODEC_OM_DACA_CTRL,
   SUN6I_CODEC_OM_DACA_CTRL_HPVOL, 0x3f, 0,
   sun6i_codec_hp_vol_scale),
+   SOC_SINGLE_TLV("Line Out Playback Volume",
+  SUN6I_CODEC_MIC_CTRL,
+  SUN6I_CODEC_MIC_CTRL_LINEOUTVC, 0x1f, 0,
+  sun6i_codec_lineout_vol_scale),
SOC_DOUBLE("Headphone Playback Switch",
   SUN6I_CODEC_OM_DACA_CTRL,
   SUN6I_CODEC_OM_DACA_CTRL_LHPPAMUTE,
   SUN6I_CODEC_OM_DACA_CTRL_RHPPAMUTE, 1, 0),
+   SOC_DOUBLE("Line Out Playback Switch",
+  SUN6I_CODEC_MIC_CTRL,
+  SUN6I_CODEC_MIC_CTRL_LINEOUTLEN,
+  SUN6I_CODEC_MIC_CTRL_LINEOUTREN, 1, 0),
/* Mixer pre-gains */
SOC_SINGLE_TLV("Line In Playback Volume",
   SUN6I_CODEC_OM_PA_CTRL, SUN6I_CODEC_OM_PA_CTRL_LINEING,
@@ -853,6 +881,11 @@ static const struct snd_soc_dapm_widget 
sun6i_codec_codec_dapm_widgets[] = {
SND_SOC_DAPM_REG(snd_soc_dapm_supply, "HPCOM", SUN6I_CODEC_OM_PA_CTRL,
 SUN6I_CODEC_OM_PA_CTRL_HPCOM_CTL, 0x3, 0x3, 0),
SND_SOC_DAPM_OUTPUT("HP"),
+
+   /* Line Out path */
+   SND_SOC_DAPM_MUX("Line Out Source Playback Route",
+SND_SOC_NOPM, 0, 0, sun6i_codec_lineout_src),
+   SND_SOC_DAPM_OUTPUT("LINEOUT"),
 };
 
 static const struct snd_soc_dapm_route sun6i_codec_codec_dapm_rou

[linux-sunxi] Applied "ASoC: sun4i-codec: Increase DMA max burst to 8" to the asoc tree

2016-11-03 Thread Mark Brown
The patch

   ASoC: sun4i-codec: Increase DMA max burst to 8

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 730e2dd0cbc7a7ec10174d9d291cdd8e8082a948 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Thu, 3 Nov 2016 15:55:46 +0800
Subject: [PATCH] ASoC: sun4i-codec: Increase DMA max burst to 8

According to the DMA engine API documentation, maxburst denotes the
largest possible size of a single transfer, so as not to overflow
destination FIFOs as explained in this excerpt from dmaengine.h

 * @src_maxburst: the maximum number of words (note: words, as in
 * units of the src_addr_width member, not bytes) that can be sent
 * in one burst to the device. Typically something like half the
 * FIFO depth on I/O peripherals so you don't overflow it. This
 * may or may not be applicable on memory sources.
 * @dst_maxburst: same as src_maxburst but for destination target
 * mutatis mutandis.

The TX FIFO is 64 samples deep for stereo, and the RX FIFO is 16
samples deep. So maxburst could be 32 and 8 for TX and RX respectively.

Unfortunately the sunxi DMA controller driver takes maxburst as
the requested burst size, rather than a limit, and returns an error
for unsupported values. The original value was 4, but some later
SoCs do not officially support this burst size.

This patch increases maxburst on the TX side to 8, which is supported
by all variants of the sunxi DMA controller.

Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-codec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 61ae502a5061..d867b96d367b 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -886,12 +886,12 @@ static int sun4i_codec_probe(struct platform_device *pdev)
 
/* DMA configuration for TX FIFO */
scodec->playback_dma_data.addr = res->start + quirks->reg_dac_txdata;
-   scodec->playback_dma_data.maxburst = 4;
+   scodec->playback_dma_data.maxburst = 8;
scodec->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
 
/* DMA configuration for RX FIFO */
scodec->capture_dma_data.addr = res->start + quirks->reg_adc_rxdata;
-   scodec->capture_dma_data.maxburst = 4;
+   scodec->capture_dma_data.maxburst = 8;
scodec->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
 
ret = snd_soc_register_codec(>dev, quirks->codec,
-- 
2.10.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Applied "ASoC: sun4i-codec: Expand quirks to handle register offsets and card creation" to the asoc tree

2016-11-03 Thread Mark Brown
The patch

   ASoC: sun4i-codec: Expand quirks to handle register offsets and card creation

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From bc03f0d576000739694ed95e89c71cda78964224 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Thu, 3 Nov 2016 15:55:44 +0800
Subject: [PATCH] ASoC: sun4i-codec: Expand quirks to handle register offsets
 and card creation

The A31 has a similar codec to the A10/A20. The PCM parts are very
similar, with just different register offsets. The analog paths are
very different. There are more inputs and outputs.

The A31s, A23, and H3 have a similar PCM interface, again with register
offsets slightly rearranged. The analog path controls, while very
similar between them and the A31, have been moved a separate bus which
is accessed through a message box like interface in the PRCM address
range. This would be handled by a separate auxiliary device tied in
through the device tree in its supporting create_card function.

The quirks structure is expanded to include different register offsets
and separate callbacks for creating the ASoC card. The regmap_config,
quirks, and of_device_match tables have been moved to facilitate this.

Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-codec.c | 87 +--
 1 file changed, 60 insertions(+), 27 deletions(-)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 5ff071fd4996..61ae502a5061 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -3,6 +3,7 @@
  * Copyright 2014 Jon Smirl <jonsm...@gmail.com>
  * Copyright 2015 Maxime Ripard <maxime.rip...@free-electrons.com>
  * Copyright 2015 Adam Sampson <a...@offog.org>
+ * Copyright 2016 Chen-Yu Tsai <w...@csie.org>
  *
  * Based on the Allwinner SDK driver, released under the GPL.
  *
@@ -24,8 +25,9 @@
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -114,6 +116,9 @@ struct sun4i_codec {
struct clk  *clk_module;
struct gpio_desc *gpio_pa;
 
+   /* ADC_FIFOC register is at different offset on different SoCs */
+   struct regmap_field *reg_adc_fifoc;
+
struct snd_dmaengine_dai_dma_data   capture_dma_data;
struct snd_dmaengine_dai_dma_data   playback_dma_data;
 };
@@ -142,16 +147,16 @@ static void sun4i_codec_stop_playback(struct sun4i_codec 
*scodec)
 static void sun4i_codec_start_capture(struct sun4i_codec *scodec)
 {
/* Enable ADC DRQ */
-   regmap_update_bits(scodec->regmap, SUN4I_CODEC_ADC_FIFOC,
-  BIT(SUN4I_CODEC_ADC_FIFOC_ADC_DRQ_EN),
-  BIT(SUN4I_CODEC_ADC_FIFOC_ADC_DRQ_EN));
+   regmap_field_update_bits(scodec->reg_adc_fifoc,
+BIT(SUN4I_CODEC_ADC_FIFOC_ADC_DRQ_EN),
+BIT(SUN4I_CODEC_ADC_FIFOC_ADC_DRQ_EN));
 }
 
 static void sun4i_codec_stop_capture(struct sun4i_codec *scodec)
 {
/* Disable ADC DRQ */
-   regmap_update_bits(scodec->regmap, SUN4I_CODEC_ADC_FIFOC,
-  BIT(SUN4I_CODEC_ADC_FIFOC_ADC_DRQ_EN), 0);
+   regmap_field_update_bits(scodec->reg_adc_fifoc,
+BIT(SUN4I_CODEC_ADC_FIFOC_ADC_DRQ_EN), 0);
 }
 
 static int sun4i_codec_trigger(struct snd_pcm_substream *substream, int cmd,
@@ -194,15 +199,15 @@ static int sun4i_codec_prepare_capture(struct 
snd_pcm_substream *substream,
 
 
/* Flush RX FIFO */
-   regmap_update_bits(scodec->regmap, SUN4I_CODEC_ADC_FIFOC,
-  BIT(SUN4I_CODEC_ADC_FIFOC_FIFO_FLUSH),
-  BIT(SUN4I_CODEC_ADC_FIFOC_FIFO_FLUSH));
+   regmap_field_update_bits(scodec->reg_adc_fifoc,
+BIT(SUN4I_CODEC_ADC_FIFOC_FIFO_FLUSH),
+BIT(SUN4I_CODEC_ADC_FIFOC_FIFO_FLUSH));
 
 
/* Set RX FIFO trigger leve

[linux-sunxi] Applied "ASoC: sun4i-codec: Add support for A31 playback through headphone output" to the asoc tree

2016-11-03 Thread Mark Brown
The patch

   ASoC: sun4i-codec: Add support for A31 playback through headphone output

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 8d9e4c9e993f34e7f74bf36f417920a01a42c4b0 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Thu, 3 Nov 2016 15:55:48 +0800
Subject: [PATCH] ASoC: sun4i-codec: Add support for A31 playback through
 headphone output

The A31 has a similar codec to the A10/A20. The PCM parts are very
similar, with different register offsets. The analog paths are very
different. There are more inputs and outputs. The ADC mux has been
replaced with a proper mixer.

This patch adds support for the basic playback path of the A31 codec,
from the DAC to the headphones. Headphone detection, microphone,
signaling, other inputs/outputs and capture will be added later.

Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 .../devicetree/bindings/sound/sun4i-codec.txt  |  22 +-
 sound/soc/sunxi/sun4i-codec.c  | 271 -
 2 files changed, 287 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/sound/sun4i-codec.txt 
b/Documentation/devicetree/bindings/sound/sun4i-codec.txt
index 0dce690f78f5..bf480e9683a3 100644
--- a/Documentation/devicetree/bindings/sound/sun4i-codec.txt
+++ b/Documentation/devicetree/bindings/sound/sun4i-codec.txt
@@ -1,8 +1,10 @@
 * Allwinner A10 Codec
 
 Required properties:
-- compatible: must be either "allwinner,sun4i-a10-codec" or
-  "allwinner,sun7i-a20-codec"
+- compatible: must be one of the following compatibles:
+   - "allwinner,sun4i-a10-codec"
+   - "allwinner,sun6i-a31-codec"
+   - "allwinner,sun7i-a20-codec"
 - reg: must contain the registers location and length
 - interrupts: must contain the codec interrupt
 - dmas: DMA channels for tx and rx dma. See the DMA client binding,
@@ -17,6 +19,10 @@ Required properties:
 Optional properties:
 - allwinner,pa-gpios: gpio to enable external amplifier
 
+Required properties for the following compatibles:
+   - "allwinner,sun6i-a31-codec"
+- resets: phandle to the reset control for this device
+
 Example:
 codec: codec@01c22c00 {
#sound-dai-cells = <0>;
@@ -28,3 +34,15 @@ codec: codec@01c22c00 {
dmas = < 0 19>, < 0 19>;
dma-names = "rx", "tx";
 };
+
+codec: codec@01c22c00 {
+   #sound-dai-cells = <0>;
+   compatible = "allwinner,sun6i-a31-codec";
+   reg = <0x01c22c00 0x98>;
+   interrupts = ;
+   clocks = < CLK_APB1_CODEC>, < CLK_CODEC>;
+   clock-names = "apb", "codec";
+   resets = < RST_APB1_CODEC>;
+   dmas = < 15>, < 15>;
+   dma-names = "rx", "tx";
+};
diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index d867b96d367b..d4b2186b5d84 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -109,6 +109,109 @@
 /* Microphone controls (sun7i only) */
 #define SUN7I_CODEC_AC_MIC_PHONE_CAL   (0x3c)
 
+/*
+ * sun6i specific registers
+ *
+ * sun6i shares the same digital control and FIFO registers as sun4i,
+ * but only the DAC digital controls are at the same offset. The others
+ * have been moved around to accommodate extra analog controls.
+ */
+
+/* Codec DAC digital controls and FIFO registers */
+#define SUN6I_CODEC_ADC_FIFOC  (0x10)
+#define SUN6I_CODEC_ADC_FIFOC_EN_AD(28)
+#define SUN6I_CODEC_ADC_FIFOS  (0x14)
+#define SUN6I_CODEC_ADC_RXDATA (0x18)
+
+/* Output mixer and gain controls */
+#define SUN6I_CODEC_OM_DACA_CTRL   (0x20)
+#define SUN6I_CODEC_OM_DACA_CTRL_DACAREN   (31)
+#define SUN6I_CODEC_OM_DACA_CTRL_DACALEN   (30)
+#define SUN6I_CODEC_OM_DACA_CTRL_RMIXEN(29)
+#define SUN6I_CODEC_OM_DACA_CTRL_LMIXEN   

[linux-sunxi] Applied "ASoC: sun4i-codec: Add support for A31 Line In playback" to the asoc tree

2016-11-03 Thread Mark Brown
The patch

   ASoC: sun4i-codec: Add support for A31 Line In playback

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From dff5051250674fce575fa36c22b2f007363e42d0 Mon Sep 17 00:00:00 2001
From: Chen-Yu Tsai <w...@csie.org>
Date: Thu, 3 Nov 2016 15:55:49 +0800
Subject: [PATCH] ASoC: sun4i-codec: Add support for A31 Line In playback

The A31 integrated codec has a stereo "Line In" input. Add support for
it to the playback paths.

Signed-off-by: Chen-Yu Tsai <w...@csie.org>
Acked-by: Maxime Ripard <maxime.rip...@free-electrons.com>
Signed-off-by: Mark Brown <broo...@kernel.org>
---
 sound/soc/sunxi/sun4i-codec.c | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index d4b2186b5d84..72a84f76aa57 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -772,6 +772,10 @@ static const struct snd_kcontrol_new 
sun6i_codec_mixer_controls[] = {
SUN6I_CODEC_OM_DACA_CTRL,
SUN6I_CODEC_OM_DACA_CTRL_LMIX_DACR,
SUN6I_CODEC_OM_DACA_CTRL_RMIX_DACL, 1, 0),
+   SOC_DAPM_DOUBLE("Line In Playback Switch",
+   SUN6I_CODEC_OM_DACA_CTRL,
+   SUN6I_CODEC_OM_DACA_CTRL_LMIX_LINEINL,
+   SUN6I_CODEC_OM_DACA_CTRL_RMIX_LINEINR, 1, 0),
 };
 
 /* headphone controls */
@@ -793,6 +797,8 @@ static const struct snd_kcontrol_new sun6i_codec_hp_src[] = 
{
 /* volume / mute controls */
 static const DECLARE_TLV_DB_SCALE(sun6i_codec_dvol_scale, -7308, 116, 0);
 static const DECLARE_TLV_DB_SCALE(sun6i_codec_hp_vol_scale, -6300, 100, 1);
+static const DECLARE_TLV_DB_SCALE(sun6i_codec_out_mixer_pregain_scale,
+ -450, 150, 0);
 
 static const struct snd_kcontrol_new sun6i_codec_codec_widgets[] = {
SOC_SINGLE_TLV("DAC Playback Volume", SUN4I_CODEC_DAC_DPC,
@@ -806,9 +812,16 @@ static const struct snd_kcontrol_new 
sun6i_codec_codec_widgets[] = {
   SUN6I_CODEC_OM_DACA_CTRL,
   SUN6I_CODEC_OM_DACA_CTRL_LHPPAMUTE,
   SUN6I_CODEC_OM_DACA_CTRL_RHPPAMUTE, 1, 0),
+   /* Mixer pre-gains */
+   SOC_SINGLE_TLV("Line In Playback Volume",
+  SUN6I_CODEC_OM_PA_CTRL, SUN6I_CODEC_OM_PA_CTRL_LINEING,
+  0x7, 0, sun6i_codec_out_mixer_pregain_scale),
 };
 
 static const struct snd_soc_dapm_widget sun6i_codec_codec_dapm_widgets[] = {
+   /* Line In */
+   SND_SOC_DAPM_INPUT("LINEIN"),
+
/* Digital parts of the DACs */
SND_SOC_DAPM_SUPPLY("DAC Enable", SUN4I_CODEC_DAC_DPC,
SUN4I_CODEC_DAC_DPC_EN_DA, 0,
@@ -850,10 +863,12 @@ static const struct snd_soc_dapm_route 
sun6i_codec_codec_dapm_routes[] = {
/* Left Mixer Routes */
{ "Left Mixer", "DAC Playback Switch", "Left DAC" },
{ "Left Mixer", "DAC Reversed Playback Switch", "Right DAC" },
+   { "Left Mixer", "Line In Playback Switch", "LINEIN" },
 
/* Right Mixer Routes */
{ "Right Mixer", "DAC Playback Switch", "Right DAC" },
{ "Right Mixer", "DAC Reversed Playback Switch", "Left DAC" },
+   { "Right Mixer", "Line In Playback Switch", "LINEIN" },
 
/* Headphone Routes */
{ "Headphone Source Playback Route", "DAC", "Left DAC" },
-- 
2.10.1

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   >