* [PATCH 3/3] arm64: dts: qcom: qcs404: remove unit name for thermal trip points
From: Vinod Koul @ 2019-07-25 13:51 UTC (permalink / raw)
To: Andy Gross
Cc: linux-arm-msm, Bjorn Andersson, Vinod Koul, Rob Herring,
Mark Rutland, devicetree, linux-kernel
In-Reply-To: <20190725135150.9972-1-vkoul@kernel.org>
The thermal trip points have unit name but no reg property, so we can
remove them
arch/arm64/boot/dts/qcom/qcs404.dtsi:1080.31-1084.7: Warning (unit_address_vs_reg): /thermal-zones/aoss-thermal/trips/trip-point@0: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1095.33-1099.7: Warning (unit_address_vs_reg): /thermal-zones/q6-hvx-thermal/trips/trip-point@0: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1110.32-1114.7: Warning (unit_address_vs_reg): /thermal-zones/lpass-thermal/trips/trip-point@0: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1125.31-1129.7: Warning (unit_address_vs_reg): /thermal-zones/wlan-thermal/trips/trip-point@0: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1140.34-1144.7: Warning (unit_address_vs_reg): /thermal-zones/cluster-thermal/trips/trip-point@0: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1145.34-1149.7: Warning (unit_address_vs_reg): /thermal-zones/cluster-thermal/trips/trip-point@1: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1174.31-1178.7: Warning (unit_address_vs_reg): /thermal-zones/cpu0-thermal/trips/trip-point@0: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1179.31-1183.7: Warning (unit_address_vs_reg): /thermal-zones/cpu0-thermal/trips/trip-point@1: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1208.31-1212.7: Warning (unit_address_vs_reg): /thermal-zones/cpu1-thermal/trips/trip-point@0: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1213.31-1217.7: Warning (unit_address_vs_reg): /thermal-zones/cpu1-thermal/trips/trip-point@1: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1242.31-1246.7: Warning (unit_address_vs_reg): /thermal-zones/cpu2-thermal/trips/trip-point@0: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1247.31-1251.7: Warning (unit_address_vs_reg): /thermal-zones/cpu2-thermal/trips/trip-point@1: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1276.31-1280.7: Warning (unit_address_vs_reg): /thermal-zones/cpu3-thermal/trips/trip-point@0: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1281.31-1285.7: Warning (unit_address_vs_reg): /thermal-zones/cpu3-thermal/trips/trip-point@1: node has a unit name, but no reg property
arch/arm64/boot/dts/qcom/qcs404.dtsi:1310.30-1314.7: Warning (unit_address_vs_reg): /thermal-zones/gpu-thermal/trips/trip-point@0: node has a unit name, but no reg property
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
arch/arm64/boot/dts/qcom/qcs404.dtsi | 30 ++++++++++++++--------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/qcs404.dtsi b/arch/arm64/boot/dts/qcom/qcs404.dtsi
index 3d0789775009..6d91dae5aee0 100644
--- a/arch/arm64/boot/dts/qcom/qcs404.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcs404.dtsi
@@ -1077,7 +1077,7 @@
thermal-sensors = <&tsens 0>;
trips {
- aoss_alert0: trip-point@0 {
+ aoss_alert0: trip-point0 {
temperature = <105000>;
hysteresis = <2000>;
type = "hot";
@@ -1092,7 +1092,7 @@
thermal-sensors = <&tsens 1>;
trips {
- q6_hvx_alert0: trip-point@0 {
+ q6_hvx_alert0: trip-point0 {
temperature = <105000>;
hysteresis = <2000>;
type = "hot";
@@ -1107,7 +1107,7 @@
thermal-sensors = <&tsens 2>;
trips {
- lpass_alert0: trip-point@0 {
+ lpass_alert0: trip-point0 {
temperature = <105000>;
hysteresis = <2000>;
type = "hot";
@@ -1122,7 +1122,7 @@
thermal-sensors = <&tsens 3>;
trips {
- wlan_alert0: trip-point@0 {
+ wlan_alert0: trip-point0 {
temperature = <105000>;
hysteresis = <2000>;
type = "hot";
@@ -1137,12 +1137,12 @@
thermal-sensors = <&tsens 4>;
trips {
- cluster_alert0: trip-point@0 {
+ cluster_alert0: trip-point0 {
temperature = <95000>;
hysteresis = <2000>;
type = "hot";
};
- cluster_alert1: trip-point@1 {
+ cluster_alert1: trip-point1 {
temperature = <105000>;
hysteresis = <2000>;
type = "passive";
@@ -1171,12 +1171,12 @@
thermal-sensors = <&tsens 5>;
trips {
- cpu0_alert0: trip-point@0 {
+ cpu0_alert0: trip-point0 {
temperature = <95000>;
hysteresis = <2000>;
type = "hot";
};
- cpu0_alert1: trip-point@1 {
+ cpu0_alert1: trip-point1 {
temperature = <105000>;
hysteresis = <2000>;
type = "passive";
@@ -1205,12 +1205,12 @@
thermal-sensors = <&tsens 6>;
trips {
- cpu1_alert0: trip-point@0 {
+ cpu1_alert0: trip-point0 {
temperature = <95000>;
hysteresis = <2000>;
type = "hot";
};
- cpu1_alert1: trip-point@1 {
+ cpu1_alert1: trip-point1 {
temperature = <105000>;
hysteresis = <2000>;
type = "passive";
@@ -1239,12 +1239,12 @@
thermal-sensors = <&tsens 7>;
trips {
- cpu2_alert0: trip-point@0 {
+ cpu2_alert0: trip-point0 {
temperature = <95000>;
hysteresis = <2000>;
type = "hot";
};
- cpu2_alert1: trip-point@1 {
+ cpu2_alert1: trip-point1 {
temperature = <105000>;
hysteresis = <2000>;
type = "passive";
@@ -1273,12 +1273,12 @@
thermal-sensors = <&tsens 8>;
trips {
- cpu3_alert0: trip-point@0 {
+ cpu3_alert0: trip-point0 {
temperature = <95000>;
hysteresis = <2000>;
type = "hot";
};
- cpu3_alert1: trip-point@1 {
+ cpu3_alert1: trip-point1 {
temperature = <105000>;
hysteresis = <2000>;
type = "passive";
@@ -1307,7 +1307,7 @@
thermal-sensors = <&tsens 9>;
trips {
- gpu_alert0: trip-point@0 {
+ gpu_alert0: trip-point0 {
temperature = <95000>;
hysteresis = <2000>;
type = "hot";
--
2.20.1
^ permalink raw reply related
* [PATCH 2/3] arm64: dts: qcom: pms405: remove reduandant properties
From: Vinod Koul @ 2019-07-25 13:51 UTC (permalink / raw)
To: Andy Gross
Cc: linux-arm-msm, Bjorn Andersson, Vinod Koul, Rob Herring,
Mark Rutland, devicetree, linux-kernel
In-Reply-To: <20190725135150.9972-1-vkoul@kernel.org>
pms405@1 nodes specified unnecessary #address-cells/#size-cells but the
subnodes dont have "ranges" or "reg" so remove it
arch/arm64/boot/dts/qcom/pms405.dtsi:141.21-150.4: Warning (avoid_unnecessary_addr_size): /soc@0/spmi@200f000/pms405@1: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
arch/arm64/boot/dts/qcom/pms405.dtsi | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/pms405.dtsi b/arch/arm64/boot/dts/qcom/pms405.dtsi
index 3c10cf04d26e..32678f7ce90d 100644
--- a/arch/arm64/boot/dts/qcom/pms405.dtsi
+++ b/arch/arm64/boot/dts/qcom/pms405.dtsi
@@ -141,8 +141,6 @@
pms405_1: pms405@1 {
compatible = "qcom,spmi-pmic";
reg = <0x1 SPMI_USID>;
- #address-cells = <1>;
- #size-cells = <0>;
pms405_spmi_regulators: regulators {
compatible = "qcom,pms405-regulators";
--
2.20.1
^ permalink raw reply related
* [PATCH 1/3] arm64: dts: qcom: pms405: add unit name adc nodes
From: Vinod Koul @ 2019-07-25 13:51 UTC (permalink / raw)
To: Andy Gross
Cc: linux-arm-msm, Bjorn Andersson, Vinod Koul, Rob Herring,
Mark Rutland, devicetree, linux-kernel
In-Reply-To: <20190725135150.9972-1-vkoul@kernel.org>
The adc nodes have reg property but were missing the unit name, so add
that to fix these warnings:
arch/arm64/boot/dts/qcom/pms405.dtsi:91.12-94.6: Warning (unit_address_vs_reg): /soc@0/spmi@200f000/pms405@0/adc@3100/ref_gnd: node has a reg or ranges property, but no unit name
arch/arm64/boot/dts/qcom/pms405.dtsi:96.14-99.6: Warning (unit_address_vs_reg): /soc@0/spmi@200f000/pms405@0/adc@3100/vref_1p25: node has a reg or ranges property, but no unit name
arch/arm64/boot/dts/qcom/pms405.dtsi:101.19-104.6: Warning (unit_address_vs_reg): /soc@0/spmi@200f000/pms405@0/adc@3100/vph_pwr: node has a reg or ranges property, but no unit name
arch/arm64/boot/dts/qcom/pms405.dtsi:106.13-109.6: Warning (unit_address_vs_reg): /soc@0/spmi@200f000/pms405@0/adc@3100/die_temp: node has a reg or ranges property, but no unit name
arch/arm64/boot/dts/qcom/pms405.dtsi:111.27-116.6: Warning (unit_address_vs_reg): /soc@0/spmi@200f000/pms405@0/adc@3100/thermistor1: node has a reg or ranges property, but no unit name
arch/arm64/boot/dts/qcom/pms405.dtsi:118.27-123.6: Warning (unit_address_vs_reg): /soc@0/spmi@200f000/pms405@0/adc@3100/thermistor3: node has a reg or ranges property, but no unit name
arch/arm64/boot/dts/qcom/pms405.dtsi:125.22-130.6: Warning (unit_address_vs_reg): /soc@0/spmi@200f000/pms405@0/adc@3100/xo_temp: node has a reg or ranges property, but no unit name
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
arch/arm64/boot/dts/qcom/pms405.dtsi | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/pms405.dtsi b/arch/arm64/boot/dts/qcom/pms405.dtsi
index 14240fedd916..3c10cf04d26e 100644
--- a/arch/arm64/boot/dts/qcom/pms405.dtsi
+++ b/arch/arm64/boot/dts/qcom/pms405.dtsi
@@ -88,41 +88,41 @@
#size-cells = <0>;
#io-channel-cells = <1>;
- ref_gnd {
+ ref_gnd@0 {
reg = <ADC5_REF_GND>;
qcom,pre-scaling = <1 1>;
};
- vref_1p25 {
+ vref_1p25@1 {
reg = <ADC5_1P25VREF>;
qcom,pre-scaling = <1 1>;
};
- pon_1: vph_pwr {
+ pon_1: vph_pwr@131 {
reg = <ADC5_VPH_PWR>;
qcom,pre-scaling = <1 3>;
};
- die_temp {
+ die_temp@6 {
reg = <ADC5_DIE_TEMP>;
qcom,pre-scaling = <1 1>;
};
- pa_therm1: thermistor1 {
+ pa_therm1: thermistor1@115 {
reg = <ADC5_AMUX_THM1_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
- pa_therm3: thermistor3 {
+ pa_therm3: thermistor3@117 {
reg = <ADC5_AMUX_THM3_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
};
- xo_therm: xo_temp {
+ xo_therm: xo_temp@114 {
reg = <ADC5_XO_THERM_100K_PU>;
qcom,ratiometric;
qcom,hw-settle-time = <200>;
--
2.20.1
^ permalink raw reply related
* [PATCH 0/3] arm64: dts: qcom: qcs404: Fix DTS warnings
From: Vinod Koul @ 2019-07-25 13:51 UTC (permalink / raw)
To: Andy Gross
Cc: linux-arm-msm, Bjorn Andersson, Vinod Koul, Rob Herring,
Mark Rutland, devicetree, linux-kernel
So this is second installment of my work to fix warns on qcom DTS, this time
the traget is qcs404 platform.
Vinod Koul (3):
arm64: dts: qcom: pms405: add unit name adc nodes
arm64: dts: qcom: pms405: remove reduandant properties
arm64: dts: qcom: qcs404: remove unit name for thermal trip points
arch/arm64/boot/dts/qcom/pms405.dtsi | 16 +++++++--------
arch/arm64/boot/dts/qcom/qcs404.dtsi | 30 ++++++++++++++--------------
2 files changed, 22 insertions(+), 24 deletions(-)
--
2.20.1
^ permalink raw reply
* Re: [PATCH v7 0/7] Solve postboot supplier cleanup and optimize probe ordering
From: Greg Kroah-Hartman @ 2019-07-25 13:42 UTC (permalink / raw)
To: Saravana Kannan
Cc: Rob Herring, Mark Rutland, Rafael J. Wysocki, Frank Rowand,
devicetree, linux-kernel, David Collins, kernel-team
In-Reply-To: <20190724001100.133423-1-saravanak@google.com>
On Tue, Jul 23, 2019 at 05:10:53PM -0700, Saravana Kannan wrote:
> Add device-links to track functional dependencies between devices
> after they are created (but before they are probed) by looking at
> their common DT bindings like clocks, interconnects, etc.
>
> Having functional dependencies automatically added before the devices
> are probed, provides the following benefits:
>
> - Optimizes device probe order and avoids the useless work of
> attempting probes of devices that will not probe successfully
> (because their suppliers aren't present or haven't probed yet).
>
> For example, in a commonly available mobile SoC, registering just
> one consumer device's driver at an initcall level earlier than the
> supplier device's driver causes 11 failed probe attempts before the
> consumer device probes successfully. This was with a kernel with all
> the drivers statically compiled in. This problem gets a lot worse if
> all the drivers are loaded as modules without direct symbol
> dependencies.
>
> - Supplier devices like clock providers, interconnect providers, etc
> need to keep the resources they provide active and at a particular
> state(s) during boot up even if their current set of consumers don't
> request the resource to be active. This is because the rest of the
> consumers might not have probed yet and turning off the resource
> before all the consumers have probed could lead to a hang or
> undesired user experience.
>
> Some frameworks (Eg: regulator) handle this today by turning off
> "unused" resources at late_initcall_sync and hoping all the devices
> have probed by then. This is not a valid assumption for systems with
> loadable modules. Other frameworks (Eg: clock) just don't handle
> this due to the lack of a clear signal for when they can turn off
> resources. This leads to downstream hacks to handle cases like this
> that can easily be solved in the upstream kernel.
>
> By linking devices before they are probed, we give suppliers a clear
> count of the number of dependent consumers. Once all of the
> consumers are active, the suppliers can turn off the unused
> resources without making assumptions about the number of consumers.
>
> By default we just add device-links to track "driver presence" (probe
> succeeded) of the supplier device. If any other functionality provided
> by device-links are needed, it is left to the consumer/supplier
> devices to change the link when they probe.
>
> v1 -> v2:
> - Drop patch to speed up of_find_device_by_node()
> - Drop depends-on property and use existing bindings
>
> v2 -> v3:
> - Refactor the code to have driver core initiate the linking of devs
> - Have driver core link consumers to supplier before it's probed
> - Add support for drivers to edit the device links before probing
>
> v3 -> v4:
> - Tested edit_links() on system with cyclic dependency. Works.
> - Added some checks to make sure device link isn't attempted from
> parent device node to child device node.
> - Added way to pause/resume sync_state callbacks across
> of_platform_populate().
> - Recursively parse DT node to create device links from parent to
> suppliers of parent and all child nodes.
>
> v4 -> v5:
> - Fixed copy-pasta bugs with linked list handling
> - Walk up the phandle reference till I find an actual device (needed
> for regulators to work)
> - Added support for linking devices from regulator DT bindings
> - Tested the whole series again to make sure cyclic dependencies are
> broken with edit_links() and regulator links are created properly.
>
> v5 -> v6:
> - Split, squashed and reordered some of the patches.
> - Refactored the device linking code to follow the same code pattern for
> any property.
>
> v6 -> v7:
> - No functional changes.
> - Renamed i to index
> - Added comment to clarify not having to check property name for every
> index
> - Added "matched" variable to clarify code. No functional change.
> - Added comments to include/linux/device.h for add_links()
>
> I've also not updated this patch series to handle the new patch [1] from
> Rafael. Will do that once this patch series is close to being Acked.
>
> [1] - https://lore.kernel.org/lkml/3121545.4lOhFoIcdQ@kreacher/
This looks sane to me. Anyone have any objections for me queueing this
up for my tree to get into linux-next now?
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH v3 3/5] devfreq: exynos-bus: convert to use dev_pm_opp_set_rate()
From: Kamil Konieczny @ 2019-07-25 13:35 UTC (permalink / raw)
To: Chanwoo Choi
Cc: Bartlomiej Zolnierkiewicz, Marek Szyprowski, Krzysztof Kozlowski,
Kukjin Kim, Kyungmin Park, Mark Rutland, MyungJoo Ham,
Nishanth Menon, Rob Herring, Stephen Boyd, Viresh Kumar,
devicetree, linux-arm-kernel, linux-kernel, linux-pm,
linux-samsung-soc
In-Reply-To: <beb2455b-7f9e-35df-d524-01f4f51a1c62@samsung.com>
Hi Chanwoo,
On 25.07.2019 12:17, Chanwoo Choi wrote:
> Hi Kamil,
>
> Looks good to me. But, I have some comment. Please check them.
Thank you for review, please see answers below.
> After this patch, exynos_bus_target is perfectly same with
> exynos_bus_passive_target. The exynos_bus_passive_target() could be removed.
Ok, I will make it in separate patch to simplify review process.
> On 19. 7. 20. 오전 12:05, k.konieczny@partner.samsung.com wrote:
>> Reuse opp core code for setting bus clock and voltage. As a side
>> effect this allow useage of coupled regulators feature (required
>
> s/useage/usage ?
Good catch, I will change it.
>> for boards using Exynos5422/5800 SoCs) because dev_pm_opp_set_rate()
>> uses regulator_set_voltage_triplet() for setting regulator voltage
>> while the old code used regulator_set_voltage_tol() with fixed
>> tolerance. This patch also removes no longer needed parsing of DT
>> property "exynos,voltage-tolerance" (no Exynos devfreq DT node uses
>> it).
>>
>> Signed-off-by: Kamil Konieczny <k.konieczny@partner.samsung.com>
>> ---
>> drivers/devfreq/exynos-bus.c | 143 +++++++++--------------------------
>> 1 file changed, 37 insertions(+), 106 deletions(-)
>>
>> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
>> index f391044aa39d..c2147b0912a0 100644
>> --- a/drivers/devfreq/exynos-bus.c
>> +++ b/drivers/devfreq/exynos-bus.c
>> @@ -25,7 +25,6 @@
>> #include <linux/slab.h>
>>
>> #define DEFAULT_SATURATION_RATIO 40
>> -#define DEFAULT_VOLTAGE_TOLERANCE 2
>>
>> struct exynos_bus {
>> struct device *dev;
>> @@ -37,9 +36,9 @@ struct exynos_bus {
>>
>> unsigned long curr_freq;
>>
>> - struct regulator *regulator;
>> + struct opp_table *opp_table;
>> +
>> struct clk *clk;
>> - unsigned int voltage_tolerance;
>> unsigned int ratio;
>> };
>>
>> @@ -99,56 +98,23 @@ static int exynos_bus_target(struct device *dev, unsigned long *freq, u32 flags)
>> {
>> struct exynos_bus *bus = dev_get_drvdata(dev);
>> struct dev_pm_opp *new_opp;
>> - unsigned long old_freq, new_freq, new_volt, tol;
>> int ret = 0;
>>
>> - /* Get new opp-bus instance according to new bus clock */
>> + /* Get correct frequency for bus. */
>> new_opp = devfreq_recommended_opp(dev, freq, flags);
>> if (IS_ERR(new_opp)) {
>> dev_err(dev, "failed to get recommended opp instance\n");
>> return PTR_ERR(new_opp);
>> }
>>
>> - new_freq = dev_pm_opp_get_freq(new_opp);
>> - new_volt = dev_pm_opp_get_voltage(new_opp);
>> dev_pm_opp_put(new_opp);
>>
>> - old_freq = bus->curr_freq;
>> -
>> - if (old_freq == new_freq)
>> - return 0;
>> - tol = new_volt * bus->voltage_tolerance / 100;
>> -
>> /* Change voltage and frequency according to new OPP level */
>> mutex_lock(&bus->lock);
>> + ret = dev_pm_opp_set_rate(dev, *freq);
>> + if (!ret)
>> + bus->curr_freq = *freq;
>>
>> - if (old_freq < new_freq) {
>> - ret = regulator_set_voltage_tol(bus->regulator, new_volt, tol);
>> - if (ret < 0) {
>> - dev_err(bus->dev, "failed to set voltage\n");
>> - goto out;
>> - }
>> - }
>> -
>> - ret = clk_set_rate(bus->clk, new_freq);
>> - if (ret < 0) {
>> - dev_err(dev, "failed to change clock of bus\n");
>> - clk_set_rate(bus->clk, old_freq);
>> - goto out;
>> - }
>> -
>> - if (old_freq > new_freq) {
>> - ret = regulator_set_voltage_tol(bus->regulator, new_volt, tol);
>> - if (ret < 0) {
>> - dev_err(bus->dev, "failed to set voltage\n");
>> - goto out;
>> - }
>> - }
>> - bus->curr_freq = new_freq;
>> -
>> - dev_dbg(dev, "Set the frequency of bus (%luHz -> %luHz, %luHz)\n",
>> - old_freq, new_freq, clk_get_rate(bus->clk));
>> -out:
>> mutex_unlock(&bus->lock);
>>
>> return ret;
>> @@ -195,8 +161,8 @@ static void exynos_bus_exit(struct device *dev)
>> dev_warn(dev, "failed to disable the devfreq-event devices\n");
>>
>> clk_disable_unprepare(bus->clk);
>> - if (bus->regulator)
>> - regulator_disable(bus->regulator);
>> + if (bus->opp_table)
>> + dev_pm_opp_put_regulators(bus->opp_table);
>>
>> dev_pm_opp_of_remove_table(dev);
>> }
>> @@ -209,39 +175,23 @@ static int exynos_bus_passive_target(struct device *dev, unsigned long *freq,
>> {
>> struct exynos_bus *bus = dev_get_drvdata(dev);
>> struct dev_pm_opp *new_opp;
>> - unsigned long old_freq, new_freq;
>> - int ret = 0;
>> + int ret;
>>
>> - /* Get new opp-bus instance according to new bus clock */
>> + /* Get correct frequency for bus. */
>> new_opp = devfreq_recommended_opp(dev, freq, flags);
>> if (IS_ERR(new_opp)) {
>> dev_err(dev, "failed to get recommended opp instance\n");
>> return PTR_ERR(new_opp);
>> }
>>
>> - new_freq = dev_pm_opp_get_freq(new_opp);
>> dev_pm_opp_put(new_opp);
>>
>> - old_freq = bus->curr_freq;
>> -
>> - if (old_freq == new_freq)
>> - return 0;
>> -
>> /* Change the frequency according to new OPP level */
>> mutex_lock(&bus->lock);
>> + ret = dev_pm_opp_set_rate(dev, *freq);
>> + if (!ret)
>> + bus->curr_freq = *freq;
>>
>> - ret = clk_set_rate(bus->clk, new_freq);
>> - if (ret < 0) {
>> - dev_err(dev, "failed to set the clock of bus\n");
>> - goto out;
>> - }
>> -
>> - *freq = new_freq;
>> - bus->curr_freq = new_freq;
>> -
>> - dev_dbg(dev, "Set the frequency of bus (%luHz -> %luHz, %luHz)\n",
>> - old_freq, new_freq, clk_get_rate(bus->clk));
>> -out:
>> mutex_unlock(&bus->lock);
>>
>> return ret;
>> @@ -259,20 +209,9 @@ static int exynos_bus_parent_parse_of(struct device_node *np,
>> struct exynos_bus *bus)
>> {
>> struct device *dev = bus->dev;
>> - int i, ret, count, size;
>> -
>> - /* Get the regulator to provide each bus with the power */
>> - bus->regulator = devm_regulator_get(dev, "vdd");
>> - if (IS_ERR(bus->regulator)) {
>> - dev_err(dev, "failed to get VDD regulator\n");
>> - return PTR_ERR(bus->regulator);
>> - }
>> -
>> - ret = regulator_enable(bus->regulator);
>> - if (ret < 0) {
>> - dev_err(dev, "failed to enable VDD regulator\n");
>> - return ret;
>> - }
>> + struct opp_table *opp_table;
>> + const char *vdd = "vdd";
>> + int i, count, size;
>>
>> /*
>> * Get the devfreq-event devices to get the current utilization of
>> @@ -281,26 +220,29 @@ static int exynos_bus_parent_parse_of(struct device_node *np,
>> count = devfreq_event_get_edev_count(dev);
>> if (count < 0) {
>> dev_err(dev, "failed to get the count of devfreq-event dev\n");
>> - ret = count;
>> - goto err_regulator;
>> + return count;
>> }
>> - bus->edev_count = count;
>>
>> + bus->edev_count = count;
>> size = sizeof(*bus->edev) * count;
>> bus->edev = devm_kzalloc(dev, size, GFP_KERNEL);
>> - if (!bus->edev) {
>> - ret = -ENOMEM;
>> - goto err_regulator;
>> - }
>> + if (!bus->edev)
>> + return -ENOMEM;
>>
>> for (i = 0; i < count; i++) {
>> bus->edev[i] = devfreq_event_get_edev_by_phandle(dev, i);
>> - if (IS_ERR(bus->edev[i])) {
>> - ret = -EPROBE_DEFER;
>> - goto err_regulator;
>> - }
>> + if (IS_ERR(bus->edev[i]))
>> + return -EPROBE_DEFER;
>> + }
>> +
>> + opp_table = dev_pm_opp_set_regulators(dev, &vdd, 1);
>> + if (IS_ERR(opp_table)) {
>> + i = PTR_ERR(opp_table);
>> + dev_err(dev, "failed to set regulators %d\n", i);
>> + return i;
>
> Maybe, you just used the 'i' defined variable instead of adding
> new variable. But, I think that you better to add new variable
> like 'err' for the readability. Or, jut use the 'PTR_ERR(opp_table)'
> directly without any additional variable.
I will remove not related changes, so here I will reuse 'ret' variable.
>> }
>>
>> + bus->opp_table = opp_table;
>
> Add blank line.
OK
>> /*
>> * Optionally, Get the saturation ratio according to Exynos SoC
>> * When measuring the utilization of each AXI bus with devfreq-event
>> @@ -314,16 +256,7 @@ static int exynos_bus_parent_parse_of(struct device_node *np,
>> if (of_property_read_u32(np, "exynos,saturation-ratio", &bus->ratio))
>> bus->ratio = DEFAULT_SATURATION_RATIO;
>>
>> - if (of_property_read_u32(np, "exynos,voltage-tolerance",
>> - &bus->voltage_tolerance))
>> - bus->voltage_tolerance = DEFAULT_VOLTAGE_TOLERANCE;
>> -
>> return 0;
>> -
>> -err_regulator:
>> - regulator_disable(bus->regulator);
>> -
>> - return ret;
>> }
>>
>> static int exynos_bus_parse_of(struct exynos_bus *bus)
>> @@ -414,12 +347,8 @@ static int exynos_bus_probe(struct platform_device *pdev)
>>
>> /* Parse the device-tree to get the resource information */
>> ret = exynos_bus_parse_of(bus);
>> - if (ret < 0) {
>> - if (!passive)
>> - regulator_disable(bus->regulator);
>> -
>> - return ret;
>> - }
>> + if (ret < 0)
>> + goto err_reg;
>>
>> if (passive)
>> goto passive;
>> @@ -512,10 +441,12 @@ static int exynos_bus_probe(struct platform_device *pdev)
>>
>> err:
>> clk_disable_unprepare(bus->clk);
>> - if (!passive)
>> - regulator_disable(bus->regulator);
>> -
>> dev_pm_opp_of_remove_table(dev);
>
> This function removes the 'opp_table'. But, the below code
> uses the 'opp_table' variable by dev_pm_opp_put_regulators().
>
> To disable the regulator, you have to call dev_pm_opp_of_remove_table(dev)
> after dev_pm_opp_put_regulators(bus->opp_table).
Regulators should be set before dev_pm_opp_add_table(), so exit sequence
should be in reverse order,
init order:
exynos_bus_parent_parse_of()
dev_pm_opp_set_regulators()
exynos_bus_parse_of()
clk_prepare_enable()
dev_pm_opp_of_add_table()
exit or error order:
dev_pm_opp_of_remove_table()
clk_disable_unprepare()
if (bus->opp_table)
dev_pm_opp_put_regulators(bus->opp_table);
I will send v4 soon.
>> +err_reg:
>> + if (bus->opp_table) {
>> + dev_pm_opp_put_regulators(bus->opp_table);
>> + bus->opp_table = NULL;
>> + }
>>
>> return ret;
>> }
--
Best regards,
Kamil Konieczny
Samsung R&D Institute Poland
^ permalink raw reply
* Re: [PATCH 3/6] ASoC: codec2codec: deal with params when necessary
From: Jerome Brunet @ 2019-07-25 13:25 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Kevin Hilman, alsa-devel, devicetree, linux-kernel,
linux-amlogic
In-Reply-To: <20190725125534.GB4213@sirena.org.uk>
On Thu 25 Jul 2019 at 13:55, Mark Brown <broonie@kernel.org> wrote:
> On Wed, Jul 24, 2019 at 06:24:02PM +0200, Jerome Brunet wrote:
>
>> Also, params does not need to be dynamically allocated as it does not
>> need to survive the event.
>
> It's dynamically allocated because it's a pretty large structure and so
> the limited stack sizes the kernel has make it a bit uncomfortable to
> put it on the stack.
Ok, I'll revert this in v2
^ permalink raw reply
* Re: [PATCH 1/6] ASoC: codec2codec: run callbacks in order
From: Jerome Brunet @ 2019-07-25 13:21 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Kevin Hilman, alsa-devel, devicetree, linux-kernel,
linux-amlogic
In-Reply-To: <20190725130016.GC4213@sirena.org.uk>
On Thu 25 Jul 2019 at 14:00, Mark Brown <broonie@kernel.org> wrote:
> On Wed, Jul 24, 2019 at 06:24:00PM +0200, Jerome Brunet wrote:
>> When handling dai_link events on codec to codec links, run all .startup()
>> callbacks on sinks and sources before running any .hw_params(). Same goes
>> for hw_free() and shutdown(). This is closer to the behavior of regular
>> dai links
>
> This looks good but needs rebasing against -next due to Morimoto-san's
> recent DAI changes:
>
> CC sound/soc/soc-dapm.o
> sound/soc/soc-dapm.c: In function ‘snd_soc_dai_link_event’:
> sound/soc/soc-dapm.c:3857:10: error: implicit declaration of function ‘soc_dai_hw_params’; did you mean ‘snd_soc_dai_hw_params’? [-Werror=implicit-function-declaration]
> ret = soc_dai_hw_params(&substream, params, source);
> ^~~~~~~~~~~~~~~~~
> snd_soc_dai_hw_params
I did rebase against next and saw Morimoto-san's patchset. I must have
messed up when formatting the patches, sorry about that. I'll resend.
^ permalink raw reply
* Re: [PATCH v2 2/2] mmc: Add support for the ASPEED SD controller
From: Adrian Hunter @ 2019-07-25 13:18 UTC (permalink / raw)
To: Andrew Jeffery, linux-mmc
Cc: mark.rutland, devicetree, ulf.hansson, linux-aspeed,
ryanchen.aspeed, linux-kernel, robh+dt, joel, linux-arm-kernel
In-Reply-To: <20190712033214.24713-3-andrew@aj.id.au>
On 12/07/19 6:32 AM, Andrew Jeffery wrote:
> Add a minimal driver for ASPEED's SD controller, which exposes two
> SDHCIs.
>
> The ASPEED design implements a common register set for the SDHCIs, and
> moves some of the standard configuration elements out to this common
> area (e.g. 8-bit mode, and card detect configuration which is not
> currently supported).
>
> The SD controller has a dedicated hardware interrupt that is shared
> between the slots. The common register set exposes information on which
> slot triggered the interrupt; early revisions of the patch introduced an
> irqchip for the register, but reality is it doesn't behave as an
> irqchip, and the result fits awkwardly into the irqchip APIs. Instead
> I've taken the simple approach of using the IRQ as a shared IRQ with
> some minor performance impact for the second slot.
>
> Ryan was the original author of the patch - I've taken his work and
> massaged it to drop the irqchip support and rework the devicetree
> integration. The driver has been smoke tested under qemu against a
> minimal SD controller model and lightly tested on an ast2500-evb.
>
> Signed-off-by: Ryan Chen <ryanchen.aspeed@gmail.com>
> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Looks fine. Few minor comments below.
> ---
> In v2:
>
> * Drop unnecesasry MODULE_DEVICE_TABLE()
> * Rename sd-controller compatible
> * Add IBM copyright
> * Drop unnecesary data assignment in of match table entries
> * Derive the slot from the SDHCI offset
>
> drivers/mmc/host/Kconfig | 12 ++
> drivers/mmc/host/Makefile | 1 +
> drivers/mmc/host/sdhci-of-aspeed.c | 326 +++++++++++++++++++++++++++++
> 3 files changed, 339 insertions(+)
> create mode 100644 drivers/mmc/host/sdhci-of-aspeed.c
>
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index 931770f17087..2bb5e1264b3d 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -154,6 +154,18 @@ config MMC_SDHCI_OF_ARASAN
>
> If unsure, say N.
>
> +config MMC_SDHCI_OF_ASPEED
> + tristate "SDHCI OF support for the ASPEED SDHCI controller"
> + depends on MMC_SDHCI_PLTFM
> + depends on OF
> + help
> + This selects the ASPEED Secure Digital Host Controller Interface.
> +
> + If you have a controller with this interface, say Y or M here. You
> + also need to enable an appropriate bus interface.
> +
> + If unsure, say N.
> +
> config MMC_SDHCI_OF_AT91
> tristate "SDHCI OF support for the Atmel SDMMC controller"
> depends on MMC_SDHCI_PLTFM
> diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
> index 73578718f119..390ee162fe71 100644
> --- a/drivers/mmc/host/Makefile
> +++ b/drivers/mmc/host/Makefile
> @@ -84,6 +84,7 @@ obj-$(CONFIG_MMC_SDHCI_ESDHC_IMX) += sdhci-esdhc-imx.o
> obj-$(CONFIG_MMC_SDHCI_DOVE) += sdhci-dove.o
> obj-$(CONFIG_MMC_SDHCI_TEGRA) += sdhci-tegra.o
> obj-$(CONFIG_MMC_SDHCI_OF_ARASAN) += sdhci-of-arasan.o
> +obj-$(CONFIG_MMC_SDHCI_OF_ASPEED) += sdhci-of-aspeed.o
> obj-$(CONFIG_MMC_SDHCI_OF_AT91) += sdhci-of-at91.o
> obj-$(CONFIG_MMC_SDHCI_OF_ESDHC) += sdhci-of-esdhc.o
> obj-$(CONFIG_MMC_SDHCI_OF_HLWD) += sdhci-of-hlwd.o
> diff --git a/drivers/mmc/host/sdhci-of-aspeed.c b/drivers/mmc/host/sdhci-of-aspeed.c
> new file mode 100644
> index 000000000000..9528e43c257d
> --- /dev/null
> +++ b/drivers/mmc/host/sdhci-of-aspeed.c
> @@ -0,0 +1,326 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/* Copyright (C) 2019 ASPEED Technology Inc. */
> +/* Copyright (C) 2019 IBM Corp. */
> +
> +#include <linux/clk.h>
> +#include <linux/delay.h>
> +#include <linux/device.h>
> +#include <linux/io.h>
> +#include <linux/mmc/host.h>
> +#include <linux/module.h>
> +#include <linux/of_address.h>
> +#include <linux/of.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
> +#include <linux/spinlock.h>
> +
> +#include "sdhci-pltfm.h"
> +
> +#define ASPEED_SDC_INFO 0x00
> +#define ASPEED_SDC_S1MMC8 BIT(25)
> +#define ASPEED_SDC_S0MMC8 BIT(24)
> +
> +struct aspeed_sdc {
> + struct clk *clk;
> + struct resource *res;
> +
> + spinlock_t lock;
> + void __iomem *regs;
> +};
> +
> +struct aspeed_sdhci {
> + struct aspeed_sdc *parent;
> + u32 width_mask;
> +};
> +
> +static void aspeed_sdc_bus_width(struct aspeed_sdc *sdc,
> + struct aspeed_sdhci *sdhci, bool bus8)
The function name threw me at first. I suggest:
static void aspeed_sdhci_set_clr_8_bit_mode(struct aspeed_sdhci *aspeed_sdhci,
bool bus8)
{
struct aspeed_sdc *aspeed_sdc = aspeed_sdhci->parent;
> +{
> + u32 info;
> +
> + /* Set/clear 8 bit mode */
> + spin_lock(&sdc->lock);
> + info = readl(sdc->regs + ASPEED_SDC_INFO);
> + if (bus8)
> + info |= sdhci->width_mask;
> + else
> + info &= ~sdhci->width_mask;
> + writel(info, sdc->regs + ASPEED_SDC_INFO);
> + spin_unlock(&sdc->lock);
> +}
> +
> +static void aspeed_sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
> +{
> + unsigned long timeout;
> + int div;
> + u16 clk;
> +
> + if (clock == host->clock)
> + return;
> +
> + sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
> +
> + if (clock == 0)
> + goto out;
> +
> + for (div = 1; div < 256; div *= 2) {
> + if ((host->max_clk / div) <= clock)
> + break;
> + }
> + div >>= 1;
> +
> + clk = div << SDHCI_DIVIDER_SHIFT;
Could call sdhci_enable_clk() here.
> + clk |= SDHCI_CLOCK_INT_EN;
> + sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
> +
> + /* Wait max 20 ms */
> + timeout = 20;
> + while (!((clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL))
> + & SDHCI_CLOCK_INT_STABLE)) {
> + if (timeout == 0) {
> + pr_err("%s: Internal clock never stabilised.\n",
> + mmc_hostname(host->mmc));
> + return;
> + }
> + timeout--;
> + mdelay(1);
> + }
> +
> + clk |= SDHCI_CLOCK_CARD_EN;
> + sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
> +
> +out:
> + host->clock = clock;
> +}
> +
> +static void aspeed_sdhci_set_bus_width(struct sdhci_host *host, int width)
> +{
> + struct sdhci_pltfm_host *pltfm_priv;
> + struct aspeed_sdhci *aspeed_sdhci;
> + struct aspeed_sdc *aspeed_sdc;
> + u8 ctrl;
> +
> + pltfm_priv = sdhci_priv(host);
> + aspeed_sdhci = sdhci_pltfm_priv(pltfm_priv);
> + aspeed_sdc = aspeed_sdhci->parent;
> +
> + /* Set/clear 8-bit mode */
> + aspeed_sdc_bus_width(aspeed_sdc, aspeed_sdhci,
> + width == MMC_BUS_WIDTH_8);
> +
> + /* Set/clear 1 or 4 bit mode */
> + ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
> + if (width == MMC_BUS_WIDTH_4)
> + ctrl |= SDHCI_CTRL_4BITBUS;
> + else
> + ctrl &= ~SDHCI_CTRL_4BITBUS;
> + sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
> +}
> +
> +static const struct sdhci_ops aspeed_sdhci_ops = {
> + .set_clock = aspeed_sdhci_set_clock,
> + .get_max_clock = sdhci_pltfm_clk_get_max_clock,
> + .set_bus_width = aspeed_sdhci_set_bus_width,
> + .get_timeout_clock = sdhci_pltfm_clk_get_max_clock,
> + .reset = sdhci_reset,
> + .set_uhs_signaling = sdhci_set_uhs_signaling,
> +};
> +
> +static const struct sdhci_pltfm_data aspeed_sdc_pdata = {
Up to you, but this is for the aspeed_sdhci driver, so I would
have expected it to be called aspeed_sdhci_pdata
> + .ops = &aspeed_sdhci_ops,
> + .quirks = SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN,
> + .quirks2 = SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN,
You don't use sdhci_set_clock() or sdhci_calc_clk(), so it doesn't
look like SDHCI_QUIRK2_CLOCK_DIV_ZERO_BROKEN is needed.
> +};
> +
> +static inline int aspeed_sdhci_calculate_slot(struct aspeed_sdhci *dev,
> + struct resource *res)
> +{
> + resource_size_t delta;
> +
> + if (!res || resource_type(res) != IORESOURCE_MEM)
> + return -EINVAL;
> +
> + if (res->start < dev->parent->res->start)
> + return -EINVAL;
> +
> + delta = res->start - dev->parent->res->start;
> + if (delta & (0x100 - 1))
> + return -EINVAL;
> +
> + return (delta / 0x100) - 1;
> +}
> +
> +static int aspeed_sdhci_probe(struct platform_device *pdev)
> +{
> + struct sdhci_pltfm_host *pltfm_host;
> + struct aspeed_sdhci *dev;
> + struct sdhci_host *host;
> + struct resource *res;
> + int slot;
> + int ret;
> +
> + host = sdhci_pltfm_init(pdev, &aspeed_sdc_pdata, sizeof(*dev));
> + if (IS_ERR(host))
> + return PTR_ERR(host);
> +
> + pltfm_host = sdhci_priv(host);
> + dev = sdhci_pltfm_priv(pltfm_host);
> + dev->parent = dev_get_drvdata(pdev->dev.parent);
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + slot = aspeed_sdhci_calculate_slot(dev, res);
> + if (slot < 0)
> + return slot;
> + dev_info(&pdev->dev, "Configuring for slot %d\n", slot);
> + dev->width_mask = !slot ? ASPEED_SDC_S0MMC8 : ASPEED_SDC_S1MMC8;
That implies that you only support 2 slots which begs the question why
you don't validate slot.
> +
> + sdhci_get_of_property(pdev);
> +
> + pltfm_host->clk = devm_clk_get(&pdev->dev, NULL);
> + if (IS_ERR(pltfm_host->clk))
> + return PTR_ERR(pltfm_host->clk);
> +
> + ret = clk_prepare_enable(pltfm_host->clk);
> + if (ret) {
> + dev_err(&pdev->dev, "Unable to enable SDIO clock\n");
> + goto err_pltfm_free;
> + }
> +
> + ret = mmc_of_parse(host->mmc);
> + if (ret)
> + goto err_sdhci_add;
> +
> + ret = sdhci_add_host(host);
> + if (ret)
> + goto err_sdhci_add;
> +
> + return 0;
> +
> +err_sdhci_add:
> + clk_disable_unprepare(pltfm_host->clk);
> +err_pltfm_free:
> + sdhci_pltfm_free(pdev);
> + return ret;
> +}
> +
> +static int aspeed_sdhci_remove(struct platform_device *pdev)
> +{
> + struct sdhci_pltfm_host *pltfm_host;
> + struct sdhci_host *host;
> + int dead;
> +
> + host = platform_get_drvdata(pdev);
> + pltfm_host = sdhci_priv(host);
> +
> + dead = readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff;
'dead' only makes sense for PCI. Just set it to zero.
> +
> + sdhci_remove_host(host, dead);
> +
> + clk_disable_unprepare(pltfm_host->clk);
> +
> + sdhci_pltfm_free(pdev);
> +
> + return 0;
> +}
> +
> +static const struct of_device_id aspeed_sdhci_of_match[] = {
> + { .compatible = "aspeed,ast2400-sdhci", },
> + { .compatible = "aspeed,ast2500-sdhci", },
> + { }
> +};
> +
> +static struct platform_driver aspeed_sdhci_driver = {
> + .driver = {
> + .name = "sdhci-aspeed",
> + .of_match_table = aspeed_sdhci_of_match,
> + },
> + .probe = aspeed_sdhci_probe,
> + .remove = aspeed_sdhci_remove,
> +};
> +
> +module_platform_driver(aspeed_sdhci_driver);
> +
> +static int aspeed_sdc_probe(struct platform_device *pdev)
> +
> +{
> + struct device_node *parent, *child;
> + struct aspeed_sdc *sdc;
> + int ret;
> +
> + sdc = devm_kzalloc(&pdev->dev, sizeof(*sdc), GFP_KERNEL);
> + if (!sdc)
> + return -ENOMEM;
> +
> + spin_lock_init(&sdc->lock);
> +
> + sdc->clk = devm_clk_get(&pdev->dev, NULL);
> + if (IS_ERR(sdc->clk))
> + return PTR_ERR(sdc->clk);
> +
> + ret = clk_prepare_enable(sdc->clk);
> + if (ret) {
> + dev_err(&pdev->dev, "Unable to enable SDCLK\n");
> + return ret;
> + }
> +
> + sdc->res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + sdc->regs = devm_ioremap_resource(&pdev->dev, sdc->res);
> + if (IS_ERR(sdc->regs)) {
> + ret = PTR_ERR(sdc->regs);
> + goto err_clk;
> + }
> +
> + dev_set_drvdata(&pdev->dev, sdc);
> +
> + parent = pdev->dev.of_node;
> + for_each_available_child_of_node(parent, child) {
> + struct platform_device *cpdev;
> +
> + cpdev = of_platform_device_create(child, NULL, &pdev->dev);
> + if (IS_ERR(cpdev)) {
> + of_node_put(child);
> + ret = PTR_ERR(pdev);
> + goto err_clk;
> + }
> + }
> +
> + return 0;
> +
> +err_clk:
> + clk_disable_unprepare(sdc->clk);
> + return ret;
> +}
> +
> +static int aspeed_sdc_remove(struct platform_device *pdev)
> +{
> + struct aspeed_sdc *sdc = dev_get_drvdata(&pdev->dev);
> +
> + clk_disable_unprepare(sdc->clk);
> +
> + return 0;
> +}
> +
> +static const struct of_device_id aspeed_sdc_of_match[] = {
> + { .compatible = "aspeed,ast2400-sd-controller", },
> + { .compatible = "aspeed,ast2500-sd-controller", },
> + { }
> +};
> +
> +MODULE_DEVICE_TABLE(of, aspeed_sdc_of_match);
> +
> +static struct platform_driver aspeed_sdc_driver = {
> + .driver = {
> + .name = "sd-controller-aspeed",
> + .pm = &sdhci_pltfm_pmops,
> + .of_match_table = aspeed_sdc_of_match,
> + },
> + .probe = aspeed_sdc_probe,
> + .remove = aspeed_sdc_remove,
> +};
> +
> +module_platform_driver(aspeed_sdc_driver);
> +
> +MODULE_DESCRIPTION("Driver for the ASPEED SD/SDIO/SDHCI Controllers");
> +MODULE_AUTHOR("Ryan Chen <ryan_chen@aspeedtech.com>");
> +MODULE_AUTHOR("Andrew Jeffery <andrew@aj.id.au>");
> +MODULE_LICENSE("GPL v2");
>
^ permalink raw reply
* Re: [RFC PATCH 08/11] arm: dts: exynos: Add parents and #interconnect-cells to Exynos4412
From: Chanwoo Choi @ 2019-07-25 13:13 UTC (permalink / raw)
To: Artur Świgoń
Cc: devicetree, linux-samsung-soc, Linux PM list, Seung-Woo Kim,
linux-kernel, dri-devel, inki.dae, Chanwoo Choi, MyungJoo Ham,
Krzysztof Kozlowski, georgi.djakov, linux-arm-kernel,
Marek Szyprowski
In-Reply-To: <20190723122016.30279-9-a.swigon@partner.samsung.com>
2019년 7월 24일 (수) 오전 8:07, Artur Świgoń <a.swigon@partner.samsung.com>님이 작성:
>
> This patch adds two fields tp the Exynos4412 DTS:
> - parent: to declare connections between nodes that are not in a
> parent-child relation in devfreq;
> - #interconnect-cells: required by the interconnect framework.
>
> Please note that #interconnect-cells is always zero and node IDs are not
> hardcoded anywhere.
>
> Signed-off-by: Artur Świgoń <a.swigon@partner.samsung.com>
> ---
> arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 1 +
> arch/arm/boot/dts/exynos4412.dtsi | 9 +++++++++
> 2 files changed, 10 insertions(+)
>
> diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
> index ea55f377d17c..bdd61ae86103 100644
> --- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
> +++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi
> @@ -106,6 +106,7 @@
> &bus_leftbus {
> devfreq-events = <&ppmu_leftbus_3>, <&ppmu_rightbus_3>;
> vdd-supply = <&buck3_reg>;
> + parent = <&bus_dmc>;
It is wrong. 'bus_leftbus' has not any h/w dependency of 'bus_dmc'
and 'bus_leftbus' is not child of 'bus_dmc'.
Even it there are some PMQoS requirement between them,
it it not proper to tie both 'bus_leftbus' and 'bus_dmc'.
> status = "okay";
> };
>
> diff --git a/arch/arm/boot/dts/exynos4412.dtsi b/arch/arm/boot/dts/exynos4412.dtsi
> index d20db2dfe8e2..a70a671acacd 100644
> --- a/arch/arm/boot/dts/exynos4412.dtsi
> +++ b/arch/arm/boot/dts/exynos4412.dtsi
> @@ -390,6 +390,7 @@
> clocks = <&clock CLK_DIV_DMC>;
> clock-names = "bus";
> operating-points-v2 = <&bus_dmc_opp_table>;
> + #interconnect-cells = <0>;
> status = "disabled";
> };
>
> @@ -398,6 +399,7 @@
> clocks = <&clock CLK_DIV_ACP>;
> clock-names = "bus";
> operating-points-v2 = <&bus_acp_opp_table>;
> + #interconnect-cells = <0>;
> status = "disabled";
> };
>
> @@ -406,6 +408,7 @@
> clocks = <&clock CLK_DIV_C2C>;
> clock-names = "bus";
> operating-points-v2 = <&bus_dmc_opp_table>;
> + #interconnect-cells = <0>;
> status = "disabled";
> };
>
> @@ -459,6 +462,7 @@
> clocks = <&clock CLK_DIV_GDL>;
> clock-names = "bus";
> operating-points-v2 = <&bus_leftbus_opp_table>;
> + #interconnect-cells = <0>;
> status = "disabled";
> };
>
> @@ -467,6 +471,7 @@
> clocks = <&clock CLK_DIV_GDR>;
> clock-names = "bus";
> operating-points-v2 = <&bus_leftbus_opp_table>;
> + #interconnect-cells = <0>;
> status = "disabled";
> };
>
> @@ -475,6 +480,7 @@
> clocks = <&clock CLK_ACLK160>;
> clock-names = "bus";
> operating-points-v2 = <&bus_display_opp_table>;
> + #interconnect-cells = <0>;
> status = "disabled";
> };
>
> @@ -483,6 +489,7 @@
> clocks = <&clock CLK_ACLK133>;
> clock-names = "bus";
> operating-points-v2 = <&bus_fsys_opp_table>;
> + #interconnect-cells = <0>;
> status = "disabled";
> };
>
> @@ -491,6 +498,7 @@
> clocks = <&clock CLK_ACLK100>;
> clock-names = "bus";
> operating-points-v2 = <&bus_peri_opp_table>;
> + #interconnect-cells = <0>;
> status = "disabled";
> };
>
> @@ -499,6 +507,7 @@
> clocks = <&clock CLK_SCLK_MFC>;
> clock-names = "bus";
> operating-points-v2 = <&bus_leftbus_opp_table>;
> + #interconnect-cells = <0>;
> status = "disabled";
> };
>
> --
> 2.17.1
>
--
Best Regards,
Chanwoo Choi
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [RFC PATCH 03/11] devfreq: exynos-bus: Change goto-based logic to if-else logic
From: Chanwoo Choi @ 2019-07-25 13:02 UTC (permalink / raw)
To: Artur Świgoń
Cc: devicetree, linux-samsung-soc, Linux PM list, Seung-Woo Kim,
linux-kernel, dri-devel, inki.dae, Chanwoo Choi, MyungJoo Ham,
Krzysztof Kozlowski, georgi.djakov, linux-arm-kernel,
Marek Szyprowski
In-Reply-To: <CAGTfZH09n9UOLMwNrCvcdeRCHYFO4TiB-YG2rMVuxA4bxuLCVw@mail.gmail.com>
2019년 7월 25일 (목) 오후 9:56, Chanwoo Choi <cwchoi00@gmail.com>님이 작성:
>
> 2019년 7월 24일 (수) 오전 8:08, Artur Świgoń <a.swigon@partner.samsung.com>님이 작성:
> >
> > This patch improves code readability by changing the following construct:
> >
> > > if (cond)
> > > goto passive;
> > > foo();
> > > goto out;
> > >passive:
> > > bar();
> > >out:
> >
> > into this:
> >
> > > if (cond)
> > > bar();
> > > else
> > > foo();
> >
> > Signed-off-by: Artur Świgoń <a.swigon@partner.samsung.com>
> > ---
> > drivers/devfreq/exynos-bus.c | 24 +++++++++---------------
> > 1 file changed, 9 insertions(+), 15 deletions(-)
> >
> > diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> > index cf6f6cbd0f55..4bb83b945bf7 100644
> > --- a/drivers/devfreq/exynos-bus.c
> > +++ b/drivers/devfreq/exynos-bus.c
> > @@ -505,25 +505,19 @@ static int exynos_bus_probe(struct platform_device *pdev)
> > node = of_parse_phandle(dev->of_node, "devfreq", 0);
> > if (node) {
> > of_node_put(node);
> > - goto passive;
> > + ret = exynos_bus_profile_init_passive(bus, profile);
> > + if (ret < 0)
> > + goto err;
> > } else {
> > ret = exynos_bus_parent_parse_of(np, bus);
> > + if (ret < 0)
> > + goto err;
> > +
> > + ret = exynos_bus_profile_init(bus, profile);
> > + if (ret < 0)
> > + goto err;
> > }
> >
> > - if (ret < 0)
> > - goto err;
> > -
> > - ret = exynos_bus_profile_init(bus, profile);
> > - if (ret < 0)
> > - goto err;
> > -
> > - goto out;
> > -passive:
> > - ret = exynos_bus_profile_init_passive(bus, profile);
> > - if (ret < 0)
> > - goto err;
> > -
> > -out:
> > max_state = bus->devfreq->profile->max_state;
> > min_freq = (bus->devfreq->profile->freq_table[0] / 1000);
> > max_freq = (bus->devfreq->profile->freq_table[max_state - 1] / 1000);
> > --
> > 2.17.1
> >
>
> It seems more simple than before.
> Instead, please merge patch1/2/3 to one patch. and drop the patch4.
But, I think that you better to drop the cleanup patch from this series
because the series[1] touch the exynos-bus.c driver for coupled regulator.
[1] https://www.spinics.net/lists/arm-kernel/msg741971.html
I recommend that you send the cleanup patch with my comment
either after reviewing the Kamil's patch[1] or rebase this series base
on patch[1].
>
> --
> Best Regards,
> Chanwoo Choi
--
Best Regards,
Chanwoo Choi
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH v2 01/11] dt-bindings: mmc: arasan: Update documentation for SD Card Clock
From: Ulf Hansson @ 2019-07-25 13:00 UTC (permalink / raw)
To: Manish Narani
Cc: mark.rutland@arm.com, kernel@esmil.dk, viresh.kumar@linaro.org,
linux-kernel@vger.kernel.org, Jolly Shah, tony.xie@rock-chips.com,
philipp.tomsich@theobroma-systems.com, heiko@sntech.de,
Rob Herring, linux-rockchip@lists.infradead.org, Rajan Vaja,
Michal Simek, devicetree@vger.kernel.org, Nava kishore Manne,
scott.branden@broadcom.com, ayaka@soulik.info, mdf@kernel.org,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <MN2PR02MB602907616249FF19C1A737D8C1C70@MN2PR02MB6029.namprd02.prod.outlook.com>
On Tue, 23 Jul 2019 at 10:23, Manish Narani <MNARANI@xilinx.com> wrote:
>
> Hi Rob,
>
> Thanks a lot for the review!
>
>
> > -----Original Message-----
> > From: Rob Herring <robh@kernel.org>
> > Sent: Tuesday, July 23, 2019 3:24 AM
> > To: Manish Narani <MNARANI@xilinx.com>
> > Cc: ulf.hansson@linaro.org; mark.rutland@arm.com; heiko@sntech.de; Michal
> > Simek <michals@xilinx.com>; adrian.hunter@intel.com;
> > christoph.muellner@theobroma-systems.com; philipp.tomsich@theobroma-
> > systems.com; viresh.kumar@linaro.org; scott.branden@broadcom.com;
> > ayaka@soulik.info; kernel@esmil.dk; tony.xie@rock-chips.com; Rajan Vaja
> > <RAJANV@xilinx.com>; Jolly Shah <JOLLYS@xilinx.com>; Nava kishore Manne
> > <navam@xilinx.com>; mdf@kernel.org; olof@lixom.net; linux-
> > mmc@vger.kernel.org; devicetree@vger.kernel.org; linux-
> > kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
> > rockchip@lists.infradead.org
> > Subject: Re: [PATCH v2 01/11] dt-bindings: mmc: arasan: Update
> > documentation for SD Card Clock
> >
> > On Mon, Jul 01, 2019 at 10:59:41AM +0530, Manish Narani wrote:
> > > The clock handling is to be updated in the Arasan SDHCI. As the
> > > 'devm_clk_register' is deprecated in the clock framework, this needs to
> > > specify one more clock named 'clk_sdcard' to get the clock in the driver
> > > via 'devm_clk_get()'. This clock represents the clock from controller to
> > > the card.
> >
> > Please explain why in terms of the binding, not some driver calls.
> Okay.
>
> >
> >
> > > Signed-off-by: Manish Narani <manish.narani@xilinx.com>
> > > ---
> > > Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 15 ++++++++++-
> > ----
> > > 1 file changed, 10 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
> > b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
> > > index 1edbb04..15c6397 100644
> > > --- a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
> > > +++ b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
> > > @@ -23,6 +23,10 @@ Required Properties:
> > > - reg: From mmc bindings: Register location and length.
> > > - clocks: From clock bindings: Handles to clock inputs.
> > > - clock-names: From clock bindings: Tuple including "clk_xin" and "clk_ahb"
> > > + Apart from these two there is one more optional clock which
> > > + is "clk_sdcard". This clock represents output clock from
> > > + controller and card. This must be specified when #clock-cells
> > > + is specified.
> > > - interrupts: Interrupt specifier
> > >
> > > Required Properties for "arasan,sdhci-5.1":
> > > @@ -36,9 +40,10 @@ Optional Properties:
> > > - clock-output-names: If specified, this will be the name of the card clock
> > > which will be exposed by this device. Required if #clock-cells is
> > > specified.
> > > - - #clock-cells: If specified this should be the value <0>. With this property
> > > - in place we will export a clock representing the Card Clock. This clock
> > > - is expected to be consumed by our PHY. You must also specify
> > > + - #clock-cells: If specified this should be the value <0>. With this
> > > + property in place we will export one clock representing the Card
> > > + Clock. This clock is expected to be consumed by our PHY. You must also
> > > + specify
> >
> > specify what?
> I think this line was already there, I missed to correct it, Will update in v3.
>
> >
> > The 3rd clock input I assume? This statement means any existing users
> > with 2 clock inputs and #clock-cells are in error now. Is that correct?
> Yes, this is correct. So far there was only one vendor using '#clock-cells' which is Rockchip. I have sent DT patch (02/11) for that also.
> Here this is needed as earlier implementation isn't correct as suggested by Uffe. (https://lkml.org/lkml/2019/6/20/486) .
I am not sure how big of a problem the backwards compatible thingy
with DT is, in general we must not break it. What do you say Manish?
As a workaround, would it be possible to use
of_clk_get_from_provider() somehow to address the compatibility issue?
Or maybe there is another clock API that can help.
Kind regards
Uffe
^ permalink raw reply
* Re: [PATCH 1/6] ASoC: codec2codec: run callbacks in order
From: Mark Brown @ 2019-07-25 13:00 UTC (permalink / raw)
To: Jerome Brunet
Cc: Liam Girdwood, Kevin Hilman, alsa-devel, devicetree, linux-kernel,
linux-amlogic
In-Reply-To: <20190724162405.6574-2-jbrunet@baylibre.com>
[-- Attachment #1: Type: text/plain, Size: 798 bytes --]
On Wed, Jul 24, 2019 at 06:24:00PM +0200, Jerome Brunet wrote:
> When handling dai_link events on codec to codec links, run all .startup()
> callbacks on sinks and sources before running any .hw_params(). Same goes
> for hw_free() and shutdown(). This is closer to the behavior of regular
> dai links
This looks good but needs rebasing against -next due to Morimoto-san's
recent DAI changes:
CC sound/soc/soc-dapm.o
sound/soc/soc-dapm.c: In function ‘snd_soc_dai_link_event’:
sound/soc/soc-dapm.c:3857:10: error: implicit declaration of function ‘soc_dai_hw_params’; did you mean ‘snd_soc_dai_hw_params’? [-Werror=implicit-function-declaration]
ret = soc_dai_hw_params(&substream, params, source);
^~~~~~~~~~~~~~~~~
snd_soc_dai_hw_params
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [RFC PATCH v2 0/4] Input: mpr121-polled: Add polled driver for MPR121
From: Michal Vokáč @ 2019-07-25 12:58 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Rob Herring, Mark Rutland, Shawn Guo, Sascha Hauer, Fabio Estevam,
linux-input, devicetree, linux-kernel, Pengutronix Kernel Team
In-Reply-To: <20190725085753.GA26665@penguin>
On 25. 07. 19 10:57, Dmitry Torokhov wrote:
> Hi Michal,
>
> On Tue, May 21, 2019 at 08:51:17AM +0200, Michal Vokáč wrote:
>> On 21. 05. 19 7:37, Dmitry Torokhov wrote:
>>> Hi Michal,
>>>
>>> On Fri, May 17, 2019 at 03:12:49PM +0200, Michal Vokáč wrote:
>>>> Hi,
>>>>
>>>> I have to deal with a situation where we have a custom i.MX6 based
>>>> platform in production that uses the MPR121 touchkey controller.
>>>> Unfortunately the chip is connected using only the I2C interface.
>>>> The interrupt line is not used. Back in 2015 (Linux v3.14), my
>>>> colleague modded the existing mpr121_touchkey.c driver to use polling
>>>> instead of interrupt.
>>>>
>>>> For quite some time yet I am in a process of updating the product from
>>>> the ancient Freescale v3.14 kernel to the latest mainline and pushing
>>>> any needed changes upstream. The DT files for our imx6dl-yapp4 platform
>>>> already made it into v5.1-rc.
>>>>
>>>> I rebased and updated our mpr121 patch to the latest mainline.
>>>> It is created as a separate driver, similarly to gpio_keys_polled.
>>>>
>>>> The I2C device is quite susceptible to ESD. An ESD test quite often
>>>> causes reset of the chip or some register randomly changes its value.
>>>> The [PATCH 3/4] adds a write-through register cache. With the cache
>>>> this state can be detected and the device can be re-initialied.
>>>>
>>>> The main question is: Is there any chance that such a polled driver
>>>> could be accepted? Is it correct to implement it as a separate driver
>>>> or should it be done as an option in the existing driver? I can not
>>>> really imagine how I would do that though..
>>>>
>>>> There are also certain worries that the MPR121 chip may no longer be
>>>> available in nonspecifically distant future. In case of EOL I will need
>>>> to add a polled driver for an other touchkey chip. May it be already
>>>> in mainline or a completely new one.
>>>
>>> I think that my addition of input_polled_dev was ultimately a wrong
>>> thing to do. I am looking into enabling polling mode for regular input
>>> devices as we then can enable polling mode in existing drivers.
>>
>> OK, that sounds good. Especially when one needs to switch from one chip
>> to another that is already in tree, the need for a whole new polling
>> driver is eliminated.
>
> Could you please try the patch below and see if it works for your use
> case? Note that I have not tried running it, but it compiles so it must
> be good ;)
Hi Dmitry,
Thank you very much for the patch!
I gave it a shot and it seems you forgot to add the input-poller.h file
to the patch.. it does not compile on my side :(
> Input: add support for polling to input devices
>
> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>
> Separating "normal" and "polled" input devices was a mistake, as often we want
> to allow the very same device work on both interrupt-driven and polled mode,
> depending on the board on which the device is used.
>
> This introduces new APIs:
>
> - input_setup_polling
> - input_set_poll_interval
> - input_set_min_poll_interval
> - input_set_max_poll_interval
>
> These new APIs allow switching an input device into polled mode with sysfs
> attributes matching drivers using input_polled_dev APIs that will be eventually
> removed.
After reading this I am not really sure what else needs to be done
to test/use the poller. I suspect I need to modify the input device
driver (mpr121_touchkey.c in my case) like this:
If the interrupt gpio is not provided in DT, the device driver probe
function should:
- not request the threaded interrupt
- call input_setup_polling and provide it with poll_fn
Can the mpr_touchkey_interrupt function be used as is for this
purpose? The only problem I see is it returns IRQ_HANDLED.
- set the poll interval + min/max interval
- register the input device as usual (input_register_device)
- What about the device_init_wakeup? It does not make sense for
polling I think.
Just nitpicking - I also ran checkpatch.pl on the patch and it spits
out some warnings. I am not sure whether some of those should not
be fixed.
Thanks, Michal
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> drivers/input/Makefile | 2
> drivers/input/input-poller.c | 207 ++++++++++++++++++++++++++++++++++++++++++
> drivers/input/input.c | 36 ++++++-
> include/linux/input.h | 10 ++
> 4 files changed, 247 insertions(+), 8 deletions(-)
> create mode 100644 drivers/input/input-poller.c
>
> diff --git a/drivers/input/Makefile b/drivers/input/Makefile
> index 40de6a7be641..e35650930371 100644
> --- a/drivers/input/Makefile
> +++ b/drivers/input/Makefile
> @@ -6,7 +6,7 @@
> # Each configuration option enables a list of files.
>
> obj-$(CONFIG_INPUT) += input-core.o
> -input-core-y := input.o input-compat.o input-mt.o ff-core.o
> +input-core-y := input.o input-compat.o input-mt.o input-poller.o ff-core.o
>
> obj-$(CONFIG_INPUT_FF_MEMLESS) += ff-memless.o
> obj-$(CONFIG_INPUT_POLLDEV) += input-polldev.o
> diff --git a/drivers/input/input-poller.c b/drivers/input/input-poller.c
> new file mode 100644
> index 000000000000..008d6f362d60
> --- /dev/null
> +++ b/drivers/input/input-poller.c
> @@ -0,0 +1,207 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Support for polling mode for input devices.
> + */
> +
> +#include <linux/device.h>
> +#include <linux/input.h>
> +#include <linux/jiffies.h>
> +#include <linux/mutex.h>
> +#include <linux/slab.h>
> +#include <linux/types.h>
> +#include <linux/workqueue.h>
> +#include "input-poller.h"
> +
> +struct input_dev_poller {
> + void (*poll)(struct input_dev *dev);
> +
> + unsigned int poll_interval; /* msec */
> + unsigned int poll_interval_max; /* msec */
> + unsigned int poll_interval_min; /* msec */
> +
> + struct input_dev *input;
> + struct delayed_work work;
> +};
> +
> +static void input_dev_poller_queue_work(struct input_dev_poller *poller)
> +{
> + unsigned long delay;
> +
> + delay = msecs_to_jiffies(poller->poll_interval);
> + if (delay >= HZ)
> + delay = round_jiffies_relative(delay);
> +
> + queue_delayed_work(system_freezable_wq, &poller->work, delay);
> +}
> +
> +static void input_dev_poller_work(struct work_struct *work)
> +{
> + struct input_dev_poller *poller =
> + container_of(work, struct input_dev_poller, work.work);
> +
> + poller->poll(poller->input);
> + input_dev_poller_queue_work(poller);
> +}
> +
> +void input_dev_poller_finalize(struct input_dev_poller *poller)
> +{
> + if (!poller->poll_interval)
> + poller->poll_interval = 500;
> + if (!poller->poll_interval_max)
> + poller->poll_interval_max = poller->poll_interval;
> +}
> +
> +void input_dev_poller_start(struct input_dev_poller *poller)
> +{
> + /* Only start polling if polling is enabled */
> + if (poller->poll_interval > 0) {
> + poller->poll(poller->input);
> + input_dev_poller_queue_work(poller);
> + }
> +}
> +
> +void input_dev_poller_stop(struct input_dev_poller *poller)
> +{
> + cancel_delayed_work_sync(&poller->work);
> +}
> +
> +int input_setup_polling(struct input_dev *dev,
> + void (*poll_fn)(struct input_dev *dev))
> +{
> + struct input_dev_poller *poller;
> +
> + poller = kzalloc(sizeof(*poller), GFP_KERNEL);
> + if (!poller) {
> + dev_err(dev->dev.parent ?: &dev->dev,
> + "%s: unable to allocate poller structure\n", __func__);
> + return -ENOMEM;
> + }
> +
> + INIT_DELAYED_WORK(&poller->work, input_dev_poller_work);
> + poller->poll = poll_fn;
> +
> + dev->poller = poller;
> + return 0;
> +}
> +EXPORT_SYMBOL(input_setup_polling);
> +
> +static bool input_dev_ensure_poller(struct input_dev *dev)
> +{
> + if (!dev->poller) {
> + dev_err(dev->dev.parent ?: &dev->dev,
> + "poller structure has not been set up\n");
> + return false;
> + }
> +
> + return true;
> +}
> +
> +void input_set_poll_interval(struct input_dev *dev, unsigned int interval)
> +{
> + if (input_dev_ensure_poller(dev))
> + dev->poller->poll_interval = interval;
> +}
> +EXPORT_SYMBOL(input_set_poll_interval);
> +
> +void input_set_min_poll_interval(struct input_dev *dev, unsigned int interval)
> +{
> + if (input_dev_ensure_poller(dev))
> + dev->poller->poll_interval_min = interval;
> +}
> +EXPORT_SYMBOL(input_set_min_poll_interval);
> +
> +void input_set_max_poll_interval(struct input_dev *dev, unsigned int interval)
> +{
> + if (input_dev_ensure_poller(dev))
> + dev->poller->poll_interval_max = interval;
> +}
> +EXPORT_SYMBOL(input_set_max_poll_interval);
> +
> +/* SYSFS interface */
> +
> +static ssize_t input_dev_get_poll_interval(struct device *dev,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + struct input_dev *input = to_input_dev(dev);
> +
> + return sprintf(buf, "%d\n", input->poller->poll_interval);
> +}
> +
> +static ssize_t input_dev_set_poll_interval(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t count)
> +{
> + struct input_dev *input = to_input_dev(dev);
> + struct input_dev_poller *poller = input->poller;
> + unsigned int interval;
> + int err;
> +
> + err = kstrtouint(buf, 0, &interval);
> + if (err)
> + return err;
> +
> + if (interval < poller->poll_interval_min)
> + return -EINVAL;
> +
> + if (interval > poller->poll_interval_max)
> + return -EINVAL;
> +
> + mutex_lock(&input->mutex);
> +
> + poller->poll_interval = interval;
> +
> + if (input->users) {
> + cancel_delayed_work_sync(&poller->work);
> + if (poller->poll_interval > 0)
> + input_dev_poller_queue_work(poller);
> + }
> +
> + mutex_unlock(&input->mutex);
> +
> + return count;
> +}
> +
> +static DEVICE_ATTR(poll, S_IRUGO | S_IWUSR,
> + input_dev_get_poll_interval, input_dev_set_poll_interval);
> +
> +static ssize_t input_dev_get_poll_max(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct input_dev *input = to_input_dev(dev);
> +
> + return sprintf(buf, "%d\n", input->poller->poll_interval_max);
> +}
> +
> +static DEVICE_ATTR(max, S_IRUGO, input_dev_get_poll_max, NULL);
> +
> +static ssize_t input_dev_get_poll_min(struct device *dev,
> + struct device_attribute *attr, char *buf)
> +{
> + struct input_dev *input = to_input_dev(dev);
> +
> + return sprintf(buf, "%d\n", input->poller->poll_interval_min);
> +}
> +
> +static DEVICE_ATTR(min, S_IRUGO, input_dev_get_poll_min, NULL);
> +
> +static umode_t input_poller_attrs_visible(struct kobject *kobj,
> + struct attribute *attr, int n)
> +{
> + struct device *dev = kobj_to_dev(kobj);
> + struct input_dev *input = to_input_dev(dev);
> +
> + return input->poller ? attr->mode : 0;
> +}
> +
> +static struct attribute *input_poller_attrs[] = {
> + &dev_attr_poll.attr,
> + &dev_attr_max.attr,
> + &dev_attr_min.attr,
> + NULL
> +};
> +
> +struct attribute_group input_poller_attribute_group = {
> + .is_visible = input_poller_attrs_visible,
> + .attrs = input_poller_attrs,
> +};
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index 7f3c5fcb9ed6..6b87c07d5981 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -24,6 +24,7 @@
> #include <linux/mutex.h>
> #include <linux/rcupdate.h>
> #include "input-compat.h"
> +#include "input-poller.h"
>
> MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
> MODULE_DESCRIPTION("Input core");
> @@ -603,20 +604,31 @@ int input_open_device(struct input_handle *handle)
>
> handle->open++;
>
> - if (!dev->users++ && dev->open)
> - retval = dev->open(dev);
> + if (dev->users++) {
> + /*
> + * Device is already opened, so we can exit immediately and
> + * report success.
> + */
> + goto out;
> + }
>
> - if (retval) {
> - dev->users--;
> - if (!--handle->open) {
> + if (dev->open) {
> + retval = dev->open(dev);
> + if (retval) {
> + dev->users--;
> + handle->open--;
> /*
> * Make sure we are not delivering any more events
> * through this handle
> */
> synchronize_rcu();
> + goto out;
> }
> }
>
> + if (dev->poller)
> + input_dev_poller_start(dev->poller);
> +
> out:
> mutex_unlock(&dev->mutex);
> return retval;
> @@ -655,8 +667,13 @@ void input_close_device(struct input_handle *handle)
>
> __input_release_device(handle);
>
> - if (!--dev->users && dev->close)
> - dev->close(dev);
> + if (!--dev->users) {
> + if (dev->poller)
> + input_dev_poller_stop(dev->poller);
> +
> + if (dev->close)
> + dev->close(dev);
> + }
>
> if (!--handle->open) {
> /*
> @@ -1502,6 +1519,7 @@ static const struct attribute_group *input_dev_attr_groups[] = {
> &input_dev_attr_group,
> &input_dev_id_attr_group,
> &input_dev_caps_attr_group,
> + &input_poller_attribute_group,
> NULL
> };
>
> @@ -1511,6 +1529,7 @@ static void input_dev_release(struct device *device)
>
> input_ff_destroy(dev);
> input_mt_destroy_slots(dev);
> + kfree(dev->poller);
> kfree(dev->absinfo);
> kfree(dev->vals);
> kfree(dev);
> @@ -2135,6 +2154,9 @@ int input_register_device(struct input_dev *dev)
> if (!dev->setkeycode)
> dev->setkeycode = input_default_setkeycode;
>
> + if (dev->poller)
> + input_dev_poller_finalize(dev->poller);
> +
> error = device_add(&dev->dev);
> if (error)
> goto err_free_vals;
> diff --git a/include/linux/input.h b/include/linux/input.h
> index 510e78558c10..956f32be87cc 100644
> --- a/include/linux/input.h
> +++ b/include/linux/input.h
> @@ -21,6 +21,8 @@
> #include <linux/timer.h>
> #include <linux/mod_devicetable.h>
>
> +struct input_dev_poller;
> +
> /**
> * struct input_value - input value representation
> * @type: type of value (EV_KEY, EV_ABS, etc)
> @@ -147,6 +149,8 @@ struct input_dev {
>
> struct ff_device *ff;
>
> + struct input_dev_poller *poller;
> +
> unsigned int repeat_key;
> struct timer_list timer;
>
> @@ -361,6 +365,12 @@ void input_unregister_device(struct input_dev *);
>
> void input_reset_device(struct input_dev *);
>
> +int input_setup_polling(struct input_dev *dev,
> + void (*poll_fn)(struct input_dev *dev));
> +void input_set_poll_interval(struct input_dev *dev, unsigned int interval);
> +void input_set_min_poll_interval(struct input_dev *dev, unsigned int interval);
> +void input_set_max_poll_interval(struct input_dev *dev, unsigned int interval);
> +
> int __must_check input_register_handler(struct input_handler *);
> void input_unregister_handler(struct input_handler *);
>
>
^ permalink raw reply
* Re: [RFC PATCH 03/11] devfreq: exynos-bus: Change goto-based logic to if-else logic
From: Chanwoo Choi @ 2019-07-25 12:56 UTC (permalink / raw)
To: Artur Świgoń
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
Linux PM list, dri-devel, Krzysztof Kozlowski, Chanwoo Choi,
MyungJoo Ham, inki.dae, Seung-Woo Kim, georgi.djakov,
Marek Szyprowski
In-Reply-To: <20190723122016.30279-4-a.swigon@partner.samsung.com>
2019년 7월 24일 (수) 오전 8:08, Artur Świgoń <a.swigon@partner.samsung.com>님이 작성:
>
> This patch improves code readability by changing the following construct:
>
> > if (cond)
> > goto passive;
> > foo();
> > goto out;
> >passive:
> > bar();
> >out:
>
> into this:
>
> > if (cond)
> > bar();
> > else
> > foo();
>
> Signed-off-by: Artur Świgoń <a.swigon@partner.samsung.com>
> ---
> drivers/devfreq/exynos-bus.c | 24 +++++++++---------------
> 1 file changed, 9 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> index cf6f6cbd0f55..4bb83b945bf7 100644
> --- a/drivers/devfreq/exynos-bus.c
> +++ b/drivers/devfreq/exynos-bus.c
> @@ -505,25 +505,19 @@ static int exynos_bus_probe(struct platform_device *pdev)
> node = of_parse_phandle(dev->of_node, "devfreq", 0);
> if (node) {
> of_node_put(node);
> - goto passive;
> + ret = exynos_bus_profile_init_passive(bus, profile);
> + if (ret < 0)
> + goto err;
> } else {
> ret = exynos_bus_parent_parse_of(np, bus);
> + if (ret < 0)
> + goto err;
> +
> + ret = exynos_bus_profile_init(bus, profile);
> + if (ret < 0)
> + goto err;
> }
>
> - if (ret < 0)
> - goto err;
> -
> - ret = exynos_bus_profile_init(bus, profile);
> - if (ret < 0)
> - goto err;
> -
> - goto out;
> -passive:
> - ret = exynos_bus_profile_init_passive(bus, profile);
> - if (ret < 0)
> - goto err;
> -
> -out:
> max_state = bus->devfreq->profile->max_state;
> min_freq = (bus->devfreq->profile->freq_table[0] / 1000);
> max_freq = (bus->devfreq->profile->freq_table[max_state - 1] / 1000);
> --
> 2.17.1
>
It seems more simple than before.
Instead, please merge patch1/2/3 to one patch. and drop the patch4.
--
Best Regards,
Chanwoo Choi
^ permalink raw reply
* Re: [PATCH 3/6] ASoC: codec2codec: deal with params when necessary
From: Mark Brown @ 2019-07-25 12:55 UTC (permalink / raw)
To: Jerome Brunet
Cc: Liam Girdwood, Kevin Hilman, alsa-devel, devicetree, linux-kernel,
linux-amlogic
In-Reply-To: <20190724162405.6574-4-jbrunet@baylibre.com>
[-- Attachment #1: Type: text/plain, Size: 329 bytes --]
On Wed, Jul 24, 2019 at 06:24:02PM +0200, Jerome Brunet wrote:
> Also, params does not need to be dynamically allocated as it does not
> need to survive the event.
It's dynamically allocated because it's a pretty large structure and so
the limited stack sizes the kernel has make it a bit uncomfortable to
put it on the stack.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [RFC PATCH 04/11] devfreq: exynos-bus: Clean up code
From: Chanwoo Choi @ 2019-07-25 12:50 UTC (permalink / raw)
To: Artur Świgoń
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
Linux PM list, dri-devel, Krzysztof Kozlowski, Chanwoo Choi,
MyungJoo Ham, inki.dae, Seung-Woo Kim, georgi.djakov,
Marek Szyprowski
In-Reply-To: <20190723122016.30279-5-a.swigon@partner.samsung.com>
2019년 7월 24일 (수) 오전 8:07, Artur Świgoń <a.swigon@partner.samsung.com>님이 작성:
>
> This patch adds minor improvements to the exynos-bus driver.
>
> Signed-off-by: Artur Świgoń <a.swigon@partner.samsung.com>
> ---
> drivers/devfreq/exynos-bus.c | 49 ++++++++++++++++--------------------
> 1 file changed, 22 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> index 4bb83b945bf7..412511ca7703 100644
> --- a/drivers/devfreq/exynos-bus.c
> +++ b/drivers/devfreq/exynos-bus.c
> @@ -15,11 +15,10 @@
> #include <linux/device.h>
> #include <linux/export.h>
> #include <linux/module.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> #include <linux/pm_opp.h>
> #include <linux/platform_device.h>
> #include <linux/regulator/consumer.h>
> -#include <linux/slab.h>
>
> #define DEFAULT_SATURATION_RATIO 40
> #define DEFAULT_VOLTAGE_TOLERANCE 2
> @@ -256,7 +255,7 @@ static int exynos_bus_parent_parse_of(struct device_node *np,
> struct exynos_bus *bus)
> {
> struct device *dev = bus->dev;
> - int i, ret, count, size;
> + int i, ret, count;
>
> /* Get the regulator to provide each bus with the power */
> bus->regulator = devm_regulator_get(dev, "vdd");
> @@ -283,8 +282,7 @@ static int exynos_bus_parent_parse_of(struct device_node *np,
> }
> bus->edev_count = count;
>
> - size = sizeof(*bus->edev) * count;
> - bus->edev = devm_kzalloc(dev, size, GFP_KERNEL);
> + bus->edev = devm_kcalloc(dev, count, sizeof(*bus->edev), GFP_KERNEL);
> if (!bus->edev) {
> ret = -ENOMEM;
> goto err_regulator;
> @@ -388,7 +386,7 @@ static int exynos_bus_profile_init(struct exynos_bus *bus,
> ondemand_data = devm_kzalloc(dev, sizeof(*ondemand_data), GFP_KERNEL);
> if (!ondemand_data) {
> ret = -ENOMEM;
> - goto err;
> + goto out;
> }
> ondemand_data->upthreshold = 40;
> ondemand_data->downdifferential = 5;
> @@ -400,14 +398,14 @@ static int exynos_bus_profile_init(struct exynos_bus *bus,
> if (IS_ERR(bus->devfreq)) {
> dev_err(dev, "failed to add devfreq device\n");
> ret = PTR_ERR(bus->devfreq);
> - goto err;
> + goto out;
> }
>
> /* Register opp_notifier to catch the change of OPP */
> ret = devm_devfreq_register_opp_notifier(dev, bus->devfreq);
> if (ret < 0) {
> dev_err(dev, "failed to register opp notifier\n");
> - goto err;
> + goto out;
> }
>
> /*
> @@ -417,16 +415,16 @@ static int exynos_bus_profile_init(struct exynos_bus *bus,
> ret = exynos_bus_enable_edev(bus);
> if (ret < 0) {
> dev_err(dev, "failed to enable devfreq-event devices\n");
> - goto err;
> + goto out;
> }
>
> ret = exynos_bus_set_event(bus);
> if (ret < 0) {
> dev_err(dev, "failed to set event to devfreq-event devices\n");
> - goto err;
> + goto out;
> }
>
> -err:
> +out:
> return ret;
> }
>
> @@ -446,27 +444,28 @@ static int exynos_bus_profile_init_passive(struct exynos_bus *bus,
> parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0);
> if (IS_ERR(parent_devfreq)) {
> ret = -EPROBE_DEFER;
> - goto err;
> + goto out;
> }
>
> passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL);
> if (!passive_data) {
> ret = -ENOMEM;
> - goto err;
> + goto out;
> }
> passive_data->parent = parent_devfreq;
>
> /* Add devfreq device for exynos bus with passive governor */
> - bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE,
> + bus->devfreq = devm_devfreq_add_device(dev, profile,
> + DEVFREQ_GOV_PASSIVE,
> passive_data);
> if (IS_ERR(bus->devfreq)) {
> dev_err(dev,
> "failed to add devfreq dev with passive governor\n");
> ret = PTR_ERR(bus->devfreq);
> - goto err;
> + goto out;
> }
>
> -err:
> +out:
> return ret;
> }
>
> @@ -484,11 +483,11 @@ static int exynos_bus_probe(struct platform_device *pdev)
> return -EINVAL;
> }
>
> - bus = devm_kzalloc(&pdev->dev, sizeof(*bus), GFP_KERNEL);
> + bus = devm_kzalloc(dev, sizeof(*bus), GFP_KERNEL);
> if (!bus)
> return -ENOMEM;
> mutex_init(&bus->lock);
> - bus->dev = &pdev->dev;
> + bus->dev = dev;
> platform_set_drvdata(pdev, bus);
>
> /* Parse the device-tree to get the resource information */
> @@ -502,7 +501,7 @@ static int exynos_bus_probe(struct platform_device *pdev)
> goto err;
> }
>
> - node = of_parse_phandle(dev->of_node, "devfreq", 0);
> + node = of_parse_phandle(np, "devfreq", 0);
> if (node) {
> of_node_put(node);
> ret = exynos_bus_profile_init_passive(bus, profile);
> @@ -547,12 +546,10 @@ static int exynos_bus_resume(struct device *dev)
> int ret;
>
> ret = exynos_bus_enable_edev(bus);
> - if (ret < 0) {
> + if (ret < 0)
> dev_err(dev, "failed to enable the devfreq-event devices\n");
> - return ret;
> - }
>
> - return 0;
> + return ret;
> }
>
> static int exynos_bus_suspend(struct device *dev)
> @@ -561,12 +558,10 @@ static int exynos_bus_suspend(struct device *dev)
> int ret;
>
NACK.
> ret = exynos_bus_disable_edev(bus);
> - if (ret < 0) {
> + if (ret < 0)
> dev_err(dev, "failed to disable the devfreq-event devices\n");
> - return ret;
> - }
>
> - return 0;
> + return ret;
> }
> #endif
>
> --
> 2.17.1
>
NACK.
As I already commented, It has never any benefit.
I think that it is not usful. Please drop it.
--
Best Regards,
Chanwoo Choi
^ permalink raw reply
* Re: [PATCH v3 00/11] clk: imx8: add new clock binding for better pm support
From: Dong Aisheng @ 2019-07-25 12:48 UTC (permalink / raw)
To: Dong Aisheng
Cc: devicetree, sboyd, Michael Turquette, Rob Herring, dl-linux-imx,
Sascha Hauer, Fabio Estevam, Shawn Guo, linux-clk,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
In-Reply-To: <1563289265-10977-1-git-send-email-aisheng.dong@nxp.com>
Hi Rob & Stephen & Shawn,
Could you help review this patchset?
We're pretty stuck here for a long time and a lot continued work are blocked.
We really need your kind help.
The related DT patches could be found here:
https://patchwork.kernel.org/cover/11046341/
Regards
Aisheng
On Tue, Jul 16, 2019 at 11:23 PM Dong Aisheng <aisheng.dong@nxp.com> wrote:
>
> This is a follow up of this patch series.
> https://patchwork.kernel.org/cover/10924029/
> [V2,0/2] clk: imx: scu: add parsing clocks from device tree support
>
> This patch series is a preparation for the MX8 Architecture improvement.
> As for IMX SCU based platforms like MX8QM and MX8QXP, they are comprised
> of a couple of SS(Subsystems) while most of them within the same SS
> can be shared. e.g. Clocks, Devices and etc.
>
> However, current clock binding is using SW IDs for device tree to use
> which can cause troubles in writing the common <soc>-ss-xx.dtsi file for
> different SoCs.
>
> This patch series aims to introduce a new binding which is more close to
> hardware and platform independent and can makes us write a more general
> drivers for different SCU based SoCs.
>
> Another important thing is that on MX8, each Clock resource is associated
> with a power domain. So we have to attach that clock device to the power
> domain in order to make it work properly. Further more, the clock state
> will be lost when its power domain is completely off during suspend/resume,
> so we also introduce the clock state save&restore mechanism.
>
> ChangeLog:
> v2->v3:
> * change scu clk into two cells binding
> * add clk pm patches to ease the understand of the changes
> v1->v2:
> * SCU clock changed to one cell clock binding inspired by arm,scpi.txt
> Documentation/devicetree/bindings/arm/arm,scpi.txt
> * Add required power domain property
> * Dropped PATCH 3&4 first, will send the updated version accordingly
> after the binding is finally determined,
>
> Dong Aisheng (11):
> dt-bindings: firmware: imx-scu: new binding to parse clocks from
> device tree
> dt-bindings: clock: imx-lpcg: add support to parse clocks from device
> tree
> clk: imx: scu: add two cells binding support
> clk: imx: scu: bypass cpu power domains
> clk: imx: scu: allow scu clk to take device pointer
> clk: imx: scu: add runtime pm support
> clk: imx: scu: add suspend/resume support
> clk: imx: imx8qxp-lpcg: add parsing clocks from device tree
> clk: imx: lpcg: allow lpcg clk to take device pointer
> clk: imx: clk-imx8qxp-lpcg: add runtime pm support
> clk: imx: lpcg: add suspend/resume support
>
> .../devicetree/bindings/arm/freescale/fsl,scu.txt | 12 +-
> .../devicetree/bindings/clock/imx8qxp-lpcg.txt | 34 +++-
> drivers/clk/imx/clk-imx8qxp-lpcg.c | 103 ++++++++++
> drivers/clk/imx/clk-imx8qxp.c | 9 +-
> drivers/clk/imx/clk-lpcg-scu.c | 41 +++-
> drivers/clk/imx/clk-scu.c | 216 ++++++++++++++++++++-
> drivers/clk/imx/clk-scu.h | 50 ++++-
> include/dt-bindings/firmware/imx/rsrc.h | 17 ++
> 8 files changed, 452 insertions(+), 30 deletions(-)
>
> --
> 2.7.4
>
^ permalink raw reply
* Re: [RFC PATCH 02/11] devfreq: exynos-bus: Extract exynos_bus_profile_init_passive()
From: Chanwoo Choi @ 2019-07-25 12:45 UTC (permalink / raw)
To: Artur Świgoń
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
Linux PM list, dri-devel, Krzysztof Kozlowski, Chanwoo Choi,
MyungJoo Ham, inki.dae, Seung-Woo Kim, georgi.djakov,
Marek Szyprowski
In-Reply-To: <20190723122016.30279-3-a.swigon@partner.samsung.com>
2019년 7월 24일 (수) 오전 8:07, Artur Świgoń <a.swigon@partner.samsung.com>님이 작성:
>
> This patch adds a new static function, exynos_bus_profile_init_passive(),
> extracted from exynos_bus_probe().
>
> Signed-off-by: Artur Świgoń <a.swigon@partner.samsung.com>
> ---
> drivers/devfreq/exynos-bus.c | 70 +++++++++++++++++++++---------------
> 1 file changed, 42 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> index d8f1efaf2d49..cf6f6cbd0f55 100644
> --- a/drivers/devfreq/exynos-bus.c
> +++ b/drivers/devfreq/exynos-bus.c
> @@ -430,13 +430,51 @@ static int exynos_bus_profile_init(struct exynos_bus *bus,
> return ret;
> }
>
> +static int exynos_bus_profile_init_passive(struct exynos_bus *bus,
> + struct devfreq_dev_profile *profile)
> +{
> + struct device *dev = bus->dev;
> + struct devfreq *parent_devfreq;
> + struct devfreq_passive_data *passive_data;
> + int ret = 0;
> +
> + /* Initialize the struct profile and governor data for passive device */
> + profile->target = exynos_bus_passive_target;
> + profile->exit = exynos_bus_passive_exit;
> +
> + /* Get the instance of parent devfreq device */
> + parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0);
> + if (IS_ERR(parent_devfreq)) {
> + ret = -EPROBE_DEFER;
> + goto err;
> + }
> +
> + passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL);
> + if (!passive_data) {
> + ret = -ENOMEM;
> + goto err;
> + }
> + passive_data->parent = parent_devfreq;
> +
> + /* Add devfreq device for exynos bus with passive governor */
> + bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE,
> + passive_data);
> + if (IS_ERR(bus->devfreq)) {
> + dev_err(dev,
> + "failed to add devfreq dev with passive governor\n");
> + ret = PTR_ERR(bus->devfreq);
> + goto err;
> + }
> +
> +err:
> + return ret;
> +}
> +
> static int exynos_bus_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> struct device_node *np = dev->of_node, *node;
> struct devfreq_dev_profile *profile;
> - struct devfreq_passive_data *passive_data;
> - struct devfreq *parent_devfreq;
> struct exynos_bus *bus;
> int ret, max_state;
> unsigned long min_freq, max_freq;
> @@ -481,33 +519,9 @@ static int exynos_bus_probe(struct platform_device *pdev)
>
> goto out;
> passive:
> - /* Initialize the struct profile and governor data for passive device */
> - profile->target = exynos_bus_passive_target;
> - profile->exit = exynos_bus_passive_exit;
> -
> - /* Get the instance of parent devfreq device */
> - parent_devfreq = devfreq_get_devfreq_by_phandle(dev, 0);
> - if (IS_ERR(parent_devfreq)) {
> - ret = -EPROBE_DEFER;
> + ret = exynos_bus_profile_init_passive(bus, profile);
> + if (ret < 0)
> goto err;
> - }
> -
> - passive_data = devm_kzalloc(dev, sizeof(*passive_data), GFP_KERNEL);
> - if (!passive_data) {
> - ret = -ENOMEM;
> - goto err;
> - }
> - passive_data->parent = parent_devfreq;
> -
> - /* Add devfreq device for exynos bus with passive governor */
> - bus->devfreq = devm_devfreq_add_device(dev, profile, DEVFREQ_GOV_PASSIVE,
> - passive_data);
> - if (IS_ERR(bus->devfreq)) {
> - dev_err(dev,
> - "failed to add devfreq dev with passive governor\n");
> - ret = PTR_ERR(bus->devfreq);
> - goto err;
> - }
>
> out:
> max_state = bus->devfreq->profile->max_state;
> --
> 2.17.1
>
Actually, it is not necessary. It has no any benefit.
Please drop it as I commented on patch1.
--
Best Regards,
Chanwoo Choi
^ permalink raw reply
* Re: [RFC PATCH 01/11] devfreq: exynos-bus: Extract exynos_bus_profile_init()
From: Chanwoo Choi @ 2019-07-25 12:43 UTC (permalink / raw)
To: Artur Świgoń
Cc: devicetree, linux-arm-kernel, linux-samsung-soc, linux-kernel,
Linux PM list, dri-devel, Krzysztof Kozlowski, Chanwoo Choi,
MyungJoo Ham, inki.dae, Seung-Woo Kim, georgi.djakov,
Marek Szyprowski
In-Reply-To: <20190723122016.30279-2-a.swigon@partner.samsung.com>
2019년 7월 24일 (수) 오전 8:09, Artur Świgoń <a.swigon@partner.samsung.com>님이 작성:
>
> This patch adds a new static function, exynos_bus_profile_init(), extracted
> from exynos_bus_probe().
>
> Signed-off-by: Artur Świgoń <a.swigon@partner.samsung.com>
> ---
> drivers/devfreq/exynos-bus.c | 106 ++++++++++++++++++++---------------
> 1 file changed, 60 insertions(+), 46 deletions(-)
>
> diff --git a/drivers/devfreq/exynos-bus.c b/drivers/devfreq/exynos-bus.c
> index d9f377912c10..d8f1efaf2d49 100644
> --- a/drivers/devfreq/exynos-bus.c
> +++ b/drivers/devfreq/exynos-bus.c
> @@ -372,12 +372,69 @@ static int exynos_bus_parse_of(struct device_node *np,
> return ret;
> }
>
> +static int exynos_bus_profile_init(struct exynos_bus *bus,
> + struct devfreq_dev_profile *profile)
> +{
> + struct device *dev = bus->dev;
> + struct devfreq_simple_ondemand_data *ondemand_data;
> + int ret;
> +
> + /* Initialize the struct profile and governor data for parent device */
> + profile->polling_ms = 50;
> + profile->target = exynos_bus_target;
> + profile->get_dev_status = exynos_bus_get_dev_status;
> + profile->exit = exynos_bus_exit;
> +
> + ondemand_data = devm_kzalloc(dev, sizeof(*ondemand_data), GFP_KERNEL);
> + if (!ondemand_data) {
> + ret = -ENOMEM;
> + goto err;
> + }
> + ondemand_data->upthreshold = 40;
> + ondemand_data->downdifferential = 5;
> +
> + /* Add devfreq device to monitor and handle the exynos bus */
> + bus->devfreq = devm_devfreq_add_device(dev, profile,
> + DEVFREQ_GOV_SIMPLE_ONDEMAND,
> + ondemand_data);
> + if (IS_ERR(bus->devfreq)) {
> + dev_err(dev, "failed to add devfreq device\n");
> + ret = PTR_ERR(bus->devfreq);
> + goto err;
> + }
> +
> + /* Register opp_notifier to catch the change of OPP */
> + ret = devm_devfreq_register_opp_notifier(dev, bus->devfreq);
> + if (ret < 0) {
> + dev_err(dev, "failed to register opp notifier\n");
> + goto err;
> + }
> +
> + /*
> + * Enable devfreq-event to get raw data which is used to determine
> + * current bus load.
> + */
> + ret = exynos_bus_enable_edev(bus);
> + if (ret < 0) {
> + dev_err(dev, "failed to enable devfreq-event devices\n");
> + goto err;
> + }
> +
> + ret = exynos_bus_set_event(bus);
> + if (ret < 0) {
> + dev_err(dev, "failed to set event to devfreq-event devices\n");
> + goto err;
> + }
> +
> +err:
> + return ret;
> +}
> +
> static int exynos_bus_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> struct device_node *np = dev->of_node, *node;
> struct devfreq_dev_profile *profile;
> - struct devfreq_simple_ondemand_data *ondemand_data;
> struct devfreq_passive_data *passive_data;
> struct devfreq *parent_devfreq;
> struct exynos_bus *bus;
> @@ -418,52 +475,9 @@ static int exynos_bus_probe(struct platform_device *pdev)
> if (ret < 0)
> goto err;
>
> - /* Initialize the struct profile and governor data for parent device */
> - profile->polling_ms = 50;
> - profile->target = exynos_bus_target;
> - profile->get_dev_status = exynos_bus_get_dev_status;
> - profile->exit = exynos_bus_exit;
> -
> - ondemand_data = devm_kzalloc(dev, sizeof(*ondemand_data), GFP_KERNEL);
> - if (!ondemand_data) {
> - ret = -ENOMEM;
> + ret = exynos_bus_profile_init(bus, profile);
> + if (ret < 0)
> goto err;
> - }
> - ondemand_data->upthreshold = 40;
> - ondemand_data->downdifferential = 5;
> -
> - /* Add devfreq device to monitor and handle the exynos bus */
> - bus->devfreq = devm_devfreq_add_device(dev, profile,
> - DEVFREQ_GOV_SIMPLE_ONDEMAND,
> - ondemand_data);
> - if (IS_ERR(bus->devfreq)) {
> - dev_err(dev, "failed to add devfreq device\n");
> - ret = PTR_ERR(bus->devfreq);
> - goto err;
> - }
> -
> - /* Register opp_notifier to catch the change of OPP */
> - ret = devm_devfreq_register_opp_notifier(dev, bus->devfreq);
> - if (ret < 0) {
> - dev_err(dev, "failed to register opp notifier\n");
> - goto err;
> - }
> -
> - /*
> - * Enable devfreq-event to get raw data which is used to determine
> - * current bus load.
> - */
> - ret = exynos_bus_enable_edev(bus);
> - if (ret < 0) {
> - dev_err(dev, "failed to enable devfreq-event devices\n");
> - goto err;
> - }
> -
> - ret = exynos_bus_set_event(bus);
> - if (ret < 0) {
> - dev_err(dev, "failed to set event to devfreq-event devices\n");
> - goto err;
> - }
>
> goto out;
> passive:
> --
> 2.17.1
>
NACK.
It has not any benefit and I don't understand reason why it is necessary.
I don't agree. Please drop it.
--
Best Regards,
Chanwoo Choi
^ permalink raw reply
* Re: [PATCH 0/4] new driver for TI eQEP
From: William Breathitt Gray @ 2019-07-25 12:40 UTC (permalink / raw)
To: David Lechner
Cc: linux-iio, linux-omap, devicetree, Rob Herring, Mark Rutland,
Benoît Cousson, Tony Lindgren, Thierry Reding, linux-kernel,
linux-pwm
In-Reply-To: <20190722154538.5314-1-david@lechnology.com>
On Mon, Jul 22, 2019 at 10:45:34AM -0500, David Lechner wrote:
> This series adds device tree bindings and a new counter driver for the Texas
> Instruments Enhanced Quadrature Encoder Pulse (eQEP).
>
> As mentioned in one of the commit messages, to start with, the driver only
> supports reading the current counter value and setting the min/max values.
> Other features can be added on an as-needed basis.
>
> The only other feature I am interested in is adding is getting time data in
> order to calculate the rotational speed of a motor. However, there probably
> needs to be a higher level discussion of how this can fit into the counter
> subsystem in general first.
I believe exposing some sort of time data has merit. Quadrature counter
devices in particular are commonly used for position tracking of
automation systems, and such systems would benefit from velocity/speed
information. So let's try to introduce that sort of functionality in this
driver if possible.
First, let's discuss your specific use case and requirements, and hopefully we
can generalize it enough to be of use for future drivers. From your description,
it sounds like you're attaching some sort of rotary encoder to the eQEP device.
Is that correct? What sort of time data are you hoping to use; does the eQEP
device provide a clock value, or would you be grabbing a timestamp from the
system?
I'm not sure yet if it would make sense to expose rotational speed directly as
an attribute. If we were to expose just the count value and timestamp since the
last read, that should be enough for a user to compute the delta and derive
speed. I'll think more about this since some devices may simplify that case if
the hardware is able to compute the speed for us.
William Breathitt Gray
^ permalink raw reply
* [PATCH] arm64: dts: qcom: msm8996: Add Venus video codec DT node
From: Stanimir Varbanov @ 2019-07-25 12:39 UTC (permalink / raw)
To: linux-arm-msm, devicetree, linux-kernel
Cc: Andy Gross, David Brown, Rob Herring, Mark Rutland,
Stanimir Varbanov
This adds Qualcomm Venus video codec DT node for the video
codec hardware found in MSM8996 platforms.
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
arch/arm64/boot/dts/qcom/msm8996.dtsi | 68 +++++++++++++++++++++++++++
1 file changed, 68 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 942465d8aeb7..ac6e4e430eec 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -1777,6 +1777,74 @@
"ref_clk";
};
};
+
+ venus_smmu: arm,smmu-venus@d40000 {
+ compatible = "qcom,msm8996-smmu-v2", "qcom,smmu-v2";
+ reg = <0xd40000 0x20000>;
+ #global-interrupts = <1>;
+ interrupts = <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 336 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 337 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 340 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH>;
+ power-domains = <&mmcc MMAGIC_VIDEO_GDSC>;
+ clocks = <&mmcc SMMU_VIDEO_AHB_CLK>,
+ <&mmcc SMMU_VIDEO_AXI_CLK>;
+ clock-names = "iface", "bus";
+ #iommu-cells = <1>;
+ status = "okay";
+ };
+
+ video-codec@c00000 {
+ compatible = "qcom,msm8996-venus";
+ reg = <0x00c00000 0xff000>;
+ interrupts = <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>;
+ power-domains = <&mmcc VENUS_GDSC>;
+ clocks = <&mmcc VIDEO_CORE_CLK>,
+ <&mmcc VIDEO_AHB_CLK>,
+ <&mmcc VIDEO_AXI_CLK>,
+ <&mmcc VIDEO_MAXI_CLK>;
+ clock-names = "core", "iface", "bus", "mbus";
+ iommus = <&venus_smmu 0x00>,
+ <&venus_smmu 0x01>,
+ <&venus_smmu 0x0a>,
+ <&venus_smmu 0x07>,
+ <&venus_smmu 0x0e>,
+ <&venus_smmu 0x0f>,
+ <&venus_smmu 0x08>,
+ <&venus_smmu 0x09>,
+ <&venus_smmu 0x0b>,
+ <&venus_smmu 0x0c>,
+ <&venus_smmu 0x0d>,
+ <&venus_smmu 0x10>,
+ <&venus_smmu 0x11>,
+ <&venus_smmu 0x21>,
+ <&venus_smmu 0x28>,
+ <&venus_smmu 0x29>,
+ <&venus_smmu 0x2b>,
+ <&venus_smmu 0x2c>,
+ <&venus_smmu 0x2d>,
+ <&venus_smmu 0x31>;
+ memory-region = <&venus_region>;
+ status = "okay";
+
+ video-decoder {
+ compatible = "venus-decoder";
+ clocks = <&mmcc VIDEO_SUBCORE0_CLK>;
+ clock-names = "core";
+ power-domains = <&mmcc VENUS_CORE0_GDSC>;
+ };
+
+ video-encoder {
+ compatible = "venus-encoder";
+ clocks = <&mmcc VIDEO_SUBCORE1_CLK>;
+ clock-names = "core";
+ power-domains = <&mmcc VENUS_CORE1_GDSC>;
+ };
+ };
};
sound: sound {
--
2.17.1
^ permalink raw reply related
* [PATCH v2 1/2] dt-bindings: arm: imx: add imx8mq nitrogen support
From: Dafna Hirschfeld @ 2019-07-25 12:14 UTC (permalink / raw)
To: dafna.hirschfeld
Cc: robh+dt, mark.rutland, shawnguo, s.hauer, kernel, devicetree,
linux-kernel, linux-arm-kernel, ezequiel, kernel, Gary Bisson,
Troy Kisky
In-Reply-To: <20190725121452.16607-1-dafna.hirschfeld@collabora.com>
From: Gary Bisson <gary.bisson@boundarydevices.com>
i.MX 8Quad is a quad (4x) Cortex-A53 processor with powerful
graphic and multimedia features.
This patch adds Nitrogen8M board support.
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
[Dafna: porting vendor's code to mainline]
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
Documentation/devicetree/bindings/arm/fsl.yaml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/arm/fsl.yaml b/Documentation/devicetree/bindings/arm/fsl.yaml
index 7294ac36f4c0..728c41ef83bb 100644
--- a/Documentation/devicetree/bindings/arm/fsl.yaml
+++ b/Documentation/devicetree/bindings/arm/fsl.yaml
@@ -227,6 +227,12 @@ properties:
- fsl,imx8qxp-mek # i.MX8QXP MEK Board
- const: fsl,imx8qxp
+ - description: i.MX8MQ based Boards
+ items:
+ - enum:
+ - boundary,imx8mq-nitrogen8m # i.MX8MQ NITROGEN Board
+ - const: fsl,imx8mq
+
- description:
Freescale Vybrid Platform Device Tree Bindings
--
2.20.1
^ permalink raw reply related
* [PATCH v2 2/2] arm64: dts: imx: Add i.mx8mq nitrogen8m basic dts support
From: Dafna Hirschfeld @ 2019-07-25 12:14 UTC (permalink / raw)
To: dafna.hirschfeld
Cc: robh+dt, mark.rutland, shawnguo, s.hauer, kernel, devicetree,
linux-kernel, linux-arm-kernel, ezequiel, kernel, Gary Bisson,
Troy Kisky
From: Gary Bisson <gary.bisson@boundarydevices.com>
Add basic dts support for i.MX8MQ NITROGEN8M.
Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
[Dafna: porting vendor's code to mainline]
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
---
arch/arm64/boot/dts/freescale/Makefile | 1 +
.../boot/dts/freescale/imx8mq-nitrogen8m.dts | 411 ++++++++++++++++++
2 files changed, 412 insertions(+)
create mode 100644 arch/arm64/boot/dts/freescale/imx8mq-nitrogen8m.dts
diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile
index c043aca66572..54a5c18c5c30 100644
--- a/arch/arm64/boot/dts/freescale/Makefile
+++ b/arch/arm64/boot/dts/freescale/Makefile
@@ -26,3 +26,4 @@ dtb-$(CONFIG_ARCH_MXC) += imx8mq-librem5-devkit.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8mq-zii-ultra-rmb3.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8mq-zii-ultra-zest.dtb
dtb-$(CONFIG_ARCH_MXC) += imx8qxp-mek.dtb
+dtb-$(CONFIG_ARCH_MXC) += imx8mq-nitrogen8m.dtb
diff --git a/arch/arm64/boot/dts/freescale/imx8mq-nitrogen8m.dts b/arch/arm64/boot/dts/freescale/imx8mq-nitrogen8m.dts
new file mode 100644
index 000000000000..cfd4915d2916
--- /dev/null
+++ b/arch/arm64/boot/dts/freescale/imx8mq-nitrogen8m.dts
@@ -0,0 +1,411 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2018 Boundary Devices
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/input/input.h>
+#include "imx8mq.dtsi"
+
+/ {
+ model = "Boundary Devices i.MX8MQ Nitrogen8M";
+ compatible = "boundary,imx8mq-nitrogen8m", "fsl,imx8mq";
+
+ chosen {
+ stdout-path = "serial0:115200n8";
+ };
+
+ memory@40000000 {
+ device_type = "memory";
+ reg = <0x00000000 0x40000000 0 0x80000000>;
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_gpio_keys>;
+
+ power {
+ label = "Power Button";
+ gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_POWER>;
+ gpio-key,wakeup;
+ };
+ };
+
+ reg_vref_0v9: regulator-vref-0v9 {
+ compatible = "regulator-fixed";
+ regulator-name = "vref-0v9";
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <900000>;
+ };
+
+ reg_vref_1v8: regulator-vref-1v8 {
+ compatible = "regulator-fixed";
+ regulator-name = "vref-1v8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };
+
+ reg_vref_2v5: regulator-vref-2v5 {
+ compatible = "regulator-fixed";
+ regulator-name = "vref-2v5";
+ regulator-min-microvolt = <2500000>;
+ regulator-max-microvolt = <2500000>;
+ };
+
+ reg_vref_3v3: regulator-vref-3v3 {
+ compatible = "regulator-fixed";
+ regulator-name = "vref-3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ reg_vref_5v: regulator-vref-5v {
+ compatible = "regulator-fixed";
+ regulator-name = "vref-5v";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ };
+};
+
+&a53_opp_table {
+ opp-1500000000 {
+ opp-hz = /bits/ 64 <1500000000>;
+ opp-microvolt = <1000000>;
+ };
+
+ opp-1000000000 {
+ opp-hz = /bits/ 64 <1000000000>;
+ opp-microvolt = <900000>;
+ };
+};
+
+&iomuxc {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_hog>;
+ pinctrl_fec1: fec1grp {
+ fsl,pins = <
+ MX8MQ_IOMUXC_ENET_MDC_ENET1_MDC 0x3
+ MX8MQ_IOMUXC_ENET_MDIO_ENET1_MDIO 0x23
+ MX8MQ_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL 0x1f
+ MX8MQ_IOMUXC_ENET_TXC_ENET1_RGMII_TXC 0x1f
+ MX8MQ_IOMUXC_ENET_TD0_ENET1_RGMII_TD0 0x1f
+ MX8MQ_IOMUXC_ENET_TD1_ENET1_RGMII_TD1 0x1f
+ MX8MQ_IOMUXC_ENET_TD2_ENET1_RGMII_TD2 0x1f
+ MX8MQ_IOMUXC_ENET_TD3_ENET1_RGMII_TD3 0x1f
+ MX8MQ_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL 0x91
+ MX8MQ_IOMUXC_ENET_RXC_ENET1_RGMII_RXC 0x91
+ MX8MQ_IOMUXC_ENET_RD0_ENET1_RGMII_RD0 0x91
+ MX8MQ_IOMUXC_ENET_RD1_ENET1_RGMII_RD1 0x91
+ MX8MQ_IOMUXC_ENET_RD2_ENET1_RGMII_RD2 0x91
+ MX8MQ_IOMUXC_ENET_RD3_ENET1_RGMII_RD3 0x91
+ MX8MQ_IOMUXC_GPIO1_IO09_GPIO1_IO9 0x19
+ MX8MQ_IOMUXC_GPIO1_IO11_GPIO1_IO11 0x59
+ >;
+ };
+
+ pinctrl_gpio_keys: gpio-keysgrp {
+ fsl,pins = <
+ MX8MQ_IOMUXC_GPIO1_IO07_GPIO1_IO7 0x19
+ >;
+ };
+
+ pinctrl_hog: hoggrp {
+ fsl,pins = <
+ /* J17 connector, odd */
+ MX8MQ_IOMUXC_SAI1_RXFS_GPIO4_IO0 0x19 /* Pin 19 */
+ MX8MQ_IOMUXC_SAI1_RXC_GPIO4_IO1 0x19 /* Pin 21 */
+ MX8MQ_IOMUXC_SAI1_RXD1_GPIO4_IO3 0x19 /* Pin 23 */
+ MX8MQ_IOMUXC_SAI1_RXD2_GPIO4_IO4 0x19 /* Pin 25 */
+ MX8MQ_IOMUXC_SAI1_RXD3_GPIO4_IO5 0x19 /* Pin 27 */
+ MX8MQ_IOMUXC_SAI1_RXD4_GPIO4_IO6 0x19 /* Pin 29 */
+ MX8MQ_IOMUXC_SAI1_RXD5_GPIO4_IO7 0x19 /* Pin 31 */
+ MX8MQ_IOMUXC_SAI1_RXD6_GPIO4_IO8 0x19 /* Pin 33 */
+ MX8MQ_IOMUXC_SAI1_RXD7_GPIO4_IO9 0x19 /* Pin 35 */
+ MX8MQ_IOMUXC_SAI1_TXD1_GPIO4_IO13 0x19 /* Pin 39 */
+ MX8MQ_IOMUXC_SAI1_TXD2_GPIO4_IO14 0x19 /* Pin 41 */
+ MX8MQ_IOMUXC_SAI1_TXD3_GPIO4_IO15 0x19 /* Pin 43 */
+ MX8MQ_IOMUXC_SAI1_TXD4_GPIO4_IO16 0x19 /* Pin 45 */
+ MX8MQ_IOMUXC_SAI1_TXD5_GPIO4_IO17 0x19 /* Pin 47 */
+ MX8MQ_IOMUXC_SAI1_TXD6_GPIO4_IO18 0x19 /* Pin 49 */
+ MX8MQ_IOMUXC_SAI1_TXD7_GPIO4_IO19 0x19 /* Pin 51 */
+
+ /* J17 connector, even */
+ MX8MQ_IOMUXC_SAI3_RXFS_GPIO4_IO28 0x19 /* Pin 44 */
+ MX8MQ_IOMUXC_SAI3_RXC_GPIO4_IO29 0x19 /* Pin 48 */
+ MX8MQ_IOMUXC_GPIO1_IO10_GPIO1_IO10 0x19 /* Pin 50 */
+ MX8MQ_IOMUXC_GPIO1_IO03_GPIO1_IO3 0x19 /* Pin 54 */
+ MX8MQ_IOMUXC_GPIO1_IO05_GPIO1_IO5 0x19 /* Pin 56 */
+
+ /* J18 connector, odd */
+ MX8MQ_IOMUXC_NAND_CE3_B_GPIO3_IO4 0x19 /* Pin 41 */
+ MX8MQ_IOMUXC_NAND_CLE_GPIO3_IO5 0x19 /* Pin 43 */
+ MX8MQ_IOMUXC_NAND_READY_B_GPIO3_IO16 0x19 /* Pin 45 */
+ MX8MQ_IOMUXC_NAND_DATA05_GPIO3_IO11 0x19 /* Pin 47 */
+ MX8MQ_IOMUXC_NAND_WP_B_GPIO3_IO18 0x19 /* Pin 49 */
+ MX8MQ_IOMUXC_NAND_DQS_GPIO3_IO14 0x19 /* Pin 53 */
+
+ /* J18 connector, even */
+ MX8MQ_IOMUXC_NAND_ALE_GPIO3_IO0 0x19 /* Pin 32 */
+ MX8MQ_IOMUXC_NAND_CE0_B_GPIO3_IO1 0x19 /* Pin 36 */
+ MX8MQ_IOMUXC_NAND_DATA00_GPIO3_IO6 0x19 /* Pin 38 */
+ MX8MQ_IOMUXC_NAND_DATA01_GPIO3_IO7 0x19 /* Pin 40 */
+ MX8MQ_IOMUXC_NAND_DATA02_GPIO3_IO8 0x19 /* Pin 42 */
+ MX8MQ_IOMUXC_NAND_DATA03_GPIO3_IO9 0x19 /* Pin 44 */
+ MX8MQ_IOMUXC_NAND_DATA04_GPIO3_IO10 0x19 /* Pin 46 */
+
+ /* J13 Pin 2, WL_WAKE */
+ MX8MQ_IOMUXC_SAI5_RXD2_GPIO3_IO23 0xd6
+ /* J13 Pin 4, WL_IRQ, not needed for Silex */
+ MX8MQ_IOMUXC_SAI5_RXD0_GPIO3_IO21 0xd6
+ /* J13 pin 9, unused */
+ MX8MQ_IOMUXC_SD2_CD_B_GPIO2_IO12 0x19
+ /* J13 Pin 41, BT_CLK_REQ */
+ MX8MQ_IOMUXC_SAI5_RXD1_GPIO3_IO22 0xd6
+ /* J13 Pin 42, BT_HOST_WAKE */
+ MX8MQ_IOMUXC_SAI5_MCLK_GPIO3_IO25 0xd6
+
+ /* Clock for both CSI1 and CSI2 */
+ MX8MQ_IOMUXC_GPIO1_IO15_CCMSRCGPCMIX_CLKO2 0x07
+ /* test points */
+ MX8MQ_IOMUXC_GPIO1_IO04_GPIO1_IO4 0xc1 /* TP87 */
+ >;
+ };
+
+ pinctrl_i2c1: i2c1grp {
+ fsl,pins = <
+ MX8MQ_IOMUXC_I2C1_SCL_I2C1_SCL 0x4000007f
+ MX8MQ_IOMUXC_I2C1_SDA_I2C1_SDA 0x4000007f
+ >;
+ };
+
+ pinctrl_i2c1_pca9546: i2c1-pca9546grp {
+ fsl,pins = <
+ MX8MQ_IOMUXC_GPIO1_IO08_GPIO1_IO8 0x49
+ >;
+ };
+
+ pinctrl_i2c1d_rv4162: i2c1d-rv4162grp {
+ fsl,pins = <
+ MX8MQ_IOMUXC_GPIO1_IO06_GPIO1_IO6 0x49
+ >;
+ };
+
+ pinctrl_reg_arm_dram: reg-arm-dram {
+ fsl,pins = <
+ MX8MQ_IOMUXC_SAI5_RXD3_GPIO3_IO24 0x16
+ >;
+ };
+
+ pinctrl_reg_dram_1p1v: reg-dram-1p1v {
+ fsl,pins = <
+ MX8MQ_IOMUXC_SD1_STROBE_GPIO2_IO11 0x16
+ >;
+ };
+
+ pinctrl_reg_soc_gpu_vpu: reg-soc-gpu-vpu {
+ fsl,pins = <
+ MX8MQ_IOMUXC_SD2_WP_GPIO2_IO20 0x16
+ >;
+ };
+
+ pinctrl_uart1: uart1grp {
+ fsl,pins = <
+ MX8MQ_IOMUXC_UART1_RXD_UART1_DCE_RX 0x45
+ MX8MQ_IOMUXC_UART1_TXD_UART1_DCE_TX 0x45
+ >;
+ };
+
+ pinctrl_uart2: uart2grp {
+ fsl,pins = <
+ MX8MQ_IOMUXC_UART2_RXD_UART2_DCE_RX 0x45
+ MX8MQ_IOMUXC_UART2_TXD_UART2_DCE_TX 0x45
+ >;
+ };
+
+ pinctrl_usdhc1: usdhc1grp {
+ fsl,pins = <
+ MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x83
+ MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0xc3
+ MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0xc3
+ MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0xc3
+ MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0xc3
+ MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3 0xc3
+ MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4 0xc3
+ MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5 0xc3
+ MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6 0xc3
+ MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7 0xc3
+ MX8MQ_IOMUXC_SD1_RESET_B_GPIO2_IO10 0x41
+ >;
+ };
+
+ pinctrl_usdhc1_100mhz: usdhc1grp100mhz {
+ fsl,pins = <
+ MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x8d
+ MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0xcd
+ MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0xcd
+ MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0xcd
+ MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0xcd
+ MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3 0xcd
+ MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4 0xcd
+ MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5 0xcd
+ MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6 0xcd
+ MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7 0xcd
+ >;
+ };
+
+ pinctrl_usdhc1_200mhz: usdhc1grp200mhz {
+ fsl,pins = <
+ MX8MQ_IOMUXC_SD1_CLK_USDHC1_CLK 0x9f
+ MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0xdf
+ MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0xdf
+ MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0xdf
+ MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0xdf
+ MX8MQ_IOMUXC_SD1_DATA3_USDHC1_DATA3 0xdf
+ MX8MQ_IOMUXC_SD1_DATA4_USDHC1_DATA4 0xdf
+ MX8MQ_IOMUXC_SD1_DATA5_USDHC1_DATA5 0xdf
+ MX8MQ_IOMUXC_SD1_DATA6_USDHC1_DATA6 0xdf
+ MX8MQ_IOMUXC_SD1_DATA7_USDHC1_DATA7 0xdf
+ >;
+ };
+
+ pinctrl_wdog: wdoggrp {
+ fsl,pins = <
+ MX8MQ_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B 0xc6
+ >;
+ };
+};
+
+&fec1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_fec1>;
+ phy-mode = "rgmii-id";
+ phy-handle = <ðphy0>;
+ fsl,magic-packet;
+ status = "okay";
+
+ mdio {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ethphy0: ethernet-phy@4 {
+ compatible = "ethernet-phy-ieee802.3-c22";
+ reg = <4>;
+ interrupts-extended = <&gpio1 11 IRQ_TYPE_LEVEL_LOW>;
+ };
+ };
+};
+
+&i2c1 {
+ clock-frequency = <400000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c1>;
+ status = "okay";
+
+ i2cmux@70 {
+ compatible = "pca9546";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c1_pca9546>;
+ reg = <0x70>;
+ reset-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ i2c1a: i2c1@0 {
+ reg = <0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg_arm_dram: fan53555@60 {
+ compatible = "fcs,fan53555";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_reg_arm_dram>;
+ reg = <0x60>;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <1000000>;
+ regulator-always-on;
+ vsel-gpios = <&gpio3 24 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
+ i2c1b: i2c1@1 {
+ reg = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg_dram_1p1v: fan53555@60 {
+ compatible = "fcs,fan53555";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_reg_dram_1p1v>;
+ reg = <0x60>;
+ regulator-min-microvolt = <1100000>;
+ regulator-max-microvolt = <1100000>;
+ regulator-always-on;
+ vsel-gpios = <&gpio2 11 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
+ i2c1c: i2c1@2 {
+ reg = <2>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg_soc_gpu_vpu: fan53555@60 {
+ compatible = "fcs,fan53555";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_reg_soc_gpu_vpu>;
+ reg = <0x60>;
+ regulator-min-microvolt = <900000>;
+ regulator-max-microvolt = <1000000>;
+ regulator-always-on;
+ vsel-gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
+ i2c1d: i2c1@3 {
+ reg = <3>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ rtc@68 {
+ compatible = "microcrystal,rv4162";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c1d_rv4162>;
+ reg = <0x68>;
+ interrupts-extended = <&gpio1 6 IRQ_TYPE_LEVEL_LOW>;
+ wakeup-source;
+ };
+ };
+ };
+};
+
+&uart1 { /* console */
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart1>;
+ assigned-clocks = <&clk IMX8MQ_CLK_UART1>;
+ assigned-clock-parents = <&clk IMX8MQ_CLK_25M>;
+ status = "okay";
+};
+
+&uart2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart2>;
+ assigned-clocks = <&clk IMX8MQ_CLK_UART2>;
+ assigned-clock-parents = <&clk IMX8MQ_CLK_25M>;
+ status = "okay";
+};
+
+&usdhc1 {
+ bus-width = <8>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_usdhc1>;
+ non-removable;
+ vqmmc-1-8-v;
+ vmmc-supply = <®_vref_1v8>;
+ status = "okay";
+};
+
+&wdog1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_wdog>;
+ fsl,ext-reset-output;
+ status = "okay";
+};
--
2.20.1
^ permalink raw reply related
* [PATCH 2/2] ARM: dts: stm32: change pinctrl definition for joystick pins on stm32mp157c-ev1
From: Amelie Delaunay @ 2019-07-25 11:36 UTC (permalink / raw)
To: Maxime Coquelin, Alexandre Torgue, Rob Herring, Mark Rutland
Cc: linux-stm32, linux-arm-kernel, devicetree, linux-kernel,
Amelie Delaunay
In-Reply-To: <1564054607-2028-1-git-send-email-amelie.delaunay@st.com>
From: Alexandre Torgue <alexandre.torgue@st.com>
Pins used for joystick are all configured as input. "Push-pull" is not
a valid setting for an input.
Signed-off-by: Alexandre Torgue <alexandre.torgue@st.com>
Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com>
---
arch/arm/boot/dts/stm32mp157c-ev1.dts | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/boot/dts/stm32mp157c-ev1.dts b/arch/arm/boot/dts/stm32mp157c-ev1.dts
index e4b04dd..7d15f05 100644
--- a/arch/arm/boot/dts/stm32mp157c-ev1.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ev1.dts
@@ -220,7 +220,6 @@
joystick_pins: joystick {
pins = "gpio0", "gpio1", "gpio2", "gpio3", "gpio4";
- drive-push-pull;
bias-pull-down;
};
};
--
2.7.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox