Skip to content

Commit ad1b832

Browse files
committed
Merge tag 'devicetree-fixes-for-6.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux
Pull devicetree fixes from Rob Herring: - Add bindings for QCom QCS8300 clocks, QCom SAR2130P qfprom, and powertip,{st7272|hx8238a} displays - Fix compatible for TI am62a7 dss - Add a kunit test for __of_address_resource_bounds() * tag 'devicetree-fixes-for-6.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: display: Add powertip,{st7272|hx8238a} as DT Schema description dt-bindings: nvmem: qcom,qfprom: Add SAR2130P compatible dt-bindings: display: ti: Fix compatible for am62a7 dss of: address: Add kunit test for __of_address_resource_bounds() dt-bindings: clock: qcom: Add QCS8300 video clock controller dt-bindings: clock: qcom: Add CAMCC clocks for QCS8300 dt-bindings: clock: qcom: Add GPU clocks for QCS8300
2 parents ad73b9a + 038e33f commit ad1b832

File tree

12 files changed

+228
-4
lines changed

12 files changed

+228
-4
lines changed

Documentation/devicetree/bindings/clock/qcom,gpucc.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ title: Qualcomm Graphics Clock & Reset Controller
88

99
maintainers:
1010
- Taniya Das <quic_tdas@quicinc.com>
11+
- Imran Shaik <quic_imrashai@quicinc.com>
1112

1213
description: |
1314
Qualcomm graphics clock control module provides the clocks, resets and power
@@ -23,10 +24,12 @@ description: |
2324
include/dt-bindings/clock/qcom,gpucc-sm8150.h
2425
include/dt-bindings/clock/qcom,gpucc-sm8250.h
2526
include/dt-bindings/clock/qcom,gpucc-sm8350.h
27+
include/dt-bindings/clock/qcom,qcs8300-gpucc.h
2628
2729
properties:
2830
compatible:
2931
enum:
32+
- qcom,qcs8300-gpucc
3033
- qcom,sdm845-gpucc
3134
- qcom,sa8775p-gpucc
3235
- qcom,sc7180-gpucc

Documentation/devicetree/bindings/clock/qcom,sa8775p-camcc.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@ title: Qualcomm Camera Clock & Reset Controller on SA8775P
88

99
maintainers:
1010
- Taniya Das <quic_tdas@quicinc.com>
11+
- Imran Shaik <quic_imrashai@quicinc.com>
1112

1213
description: |
1314
Qualcomm camera clock control module provides the clocks, resets and power
1415
domains on SA8775p.
1516
16-
See also: include/dt-bindings/clock/qcom,sa8775p-camcc.h
17+
See also:
18+
include/dt-bindings/clock/qcom,qcs8300-camcc.h
19+
include/dt-bindings/clock/qcom,sa8775p-camcc.h
1720
1821
properties:
1922
compatible:
2023
enum:
24+
- qcom,qcs8300-camcc
2125
- qcom,sa8775p-camcc
2226

2327
clocks:

Documentation/devicetree/bindings/clock/qcom,sa8775p-videocc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ description: |
1818
properties:
1919
compatible:
2020
enum:
21+
- qcom,qcs8300-videocc
2122
- qcom,sa8775p-videocc
2223

2324
clocks:
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/display/panel/powertip,hx8238a.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Powertip Electronic Technology Co. 320 x 240 LCD panel
8+
9+
maintainers:
10+
- Lukasz Majewski <lukma@denx.de>
11+
12+
allOf:
13+
- $ref: panel-dpi.yaml#
14+
15+
properties:
16+
compatible:
17+
items:
18+
- const: powertip,hx8238a
19+
- {} # panel-dpi, but not listed here to avoid false select
20+
21+
height-mm: true
22+
panel-timing: true
23+
port: true
24+
power-supply: true
25+
width-mm: true
26+
27+
additionalProperties: false
28+
29+
...
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/display/panel/powertip,st7272.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Powertip Electronic Technology Co. 320 x 240 LCD panel
8+
9+
maintainers:
10+
- Lukasz Majewski <lukma@denx.de>
11+
12+
allOf:
13+
- $ref: panel-dpi.yaml#
14+
15+
properties:
16+
compatible:
17+
items:
18+
- const: powertip,st7272
19+
- {} # panel-dpi, but not listed here to avoid false select
20+
21+
height-mm: true
22+
panel-timing: true
23+
port: true
24+
power-supply: true
25+
width-mm: true
26+
27+
additionalProperties: false
28+
29+
...

Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ properties:
2323
compatible:
2424
enum:
2525
- ti,am625-dss
26-
- ti,am62a7,dss
26+
- ti,am62a7-dss
2727
- ti,am65x-dss
2828

2929
reg:

Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ properties:
3636
- qcom,qcs404-qfprom
3737
- qcom,qcs615-qfprom
3838
- qcom,qcs8300-qfprom
39+
- qcom,sar2130p-qfprom
3940
- qcom,sc7180-qfprom
4041
- qcom,sc7280-qfprom
4142
- qcom,sc8280xp-qfprom

drivers/of/address.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <linux/string.h>
1717
#include <linux/dma-direct.h> /* for bus_dma_region */
1818

19+
#include <kunit/visibility.h>
20+
1921
/* Uncomment me to enable of_dump_addr() debugging output */
2022
// #define DEBUG
2123

