100 Commits
Author SHA1 Message Date
Sascha Hauer 4688f3856d soc: mediatek: SCPSYS: Add regulator support
The power domains are supplied by regulators. Add support for them so
that the regulators are properly turned on before a domain is powered up
and turned off when a domain is powered down.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-12-18 09:41:42 +01:00
Sascha Hauer eb0fc0d6ae dt-bindings: soc: Add supplies for Mediatek SCPSYS unit
The power domains in the SCPSYS unit are supplied by regulators. Add the
properties for them to the binding document.

Signed-off-by: Sascha Hauer <[email protected]>
Cc: [email protected]
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-12-09 12:24:56 +01:00
Sascha Hauer 930cc0f39b dt-bindings: iio: adc: Update mcp342x binding for the mcp3421
The mcp3421 is the single channel variant of the mcp342x family and
can be supported by the mcp342x driver.

Signed-off-by: Sascha Hauer <[email protected]>
Cc: [email protected]
Acked-by: Rob Herring <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
2015-12-02 18:27:09 +00:00
Sascha Hauer 78f16dbda5 iio: adc: mcp3422: Add mcp3421 support
The mcp3421 is the single channel variant of the mcp342x family. Support
is straight forward, only the channels array has to be added for this
chip.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
2015-12-02 18:27:09 +00:00
Sascha Hauer fc42112c0e regulator: core: Propagate voltage changes to supply regulators
Until now changing the voltage of a regulator only ever effected the
regulator itself, but never its supplies. It's a common pattern though
to put LDO regulators behind switching regulators. The switching
regulators efficiently drop the input voltage but have a high ripple on
their output. The output is then cleaned up by the LDOs. For higher
energy efficiency the voltage drop at the LDOs should be minimized. For
this scenario we need to propagate the voltage change to the supply
regulators. Another scenario where voltage propagation is desired is
a regulator which only consists of a switch and thus cannot regulate
voltages itself. In this case we can pass setting voltages to the
supply.

