Skip to content

Commit 28b513b

Browse files
committed
Merge branch 'dt/linus' into dt/next
Pull-in kunit kconfig fix
2 parents 919e0dd + 332857f commit 28b513b

File tree

10 files changed

+107
-8
lines changed

10 files changed

+107
-8
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/display/elgin,jg10309-01.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Elgin JG10309-01 SPI-controlled display
8+
9+
maintainers:
10+
- Fabio Estevam <[email protected]>
11+
12+
description: |
13+
The Elgin JG10309-01 SPI-controlled display is used on the RV1108-Elgin-r1
14+
board and is a custom display.
15+
16+
allOf:
17+
- $ref: /schemas/spi/spi-peripheral-props.yaml#
18+
19+
properties:
20+
compatible:
21+
const: elgin,jg10309-01
22+
23+
reg:
24+
maxItems: 1
25+
26+
spi-max-frequency:
27+
maximum: 24000000
28+
29+
spi-cpha: true
30+
31+
spi-cpol: true
32+
33+
required:
34+
- compatible
35+
- reg
36+
- spi-cpha
37+
- spi-cpol
38+
39+
additionalProperties: false
40+
41+
examples:
42+
- |
43+
spi {
44+
#address-cells = <1>;
45+
#size-cells = <0>;
46+
47+
display@0 {
48+
compatible = "elgin,jg10309-01";
49+
reg = <0>;
50+
spi-max-frequency = <24000000>;
51+
spi-cpha;
52+
spi-cpol;
53+
};
54+
};

Documentation/devicetree/bindings/interrupt-controller/fsl,ls-extirq.yaml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ allOf:
8282
enum:
8383
- fsl,ls1043a-extirq
8484
- fsl,ls1046a-extirq
85-
- fsl,ls1088a-extirq
86-
- fsl,ls2080a-extirq
87-
- fsl,lx2160a-extirq
8885
then:
8986
properties:
9087
interrupt-map:
@@ -95,6 +92,29 @@ allOf:
9592
- const: 0xf
9693
- const: 0
9794

95+
- if:
96+
properties:
97+
compatible:
98+
contains:
99+
enum:
100+
- fsl,ls1088a-extirq
101+
- fsl,ls2080a-extirq
102+
- fsl,lx2160a-extirq
103+
# The driver(drivers/irqchip/irq-ls-extirq.c) have not use standard DT
104+
# function to parser interrupt-map. So it doesn't consider '#address-size'
105+
# in parent interrupt controller, such as GIC.
106+
#
107+
# When dt-binding verify interrupt-map, item data matrix is spitted at
108+
# incorrect position. Remove interrupt-map restriction because it always
109+
# wrong.
110+
111+
then:
112+
properties:
113+
interrupt-map-mask:
114+
items:
115+
- const: 0xf
116+
- const: 0
117+
98118
additionalProperties: false
99119

100120
examples:

Documentation/devicetree/bindings/misc/fsl,qoriq-mc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ properties:
113113
114114
msi-parent:
115115
deprecated: true
116-
$ref: /schemas/types.yaml#/definitions/phandle
116+
maxItems: 1
117117
description:
118118
Describes the MSI controller node handling message
119119
interrupts for the MC. When there is no translation

Documentation/devicetree/bindings/trivial-devices.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ properties:
101101
- domintech,dmard09
102102
# DMARD10: 3-axis Accelerometer
103103
- domintech,dmard10
104-
# Elgin SPI-controlled LCD
105-
- elgin,jg10309-01
106104
# MMA7660FC: 3-Axis Orientation/Motion Detection Sensor
107105
- fsl,mma7660
108106
# MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer

drivers/of/.kunitconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
CONFIG_KUNIT=y
22
CONFIG_OF=y
33
CONFIG_OF_KUNIT_TEST=y
4+
CONFIG_OF_OVERLAY=y
45
CONFIG_OF_OVERLAY_KUNIT_TEST=y