@@ -183,7 +185,7 @@ static u64 of_bus_pci_map(__be32 *addr, const __be32 *range, int na, int ns,
183185

184186
#endif /* CONFIG_PCI */
185187

186-
static int __of_address_resource_bounds(struct resource *r, u64 start, u64 size)
188+
VISIBLE_IF_KUNIT int __of_address_resource_bounds(struct resource *r, u64 start, u64 size)
187189
{
188190
if (overflows_type(start, r->start))
189191
return -EOVERFLOW;
@@ -197,6 +199,7 @@ static int __of_address_resource_bounds(struct resource *r, u64 start, u64 size)
197199

198200
return 0;
199201
}
202+
EXPORT_SYMBOL_IF_KUNIT(__of_address_resource_bounds);
200203

201204
/*
202205
* of_pci_range_to_resource - Create a resource from an of_pci_range

drivers/of/of_private.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,8 @@ static void __maybe_unused of_dump_addr(const char *s, const __be32 *addr, int n
208208
static void __maybe_unused of_dump_addr(const char *s, const __be32 *addr, int na) { }
209209
#endif
210210

211+
#if IS_ENABLED(CONFIG_KUNIT)
212+
int __of_address_resource_bounds(struct resource *r, u64 start, u64 size);
213+
#endif
214+
211215
#endif /* _LINUX_OF_PRIVATE_H */

drivers/of/of_test.c

Lines changed: 118 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/*
33
* KUnit tests for OF APIs
44
*/
5+
#include <linux/ioport.h>
56
#include <linux/module.h>
67
#include <linux/of.h>
78

@@ -54,8 +55,124 @@ static struct kunit_suite of_dtb_suite = {
5455
.init = of_dtb_test_init,
5556
};
5657

58+
struct of_address_resource_bounds_case {
59+
u64 start;
60+
u64 size;
61+
int ret;
62+
63+
u64 res_start;
64+
u64 res_end;
65+
};
66+
67+
static void of_address_resource_bounds_case_desc(const struct of_address_resource_bounds_case *p,
68+
char *name)
69+
{
70+
snprintf(name, KUNIT_PARAM_DESC_SIZE, "start=0x%016llx,size=0x%016llx", p->start, p->size);
71+
}
72+
73+
static const struct of_address_resource_bounds_case of_address_resource_bounds_cases[] = {
74+
{
75+
.start = 0,
76+
.size = 0,
77+
.ret = 0,
78+
.res_start = 0,
79+
.res_end = -1,
80+
},
81+
{
82+
.start = 0,
83+
.size = 0x1000,
84+
.ret = 0,
85+
.res_start = 0,
86+
.res_end = 0xfff,
87+
},
88+
{
89+
.start = 0x1000,
90+
.size = 0,
91+
.ret = 0,
92+
.res_start = 0x1000,
93+
.res_end = 0xfff,
94+
},
95+
{
96+
.start = 0x1000,
97+
.size = 0x1000,
98+
.ret = 0,
99+
.res_start = 0x1000,
100+
.res_end = 0x1fff,
101+
},
102+
{
103+
.start = 1,
104+
.size = RESOURCE_SIZE_MAX,
105+
.ret = 0,
106+
.res_start = 1,
107+
.res_end = RESOURCE_SIZE_MAX,
108+
},
109+
{
110+
.start = RESOURCE_SIZE_MAX,
111+
.size = 1,
112+
.ret = 0,
113+
.res_start = RESOURCE_SIZE_MAX,
114+
.res_end = RESOURCE_SIZE_MAX,
115+
},
116+
{
117+
.start = 2,
118+
.size = RESOURCE_SIZE_MAX,
119+
.ret = -EOVERFLOW,
120+
},
121+
{
122+
.start = RESOURCE_SIZE_MAX,
123+
.size = 2,
124+
.ret = -EOVERFLOW,
125+
},
126+
{
127+
.start = ULL(0x100000000),
128+
.size = 1,
129+
.ret = sizeof(resource_size_t) > sizeof(u32) ? 0 : -EOVERFLOW,
130+
.res_start = ULL(0x100000000),
131+
.res_end = ULL(0x100000000),
132+
},
133+
{
134+
.start = 0x1000,
135+
.size = 0xffffffff,
136+
.ret = sizeof(resource_size_t) > sizeof(u32) ? 0 : -EOVERFLOW,
137+
.res_start = 0x1000,
138+
.res_end = ULL(0x100000ffe),
139+
},
140+
};
141+
142+
KUNIT_ARRAY_PARAM(of_address_resource_bounds,
143+
of_address_resource_bounds_cases, of_address_resource_bounds_case_desc);
144+
145+
static void of_address_resource_bounds(struct kunit *test)
146+
{
147+
const struct of_address_resource_bounds_case *param = test->param_value;
148+
struct resource r; /* Intentionally uninitialized */
149+
int ret;
150+
151+
if (!IS_ENABLED(CONFIG_OF_ADDRESS))
152+
kunit_skip(test, "CONFIG_OF_ADDRESS not enabled\n");
153+
154+
ret = __of_address_resource_bounds(&r, param->start, param->size);
155+
KUNIT_EXPECT_EQ(test, param->ret, ret);
156+
if (ret == 0) {
157+
KUNIT_EXPECT_EQ(test, (resource_size_t)param->res_start, r.start);
158+
KUNIT_EXPECT_EQ(test, (resource_size_t)param->res_end, r.end);
159+
KUNIT_EXPECT_EQ(test, param->size, resource_size(&r));
160+
}
161+
}
162+
163+
static struct kunit_case of_address_test_cases[] = {
164+
KUNIT_CASE_PARAM(of_address_resource_bounds, of_address_resource_bounds_gen_params),
165+
{}
166+
};
167+
168+
static struct kunit_suite of_address_suite = {
169+
.name = "of_address",
170+
.test_cases = of_address_test_cases,
171+
};
172+
57173
kunit_test_suites(
58-
&of_dtb_suite,
174+
&of_dtb_suite, &of_address_suite,
59175
);
60176
MODULE_DESCRIPTION("KUnit tests for OF APIs");
177+
MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING");
61178
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)