This patch adds support for voltage propagation. We do voltage
propagation when the current regulator has a minimum dropout voltage
specified or if the current regulator lacks a get_voltage operation
(indicating it's a switch and not a regulator).

Changing the supply voltage must be done carefully. When we are
increasing the current regulators output we must first increase the
supply voltage and then the regulator itself. When we are decreasing the
current regulators voltage we must decrease the supply voltage after
changing the current regulators voltage.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2015-10-22 13:34:11 +01:00
Sascha Hauer a204f41e2d regulator: core: Factor out regulator_map_voltage
_regulator_call_set_voltage has code to translate a minimum/maximum
voltage pair into a selector. This code is useful for others aswell,
so create a regulator_map_voltage function.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2015-10-20 15:43:53 +01:00
Sascha Hauer 0d19208e70 regulator: i.MX anatop: Allow supply regulator
The anatop regulators are SoC internal LDO regulators usually supplied
by an external PMIC. This patch adds support for specifying the supply
from the device tree using the vin-supply property.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2015-10-16 17:59:34 +01:00
Sascha Hauer 5abe4f223e regulator: introduce min_dropout_uV
Many voltage Regulators need a input voltage that is higher than the
output voltage. Allow to specify a minimum dropout voltage which will
be used later to find the best input voltage for regulators.

[Changed uv to uV for consistency and legibility -- broonie]

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2015-10-16 17:57:33 +01:00
Sascha Hauer a9f226bcd9 regulator: core: create unlocked version of regulator_set_voltage
The unlocked version will be needed when we start propagating voltage
changes to the supply regulators.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2015-10-16 17:55:55 +01:00
Sascha Hauer 3a40cfc36b regulator: core: create unlocked version of regulator_list_voltage
The unlocked version will be needed when we start propagating voltage
changes to the supply regulators.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2015-10-01 12:28:42 +01:00
Sascha Hauer 9f01cd4a91 regulator: core: introduce function to lock regulators and its supplies
Each regulator_dev is locked with its own mutex. This is fine as long
as only one regulator_dev is locked, but makes lockdep unhappy when we
have to walk up the supply chain like it can happen in
regulator_get_voltage:

regulator_get_voltage ->
 mutex_lock(&regulator->rdev->mutex) ->
_regulator_get_voltage(regulator->rdev) ->
regulator_get_voltage(rdev->supply) ->
mutex_lock(&regulator->rdev->mutex);

This causes lockdep to issue a possible deadlock warning.

There are at least two ways to work around this:

- We can always lock the whole supply chain using the functions
  introduced with this patch.
- We could store the current voltage in struct regulator_rdev so
  that we do not have to walk up the supply chain for the
  _regulator_get_voltage case.

Anyway, regulator_lock_supply/regulator_unlock_supply will be needed
once we allow regulator_set_voltage to optimize the supply voltages.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2015-10-01 12:28:42 +01:00
Sascha Hauer 934c93b8c1 thermal: Add comment explaining test for critical temperature
The code testing if a temperature should be emulated or not is
not obvious. Add a comment explaining why this test is done.

Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Mikko Perttunen <[email protected]>
Signed-off-by: Zhang Rui <[email protected]>
2015-08-03 23:15:51 +08:00
Sascha Hauer 79e5421cf0 thermal: Use IS_ENABLED instead of #ifdef
Use IS_ENABLED(CONFIG_THERMAL_EMULATION) to make the code more readable
and to get rid of the addtional #ifdef around the variable definitions
in thermal_zone_get_temp().

Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Lukasz Majewski <[email protected]>
Signed-off-by: Zhang Rui <[email protected]>
2015-08-03 23:15:51 +08:00
Sascha Hauer dbdf2532b4 thermal: remove unnecessary call to thermal_zone_device_set_polling
When the thermal zone has no get_temp callback then thermal_zone_device_register()
calls thermal_zone_device_set_polling() with a polling delay of 0. This
only cancels the poll_queue. Since the poll_queue hasn't been scheduled this
is a no-op. Remove it.

Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Eduardo Valentin <[email protected]>
Signed-off-by: Zhang Rui <[email protected]>
2015-08-03 23:15:51 +08:00
Sascha Hauer f6be058493 thermal: trivial: fix typo in comment
Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Eduardo Valentin <[email protected]>
Signed-off-by: Zhang Rui <[email protected]>
2015-08-03 23:15:51 +08:00
Sascha Hauer 17e8351a77 thermal: consistently use int for temperatures
The thermal code uses int, long and unsigned long for temperatures
in different places.

Using an unsigned type limits the thermal framework to positive
temperatures without need. Also several drivers currently will report
temperatures near UINT_MAX for temperatures below 0°C. This will probably
immediately shut the machine down due to overtemperature if started below
0°C.

'long' is 64bit on several architectures. This is not needed since INT_MAX °mC
is above the melting point of all known materials.

Consistently use a plain 'int' for temperatures throughout the thermal code and
the drivers. This only changes the places in the drivers where the temperature
is passed around as pointer, when drivers internally use another type this is
not changed.

Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Jean Delvare <[email protected]>
Reviewed-by: Lukasz Majewski <[email protected]>
Reviewed-by: Darren Hart <[email protected]>
Reviewed-by: Heiko Stuebner <[email protected]>
Reviewed-by: Peter Feuerer <[email protected]>
Cc: Punit Agrawal <[email protected]>
Cc: Zhang Rui <[email protected]>
Cc: Eduardo Valentin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Jean Delvare <[email protected]>
Cc: Peter Feuerer <[email protected]>
Cc: Heiko Stuebner <[email protected]>
Cc: Lukasz Majewski <[email protected]>
Cc: Stephen Warren <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Guenter Roeck <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Darren Hart <[email protected]>
Cc: [email protected]
Signed-off-by: Zhang Rui <[email protected]>
2015-08-03 23:15:50 +08:00
Sascha Hauer f6ee9b582d spi: imx: Fix small DMA transfers
DMA transfers must be greater than the watermark level size. spi_imx->rx_wml
and spi_imx->tx_wml contain the watermark level in 32bit words whereas struct
spi_transfer contains the transfer len in bytes. Fix the check if DMA is
possible for a transfer accordingly. This fixes transfers with sizes between
33 and 128 bytes for which previously was claimed that DMA is possible.

Fixes: f62caccd12 (spi: spi-imx: add DMA support)
Signed-off-by: Sascha Hauer <[email protected]>
Cc: [email protected]
Signed-off-by: Mark Brown <[email protected]>
2015-07-24 16:08:55 +01:00
Sascha Hauer d57b1d2860 ARM: dts: mediatek mt8135: Use real UART clocks
We used to provide dummy clocks for the UART. Now that we have
common clock support we can provide the real clocks to the UART.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-07-17 21:43:27 +02:00
Sascha Hauer aada7d5298 ARM: dts: mt8135-evbp1: Add PMIC support
The MT8135 eval board contains a MT6397 PMIC. This adds the
corresponding device node to the dts file.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-07-17 21:43:17 +02:00
Sascha Hauer 8dd29d28ac ARM: dts: mt8135: Add pmic wrapper nodes
This adds the pmic wrapper node to the MediaTek MT8135 dtsi file.

This unit is used to access the PMIC on MediaTek boards.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-07-17 21:43:04 +02:00
Sascha Hauer 7b2a4635b8 clk: mediatek: mt8173: Fix enabling of critical clocks
On the MT8173 the clocks are provided by different units. To enable
the critical clocks we must be sure that all parent clocks are already
registered, otherwise the parents of the critical clocks end up being
unused and get disabled later. To find a place where all parents are
registered we try each time after we've registered some clocks if
all known providers are present now and only then we enable the critical
clocks

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: James Liao <[email protected]>
[[email protected]: Marked function and data __init]
Signed-off-by: Stephen Boyd <[email protected]>
2015-07-06 15:54:13 -07:00
Sascha Hauer c84e358718 soc: Mediatek: Add SCPSYS power domain driver
This adds a power domain driver for the Mediatek SCPSYS unit.

The System Control Processor System (SCPSYS) has several power
management related tasks in the system. The tasks include thermal
measurement, dynamic voltage frequency scaling (DVFS), interrupt
filter and lowlevel sleep control. The System Power Manager (SPM)
inside the SCPSYS is for the MTCMOS power domain control.

For now this driver only adds power domain support, the more
advanced features are not yet supported. The driver implements
the generic PM domain device tree bindings, the first user will
most likely be the Mediatek AFE audio driver.

Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-07-06 18:36:32 +02:00
Sascha Hauer 859e42800b dt-bindings: soc: Add documentation for the MediaTek SCPSYS unit
This adds documentation for the MediaTek SCPSYS unit found in MT8173 SoCs.

Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-07-06 18:36:31 +02:00
Sascha Hauer 16a624a9c8 soc: mediatek: Add infracfg misc driver support
This adds support for some miscellaneous bits of the infracfg controller.
The mtk_infracfg_set/clear_bus_protection functions are necessary for
the scpsys power domain driver to handle the bus protection bits which
are contained in the infacfg register space.

Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-07-06 18:36:31 +02:00
Sascha Hauer c010ff530a ARM64: MediaTek MT8173: Add SCPSYS device node
This adds the SCPSYS device node to the MT8173 dtsi file.

Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-07-06 18:01:45 +02:00
Sascha Hauer 6cf15fc2a1 arm64: dts: mt8173: Add PMIC wrapper device node
This adds the device node for the PMIC wrapper.

Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-07-06 18:01:44 +02:00
Sascha Hauer 0e84faa163 arm64: dts: mt8173: Use real clock for UARTs
We used to use a fixed rate clock for the UARTs. Now that we have clock
support we can associate the correct clocks to the UARTs and drop the
26MHz fixed rate UART clock.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-07-06 18:01:43 +02:00
Sascha Hauer f2ce701495 arm64: dts: mt8173: Add clock controller device nodes
This adds the device nodes providing clocks on the Mediatek MT8173.
These are: topckgen, infracfg, pericfg and apmixedsys. These are
fed by two oscillators also added by this patch.

Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-07-06 18:01:42 +02:00
Sascha Hauer d956b80ac7 soc: mediatek: PMIC wrap: Fix register state machine handling
When the PMIC wrapper state machine has read a register it goes into the
"wait for valid clear" (vldclr) state. The state machine stays in this
state until the VLDCLR bit is written to. We should write this bit after
reading a register because the SCPSYS won't let the system go into
suspend as long as the state machine waits for valid clear.

Since now we never leave the state machine in vldclr state we no longer
have to check for this state on pwrap_read/pwrap_write entry and can
remove the corresponding code.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-05-27 14:11:41 +02:00
Sascha Hauer d71c11f3bd soc: mediatek: PMIC wrap: Fix clock rate handling
replace chipselect extension values based on SPI clock with hardcoded SoC
specific values.

The PMIC wrapper has the ability of extending the chipselects by configurable
amounts of time. We configured the values based on the rate of SPI clock, but
this is wrong. The delays should be configured based on the internal PMIC clock
that latches the values from the SPI bus to the internal PMIC registers. By
default this clock is 24MHz. Other clock frequencies are for debugging only
and can be removed from the driver.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-05-27 14:11:41 +02:00
Sascha Hauer c4b6c26e82 dt-bindings: ARM: Mediatek: use more generic node name in examples
Use 'clock-controller' and 'power-controller' as node names in the
examples rather than the specific names of the units.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
2015-05-07 15:28:03 -07:00
Sascha Hauer c1c325d703 tty: serial: 8250_mtk: Add support for bus clock
The mtk 8250 needs two clocks, one for providing the baudrate and
one that needs to be enabled for register accesses. The latter has
not been supported, this patch adds support for it. It is optional
for now since not all SoCs provide a bus clock.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-05-06 22:27:03 +02:00
Sascha Hauer 68e5fc4a25 tty: serial: 8250_mtk: use pm_runtime callbacks for enabling
The pm_runtime callbacks already enable and disable the device.
Use them in probe() and remove() instead of duplicating the
code. This allows us to concentrate more code for enabling/disabling
the UART in a single place.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-05-06 22:27:02 +02:00
Sascha Hauer a5fd844599 tty: serial: 8250_mtk: Use devm_clk_get
When a struct device * is present clk_get should be used rather
than of_clk_get. Use the devm variant of this function to be able to
drop the clk_put in the error and remove pathes. While at it fix
a wrong error message.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-05-06 22:27:02 +02:00
Sascha Hauer 59f89f21b5 tty: serial: 8250_mtk: remove unnecessary test
When the driver has probed successfully the clk pointer is always valid,
so no need to test for it.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-05-06 22:27:02 +02:00
Sascha Hauer 9eb67f1093 dt-bindings: ARM: Mediatek: Document devicetree bindings for clock/reset controllers
This adds the binding documentation for the apmixedsys, perisys and
infracfg controllers found on Mediatek SoCs.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
2015-05-05 22:50:40 -07:00
Sascha Hauer d633fb7ac1 clk: mediatek: Add reset controller support
The pericfg and infracfg units also provide reset lines to several
other SoC internal units. This adds a function which can be called
from the pericfg and infracfg initialization functions which will
register the reset controller using reset_controller_register. The
reset controller will provide support for resetting the units
connected to the pericfg and infracfg controller. The units resetted
by this controller can use the standard reset device tree binding
to gain access to the reset lines.

Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Philipp Zabel <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
2015-05-05 22:50:33 -07:00
Sascha Hauer 2893c37946 clk: make strings in parent name arrays const
The clk functions and structs declare the parent_name arrays as
'const char **parent_names' which means the parent name strings
are const, but the array itself is not. Use
'const char * const * parent_names' instead which also makes
the array const. This allows us to put the parent_name arrays into
the __initconst section.

Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Tested-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Uwe Kleine-König <[email protected]>
[[email protected]: Squelch 80-character checkpatch warnings]
Signed-off-by: Stephen Boyd <[email protected]>
2015-05-05 22:50:03 -07:00
Sascha Hauer 979275897e dt-bindings: ARM: Mediatek: document binding for the PMIC wrapper
This adds documentation for the PMIC wrapper unit found on Mediatek
SoCs. Currently support are the MT8135 and MT8173 SoCs, but the PMIC
wrapper can also be found on MT6xxx and possibly other SoCs.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Matthias Brugger <[email protected]>
2015-03-30 12:26:35 +02:00
Sascha Hauer 07bf2b54cd mmc: sdhci-esdhc-imx: support voltage-range property
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
2015-03-25 09:46:35 +01:00
Sascha Hauer d3591df3fa mfd: dt-bindings: Add bindings for the MediaTek MT6397 PMIC
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
2015-03-04 08:18:27 +00:00
Sascha Hauer 25185f3f31 mmc: Add SDIO function devicetree subnode parsing
This adds SDIO devicetree subnode parsing to the mmc core. While
SDIO devices are runtime probable they sometimes need nonprobable
additional information on embedded systems, like an additional gpio
interrupt or a clock. This patch makes it possible to supply this
information from the devicetree. SDIO drivers will find a pointer
to the devicenode in their devices of_node pointer.

Signed-off-by: Sascha Hauer <[email protected]>
[[email protected]: Misc. cleanups]
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
2015-01-19 09:56:26 +01:00
Sascha Hauer a31edf1e58 mmc: Add SDIO function subnode DT documentation
While SDIO devices are runtime probable they sometimes need nonprobable
additional information on embedded systems, like an additional gpio
interrupt or a clock. This binding describes how to add child nodes to the
devicetree to supply this information.

Signed-off-by: Sascha Hauer <[email protected]>
[[email protected]: Documented the need for #address- and #size-cells]
[[email protected]: Added a real world example]
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
2015-01-19 09:56:26 +01:00
Sascha Hauer 0f927a11b6 dma: imx-sdma: clarify about firmware not found error
When a firmware cannot be found for the SDMA engine then we can
continue with the internal ROM firmware.

The meaning of this message is frequently asked for, so make clear
that the driver still works with the internal ROM firmware and reduce
the loglevel from err to info.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Fabio Estevam <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Acked-by: Sascha Hauer <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2014-12-05 23:18:53 +05:30
Sascha Hauer 1fadee0c36 net/phy: micrel: Add clock support for KSZ8021/KSZ8031
The KSZ8021 and KSZ8031 support RMII reference input clocks of 25MHz
and 50MHz. Both PHYs differ in the default frequency they expect
after reset. If this differs from the actual input clock, then
register 0x1f bit 7 must be changed.

Signed-off-by: Sascha Hauer <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2014-10-10 15:35:13 -04:00
Sascha Hauer 3d705d14fe mmc: implement Driver Stage Register handling
Some eMMC and SD cards implement a DSR register that allows to tune
raise/fall times and drive strength of the CMD and DATA outputs.
The values to use depend on the card in use and the host.
It might be needed to reduce the drive strength to prevent voltage peaks
above the host's specification.

Implement a 'dsr' devicetree property that allows to specify the value
to set the DSR to. For non-dt setups the new members of mmc_host can be
set by board code.

This patch was initially authored by Sascha Hauer. It contains
improvements authored by Markus Niebel and Uwe Kleine-König.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Markus Niebel <[email protected]>
Signed-off-by: Uwe Kleine-König <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
2014-09-09 13:59:07 +02:00
Sascha Hauer dacf49223f ARM: dts: imx51-babbage: Fix esdhc setup
Since commit 89d7e5c131 (mmc: sdhci-esdhc-imx: add runtime pm
support), controller based card detection / write protection is not
supported anymore by esdhc driver.  Let's use GPIO for CD/WP on esdhc1
instead.

While at it, fix cd gpio polarity for esdhc2. This is wrong and
currently only works because the imx esdhc driver ignores the polarity.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-06-21 15:53:54 +08:00
Sascha Hauer b5dd91b3dc ASoC: fsl-ssi: Set framerate divider correctly for i2s master mode
In i2s master mode the fsl_ssi driver depends on someone calling
.set_tdm_slot correctly. In this mode though only a DC value of
2 is allowed, so set it in this case and no longer depend on
.set_tdm_slot.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Markus Pargmann <[email protected]>
Tested-By: Michael Grzeschik <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2014-06-01 11:55:08 +01:00
Sascha Hauer d8ced4793f ASoC: fsl-ssi: remove unnecessary spinlock
The baudclock_locked variable is only used in functions which
are serialized anyway from the core. No need to have a lock
around the variable, so remove it.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Markus Pargmann <[email protected]>
Tested-By: Michael Grzeschik <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2014-06-01 11:55:07 +01:00
Sascha Hauer 8dd51e23a1 ASoC: fsl-ssi: set bitclock in master mode from hw_params
The fsl_ssi driver uses the .set_sysclk callback to configure the
bitclock for master mode. This is unnecessary since the bitclock
is known in hw_params. This patch configures the bitclock from .hw_params.
.set_dai_sysclk now sets a bitclock frequency which is preferred over
the default calculated bitclock frequency.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Markus Pargmann <[email protected]>
Tested-By: Michael Grzeschik <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2014-06-01 11:55:07 +01:00
Sascha Hauer fcdbadef37 ASoC: fsl-ssi: introduce SoC specific data
Introduce a SoC data struct which contains the differences between
the different SoCs this driver supports. This makes it easy to support
more differences without having to introduce a new switch/case each
time.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Markus Pargmann <[email protected]>
Tested-By: Michael Grzeschik <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2014-06-01 11:55:07 +01:00
Sascha Hauer de906af1cf net: phy: make of_set_phy_supported work with genphy driver
of_set_phy_supported allows overwiting hardware capabilities of
a phy with values from the devicetree. of_set_phy_supported is
called right after phy_device_register in the assumption that
phy_probe is called from phy_device_register and the features
of the phy are already initialized. For the genphy driver this
is not true, here phy_probe is called later during phy_connect
time. phy_probe will then overwrite all settings done from
of_set_phy_supported
Fix this by moving of_set_phy_supported to the core phy code
and calling it from phy_probe.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2014-05-22 15:43:02 -04:00
Sascha Hauer c242a47238 net: phy: genphy: Allow overwriting features
of_set_phy_supported allows overwiting hardware capabilities of
a phy with values from the devicetree. This does not work with
the genphy driver though because the genphys config_init function
will overwrite all values adjusted by of_set_phy_supported. Fix
this by initialising the genphy features in the phy_driver struct
and in config_init just limit the features to the ones the hardware
can actually support. The resulting features are a subset of the
devicetree specified features and the hardware features.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
2014-05-22 15:43:02 -04:00
Sascha Hauer ee9daad495 ASoC: fsl-ssi: Move fsl_ssi_set_dai_sysclk above fsl_ssi_hw_params
fsl_ssi_set_dai_sysclk will be called from fsl_ssi_hw_params in the
next patch. Move up to avoid forward declaration and to keep the next patch
more readable. No functional change.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Markus Pargmann <[email protected]>
Tested-By: Michael Grzeschik <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2014-05-20 23:05:03 +01:00
Sascha Hauer 1885e5de30 ARM: dts: Karo TX25: use hardware ecc
We should use hardware ecc on i.MX. While at it, add the optional
nand-bus-width property.

Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Lothar Waßmann <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-05-16 23:02:11 +08:00
Sascha Hauer 974e587201 ARM: dts: Karo TX25: Add phy reset gpio and supply for FEC
Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Lothar Waßmann <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-05-16 23:02:11 +08:00
Sascha Hauer 8d69043d99 ARM: dts: Karo TX25: Add pinctrl nodes
Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Lothar Waßmann <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-05-16 23:02:10 +08:00
Sascha Hauer 41707314e7 ARM: dts: i.MX25: Add IRAM node
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-05-16 23:02:10 +08:00
Sascha Hauer 9e3a424b8a ARM: dts: i.MX25: Add mmc aliases
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-05-16 23:02:10 +08:00
Sascha Hauer c73dbd7111 ARM: dts: i.MX51 babbage: Fix FEC pad ctrl settings
The dts relied on the FEC pad ctrl settings from the bootloader by
using the NO_PAD_CTRL option. This breaks once the bootloader starts
initializing the pad ctrl settings from the same dts file. Change
to real pad ctrl settings taken from the platform based babbage
support.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-05-16 23:02:09 +08:00
Sascha Hauer 48f5196364 ARM: dts: Add stdout-path property to i.MX boards
This adds the stdout-path property to various i.MX boards. Values
of the property have been taken from barebox, so they should be
correct. Also, the older linux,stdout-path property is converted
to stdout-path.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-05-16 23:02:07 +08:00
Sascha Hauer 5cd15e29a4 ASoC: ak4642: Add support for extended sysclk frequencies of the ak4648
Additionally to the ak4642 pll frequencies the ak4648 also supports 13MHz,
19.2MHz and 26MHz. This adds support for these frequencies.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2014-05-14 12:32:04 +01:00
Sascha Hauer d815c703ce ASoC: ak4642: Add driver data and driver private struct
Currently unused, this is done to let the driver distinguish between
the different supported codec types in later patches.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2014-05-14 12:32:03 +01:00
Sascha Hauer 370f83a156 ASoC: ak4642: Add ALC controls
ALC and ALC Zero crossing detection has been enabled unconditionally.
Add controls for this.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2014-05-14 12:32:03 +01:00
Sascha Hauer da731845d5 ASoC: ak4642: Fix typo zoro -> zero
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
2014-05-14 12:32:03 +01:00
Sascha Hauer 6d66da89bf ARM: dts: i.MX53: Fix ipu register space size
The IPU register space is 128MB, not 2GB.

Fixes: abed9a6bf2 'ARM i.MX53: Add IPU support'
Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Cc: <[email protected]>
Signed-off-by: Olof Johansson <[email protected]>
2014-05-10 20:19:44 -07:00
Sascha Hauer 17b9b3b9e8 ARM: imx6q: clk: Parent DI clocks to video PLL via di_pre_sel
Route the video PLL to the display interface clocks via the di_pre_sel
and di_sel muxes by default.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Philipp Zabel <[email protected]>
Tested-by: Russell King <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-04-15 11:13:06 +08:00
Sascha Hauer 465ca5dc4a ARM: dts: imx6: edmqmx6: Do not use the OTG switch as VBUS regulator
GPIO7_12 switches the D+/D- USB lines on and off. When we use this as
VBUS regulator it means that USB device mode can never work as VBUS is
never turned on in Device mode.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-04-14 10:22:38 +08:00
Sascha Hauer f736386160 clk: turn rate change failed warning into pr_debug
If a rate change failed it's the opportunity of the caller to handle
this. Do not spam the log with a message.

Signed-off-by: Sascha Hauer <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Mike Turquette <[email protected]>
2014-03-20 14:44:47 -07:00
Sascha Hauer 02ae8e8682 ARM i.MX: remove PWM platform support
As the i.MX pwm driver is devicetree only, remove the platform
support for this device.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-03-05 10:35:09 +08:00
Sascha Hauer 557fe99d9d pwm: Remove obsolete HAVE_PWM Kconfig symbol
Before we had the PWM framework we used to have a barebone PWM api. The
HAVE_PWM Kconfig symbol used to be selected by the PWM drivers to specify
the PWM API is present in the kernel. Since the last legacy driver is gone
the HAVE_PWM symbol can go aswell.

Signed-off-by: Sascha Hauer <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Eric Miao <[email protected]>
Cc: Haojian Zhuang <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: Thierry Reding <[email protected]>
Cc: [email protected]
Cc: Russell King <[email protected]>
Cc: Ralf Baechle <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
2014-02-10 11:16:39 +01:00
Sascha Hauer 69144bd744 ARM: dts: imx6q: Add support for Zealz GK802
Add support for the GK802 'QUAD CORE Mini PC', which seems to be loosely
based on the Freescale i.MX6Q HDMI dongle reference design.
It is supposedly identical to the Hiapad Hi802.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-02-10 16:27:41 +08:00
Sascha Hauer 420127e5a5 ARM: dts: imx6: Add DFI FS700-M60 board support
The DFI FS700-M60 is a q7 board with i.MX6 quad, dual, duallite or solo
SoC. This adds support for it.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-02-10 16:27:40 +08:00
Sascha Hauer fb06d65ccc ARM: dts: imx6qdl: Add mmc aliases
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-02-10 16:27:38 +08:00
Sascha Hauer a26be0f051 ARM: dts: imx6q: Add spi4 alias
The quad version has a SPI controller more than the other
versions. Add an alias for it.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-02-10 16:27:36 +08:00
Sascha Hauer f742c22c9b ARM: dts: imx51: Add mmc aliases
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-02-09 21:33:50 +08:00
Sascha Hauer c63d06dedb ARM: dts: imx53: Add mmc aliases
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2014-02-09 21:33:49 +08:00
Sascha Hauer 4d32d04769 video: mx3fb: Allow blocking during framebuffer allocation
No need to allocate the framebuffer from the atomic pool, we are not
in interrupt context. Adding GFP_KERNEL to the framebuffer allocation
allows to use the much bigger CMA pool to allocate the framebuffer.

Signed-off-by: Sascha Hauer <[email protected]>
Cc: Jean-Christophe Plagniol-Villard <[email protected]>
Cc: Tomi Valkeinen <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
2014-01-17 10:57:44 +02:00
Sascha Hauer d1a1dfb2f5 mmc: mxs: use mmc_of_parse to parse devicetree properties
Use generic helper function. This also adds support for the cd-gpios and
max-frequency devicetree properties.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
2014-01-13 12:48:21 -05:00
Sascha Hauer abd37cccd4 mmc: mxs: use mmc_gpio_get_ro for detecting read-only status
This also fixes that the read-only gpio was used without being
requested.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
2014-01-13 12:48:20 -05:00
Sascha Hauer 6c3331d3ac mmc: mxs: use standard flag for cd inverted
We have a MMC_CAP2_CD_ACTIVE_HIGH flag, so use it rather than a custom
driver specific flag.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
2014-01-13 12:48:19 -05:00
Sascha Hauer a91fe279ae mmc: mxs: use standard flag for broken card detection
Use the standard MMC_CAP_NEEDS_POLL flag rather than a custom broken_cd
flag. The original code used to just return true in the card detection
function for broken card detection. The MMC_CAP_NEEDS_POLL works different,
but was introduced for the same purpose, so assume the code works correct
now.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
2014-01-13 12:48:19 -05:00
Sascha Hauer c5f4bc841c mmc: mxs: use standard flag for non-removable status
The standard caps already have a MMC_CAP_NONREMOVABLE flag. Use it
rather than a custom non_removable flag.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
2014-01-13 12:48:18 -05:00
Sascha Hauer c1b55bfcb3 mmc: Do not call get_cd for non removable cards
Non removable cards are always present, so do not call get_cd for them.

Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Ulf Hansson <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
2014-01-13 12:48:17 -05:00
Sascha Hauer 6ee4d7fe1b staging: drm/imx: fix pageflip events during device close
During a device close the drm core frees all pending events in
drm_events_release(). If at that time a pageflip is pending the
interrupt handler will try to complete the now unitialized
event resulting in a NULL pointer exception. Seen on imx-drm
when userspace is killed during a page flip.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11 15:30:33 -07:00
Sascha Hauer fb822a395f staging: drm/imx: make waiting for idle channel optional
Currently we wait for a channel until it's idle before actually
disabling it. This is not needed for all channels though, so make
waiting for idle a separate function and call it where necessary.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2013-10-11 15:30:33 -07:00
Sascha Hauer 58146992c9 mtd: m25p80: make CONFIG_M25PXX_USE_FAST_READ safe to enable
This patch adds a flag to struct flash_info indicating that
fast_read is not supported. This now gives the following logic
when determing whether to enable fastread:

If the flash chip does not support fast_read, then disable it.
Otherwise:
1) enable fast_read if device node contains m25p,fast-read
2) enable fast_read if forced in Kconfig

