[PATCH 2/2] ARM: dts: qcom: Add support for Motorola Moto G (2013)

2024-03-24 Thread Stanislav Jakubek
Add a device tree for the Motorola Moto G (2013) smartphone based
on the Qualcomm MSM8226 SoC.

Initially supported features:
  - Buttons (Volume Down/Up, Power)
  - eMMC
  - Hall Effect Sensor
  - SimpleFB display
  - TMP108 temperature sensor
  - Vibrator

Signed-off-by: Stanislav Jakubek 
---
 arch/arm/boot/dts/qcom/Makefile   |   1 +
 .../boot/dts/qcom/msm8226-motorola-falcon.dts | 355 ++
 2 files changed, 356 insertions(+)
 create mode 100644 arch/arm/boot/dts/qcom/msm8226-motorola-falcon.dts

diff --git a/arch/arm/boot/dts/qcom/Makefile b/arch/arm/boot/dts/qcom/Makefile
index 6478a39b3be5..3eacbf5c0785 100644
--- a/arch/arm/boot/dts/qcom/Makefile
+++ b/arch/arm/boot/dts/qcom/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_ARCH_QCOM) += \
+   msm8226-motorola-falcon.dtb \
qcom-apq8016-sbc.dtb \
qcom-apq8026-asus-sparrow.dtb \
qcom-apq8026-huawei-sturgeon.dtb \
diff --git a/arch/arm/boot/dts/qcom/msm8226-motorola-falcon.dts 
b/arch/arm/boot/dts/qcom/msm8226-motorola-falcon.dts
new file mode 100644
index ..acf0e3fee481
--- /dev/null
+++ b/arch/arm/boot/dts/qcom/msm8226-motorola-falcon.dts
@@ -0,0 +1,355 @@
+// SPDX-License-Identifier: BSD-3-Clause
+
+/dts-v1/;
+
+#include "qcom-msm8226.dtsi"
+#include "pm8226.dtsi"
+
+/delete-node/ _region;
+
+/ {
+   model = "Motorola Moto G (2013)";
+   compatible = "motorola,falcon", "qcom,msm8226";
+   chassis-type = "handset";
+
+   aliases {
+   mmc0 = _1;
+   };
+
+   chosen {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+
+   framebuffer@320 {
+   compatible = "simple-framebuffer";
+   reg = <0x0320 0x80>;
+   width = <720>;
+   height = <1280>;
+   stride = <(720 * 3)>;
+   format = "r8g8b8";
+   vsp-supply = <_lcd_pos>;
+   vsn-supply = <_lcd_neg>;
+   vddio-supply = <_disp_vreg>;
+   };
+   };
+
+   gpio-keys {
+   compatible = "gpio-keys";
+
+   event-hall-sensor {
+   label = "Hall Effect Sensor";
+   gpios = < 51 GPIO_ACTIVE_LOW>;
+   linux,input-type = ;
+   linux,code = ;
+   linux,can-disable;
+   };
+
+   key-volume-up {
+   label = "Volume Up";
+   gpios = < 106 GPIO_ACTIVE_LOW>;
+   linux,code = ;
+   debounce-interval = <15>;
+   };
+   };
+
+   vddio_disp_vreg: regulator-vddio-disp {
+   compatible = "regulator-fixed";
+   regulator-name = "vddio_disp";
+   gpio = < 34 GPIO_ACTIVE_HIGH>;
+   vin-supply = <_l8>;
+   startup-delay-us = <300>;
+   enable-active-high;
+   regulator-boot-on;
+   };
+
+   reserved-memory {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+
+   framebuffer@320 {
+   reg = <0x0320 0x80>;
+   no-map;
+   };
+
+   hob-ram@f50 {
+   reg = <0x0f50 0x4>,
+ <0x0f54 0x2000>;
+   no-map;
+   };
+
+   smem_region: smem@fa0 {
+   reg = <0x0fa0 0x10>;
+   no-map;
+   };
+
+   /* Actually <0x0fa0 0x50>, but first 10 is smem */
+   reserved@fb0 {
+   reg = <0x0fb0 0x40>;
+   no-map;
+   };
+   };
+};
+
+_i2c3 {
+   status = "okay";
+
+   regulator@3e {
+   compatible = "ti,tps65132";
+   reg = <0x3e>;
+   pinctrl-0 = <_lcd_default>;
+   pinctrl-names = "default";
+
+   reg_lcd_pos: outp {
+   regulator-name = "outp";
+   regulator-min-microvolt = <400>;
+   regulator-max-microvolt = <600>;
+   regulator-active-discharge = <1>;
+   regulator-boot-on;
+   enable-gpios = < 31 GPIO_ACTIVE_HIGH>;
+   };
+
+   reg_lcd_neg: outn {
+   regulator-name = "outn";
+   regulator-min-microvolt = <400>;
+   regulator-max-microvolt = <600>;
+   regulator-active-discharge = <1>;
+   regulator-boot-on;
+   enable-gpios = < 33 GPIO_ACTIVE_HIGH>;
+   };
+   };

[PATCH 1/2] dt-bindings: arm: qcom: Add Motorola Moto G (2013)

2024-03-24 Thread Stanislav Jakubek
Document the Motorola Moto G (2013), which is a smartphone based
on the Qualcomm MSM8226 SoC.

Signed-off-by: Stanislav Jakubek 
---
 Documentation/devicetree/bindings/arm/qcom.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/qcom.yaml 
b/Documentation/devicetree/bindings/arm/qcom.yaml
index 66beaac60e1d..d2910982ae86 100644
--- a/Documentation/devicetree/bindings/arm/qcom.yaml
+++ b/Documentation/devicetree/bindings/arm/qcom.yaml
@@ -137,6 +137,7 @@ properties:
   - microsoft,dempsey
   - microsoft,makepeace
   - microsoft,moneypenny
+  - motorola,falcon
   - samsung,s3ve3g
   - const: qcom,msm8226
 
-- 
2.34.1




Re: [v2] ice: Fix freeing uninitialized pointers

2024-03-24 Thread Markus Elfring
>>> Automatically cleaned up pointers need to be initialized before exiting
>>> their scope.  In this case, they need to be initialized to NULL before
>>> any return statement.
>>
>> * May we expect that compilers should report that affected variables
>>   were only declared here instead of appropriately defined
>>   (despite of attempts for scope-based resource management)?
>>
>
> We disabled GCC's check for uninitialized variables a long time ago
> because it had too many false positives.

Can further case distinctions (and compilation parameters) become more helpful
according to the discussed handling of the attribute “__cleanup” (or “__free”)?


>> * Did you extend detection support in the source code analysis tool “Smatch”
>>   for a questionable implementation detail?
>
> Yes.  Smatch detects this as an uninitialized variable.

Does the corresponding warning indicate requirements for scope-based resource 
management?

Regards,
Markus



Re: [PATCH v2 net] ice: Fix freeing uninitialized pointers

2024-03-24 Thread Dan Carpenter
On Sat, Mar 23, 2024 at 05:56:29PM +0100, Markus Elfring wrote:
> > Automatically cleaned up pointers need to be initialized before exiting
> > their scope.  In this case, they need to be initialized to NULL before
> > any return statement.
> 
> * May we expect that compilers should report that affected variables
>   were only declared here instead of appropriately defined
>   (despite of attempts for scope-based resource management)?
> 

We disabled GCC's check for uninitialized variables a long time ago
because it had too many false positives.

> * Did you extend detection support in the source code analysis tool “Smatch”
>   for a questionable implementation detail?

Yes.  Smatch detects this as an uninitialized variable.

regards,
dan carpenter