drivers/of/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ config OF_OVERLAY_KUNIT_TEST
111111
tristate "Device Tree overlay KUnit tests" if !KUNIT_ALL_TESTS
112112
depends on KUNIT
113113
default KUNIT_ALL_TESTS
114-
select OF_OVERLAY
114+
select DTC
115115
help
116116
This option builds KUnit unit tests for the device tree overlay code.
117117

drivers/of/of_kunit_helpers.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@
1010
#include <kunit/test.h>
1111
#include <kunit/resource.h>
1212

13+
#include "of_private.h"
14+
15+
/**
16+
* of_root_kunit_skip() - Skip test if the root node isn't populated
17+
* @test: test to skip if the root node isn't populated
18+
*/
19+
void of_root_kunit_skip(struct kunit *test)
20+
{
21+
if (IS_ENABLED(CONFIG_ARM64) && IS_ENABLED(CONFIG_ACPI) && !of_root)
22+
kunit_skip(test, "arm64+acpi doesn't populate a root node");
23+
}
24+
EXPORT_SYMBOL_GPL(of_root_kunit_skip);
25+
1326
#if defined(CONFIG_OF_OVERLAY) && defined(CONFIG_OF_EARLY_FLATTREE)
1427

1528
static void of_overlay_fdt_apply_kunit_exit(void *ovcs_id)
@@ -36,6 +49,8 @@ int of_overlay_fdt_apply_kunit(struct kunit *test, void *overlay_fdt,
3649
int ret;
3750
int *copy_id;
3851

52+
of_root_kunit_skip(test);
53+
3954
copy_id = kunit_kmalloc(test, sizeof(*copy_id), GFP_KERNEL);
4055
if (!copy_id)
4156
return -ENOMEM;

drivers/of/of_private.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ extern raw_spinlock_t devtree_lock;
4343
extern struct list_head aliases_lookup;
4444
extern struct kset *of_kset;
4545

46+
struct kunit;
47+
extern void of_root_kunit_skip(struct kunit *test);
48+
4649
#if defined(CONFIG_OF_DYNAMIC)
4750
extern int of_property_notify(int action, struct device_node *np,
4851
struct property *prop, struct property *old_prop);

drivers/of/of_test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#include <kunit/test.h>
99

10+
#include "of_private.h"
11+
1012
/*
1113
* Test that the root node "/" can be found by path.
1214
*/
@@ -36,6 +38,7 @@ static struct kunit_case of_dtb_test_cases[] = {
3638

3739
static int of_dtb_test_init(struct kunit *test)
3840
{
41+
of_root_kunit_skip(test);
3942
if (!IS_ENABLED(CONFIG_OF_EARLY_FLATTREE))
4043
kunit_skip(test, "requires CONFIG_OF_EARLY_FLATTREE");
4144

drivers/of/overlay_test.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <kunit/of.h>
1212
#include <kunit/test.h>
1313

14+
#include "of_private.h"
15+
1416
static const char * const kunit_node_name = "kunit-test";
1517
static const char * const kunit_compatible = "test,empty";
1618

@@ -62,6 +64,9 @@ static void of_overlay_apply_kunit_cleanup(struct kunit *test)
6264
struct device *dev;
6365
struct device_node *np;
6466

67+
of_root_kunit_skip(test);
68+
if (!IS_ENABLED(CONFIG_OF_OVERLAY))
69+
kunit_skip(test, "requires CONFIG_OF_OVERLAY to apply overlay");
6570
if (!IS_ENABLED(CONFIG_OF_EARLY_FLATTREE))
6671
kunit_skip(test, "requires CONFIG_OF_EARLY_FLATTREE for root node");
6772

@@ -73,7 +78,7 @@ static void of_overlay_apply_kunit_cleanup(struct kunit *test)
7378

7479
np = of_find_node_by_name(NULL, kunit_node_name);
7580
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, np);
76-
of_node_put_kunit(test, np);
81+
of_node_put_kunit(&fake, np);
7782

7883
pdev = of_find_device_by_node(np);
7984
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, pdev);

0 commit comments

Comments
 (0)