This makes enabling CONFIG_M25PXX_USE_FAST_READ a safe option
since we no longer enable the fast_read option unconditionally.

For now fast_read is disabled for the everspin mr25h256 and the
catalyst devices. Others may need the flag aswell.

Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Marek Vasut <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2013-08-30 21:44:06 +01:00
Sascha Hauer 7e7d83b32e mtd: m25p80: Pass flags through CAT25_INFO macro
The flags may have to be overwritten, so add them to the CAT25_INFO
macro.

Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Marek Vasut <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2013-08-30 21:43:10 +01:00
Sascha Hauer 8f229fb856 mtd: m25p80: remove unnecessary ifdef
of_property_read_bool properly compiles away, no need to ifdef this
for non DT builds.

Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Marek Vasut <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
2013-08-30 21:42:36 +01:00
Sascha Hauer 0429936697 ARM: i.MX: remove sdma script address arrays from platform data
Now that the sdma driver holds the address tables for i.MX25/5 they
are no longer needed in platform_data. Remove them.

Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2013-08-26 20:47:16 +05:30
Sascha Hauer dcfec3c098 dma: imx-sdma: Add ROM script addresses to driver
This adds the ROM script addresses for i.MX25, i.MX5x and i.MX6 to the
SDMA driver needed for the driver to work without additional firmware.

The ROM script addresses are SoC specific and in some cases even tapeout
specific. This patch adds the ROM script addresses only for SoCs which
do not have a tapeout specific SDMA ROM, because currently it's unclear
how this case should be handled.

Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2013-08-26 20:47:16 +05:30
Sascha Hauer 17bba72f8f dma: imx-sdma: Use struct for driver data
Use a struct type instead of an enum type for distinguishing between
different versions. This makes it simpler to handle multiple differences
without cluttering the code with comparisons for certain devtypes.

Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
2013-08-26 20:47:16 +05:30
Sascha Hauer fae19b8472 cpufreq: imx6q: Fix clock enable balance
For changing the cpu frequency the i.MX6q has to be switched to some
intermediate clock during the PLL reprogramming. The driver tries
to be clever to keep the enable count correct but gets it wrong. If
the cpufreq is increased it calls clk_disable_unprepare twice
on pll2_pfd2_396m. This puts all other devices which get their clock
from pll2_pfd2_396m into a nonworking state.

Fix this by removing the clk enabling/disabling altogether since the
clk core will do this automatically during a reparent.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
2013-08-26 19:34:07 +05:30
Sascha Hauer 406044695f pinctrl: imx: Fix compilation with DEBUG enabled
This became broken with converting the pinmux arrays into struct
types. While at it replace the preprocessor magic with a simple
dev_dbg.

Reported-by: Tushar Behera <[email protected]>
Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Shawn Guo <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
2013-08-23 20:52:46 +02:00
Sascha Hauer aeaa951ff3 ARM: dts: i.MX51: Add USB host1/2 pinmux entries
This adds pinmux entries for USBH1/2 in ULPI mode.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2013-08-22 23:28:40 +08:00
Sascha Hauer dc071436dc ARM: dts: i.MX51 babbage: Add spi-cs-high property to pmic
The mc13892 driver knows that it needs spi-cs-high, so the mc13892
will work. The dataflash also connected to this bus though can only
be probed when the mc13892 is inactive. Due to driver potential
differences in the probe order we can only make sure the mc13892
is inactive when we put the information into the devicetree.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2013-08-22 23:28:39 +08:00
Sascha Hauer a903182016 ARM: dts: i.MX51: move kpp pinmux entry
For keeping the alphabetical order in the pinmux nodes.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2013-08-22 23:28:38 +08:00
Sascha Hauer 80fa058471 ARM: dts: i.MX6: Add i2c and spi aliases
This allows to order the i2c and spi devices correctly.
While at it reorder the aliases entries alphabetically.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2013-08-22 23:28:37 +08:00
Sascha Hauer cf4e577e98 ARM: dts: i.MX53: Add i2c and spi aliases
This allows to order the i2c and spi devices correctly.
While at it reorder the aliases entries alphabetically.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2013-08-22 23:28:36 +08:00
Sascha Hauer e3b73c68b1 ARM: dts: i.MX51: Add i2c and spi aliases
This allows to order the i2c and spi devices correctly.
While at it reorder the aliases entries alphabetically.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
2013-08-22 23:28:35 +08:00