-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Moved all layouts into their own files #2582
base: main
Are you sure you want to change the base?
refactor: Moved all layouts into their own files #2582
Conversation
…s, and adjusted docs page accordingly.
Maybe I missed the aforementioned conversation -- I don't think pulling out layouts that simply import and modify the common layouts are necessary, is it? It adds a lot of noise for a few lines of config. |
Yeah, that's the part I wasn't certain on myself. I think it would make sense to leave that kind of thing in, but then that raises the question of how to handle situations like the Kyria correctly. I like the way you defined it originally, but I'm not sure how best to extend that to a convention. |
My thinking would be that if a |
The presence of a
Both of those options seemed needlessly complicated. I don't really have strong feelings on what to do with matrix transforms. We could either
I also don't really have strong feelings on whether -layouts.dtsi is needed if you're just pulling in common layouts. I think I'm leaning towards no. |
Nick pointed me to the previous discussion on Discord offline, where there seemed to be a consensus on always splitting off to a dtsi, similar to pinctrl. I don't have strong opinions against that, so I'd be fine with the current state of the PR. I am also OK with keeping the separate file even if it is just using a common layout, for consistency. Re: matrix transforms, 2. might be the most practical right now, however 3. might be the most consistent. |
Any thoughts on how to handle the kyria case? It's failing compilation because despite being disabled the 5 col node still exists and references an undefined 5 col matrix transform in the rev3 case. I could delete-node it. Could also rearrange a bunch of things to avoid needing to resort to that, but I'm not sure what the best way to rearrange would be. |
Maybe you could mirror the structure of the common layouts with one physical layout + position map child per file, and then have each of the rev2 and rev3 files include just the relevant ones? |
b6fd56f
to
317f83b
Compare
I've ended up going with this, at least for the time being. I think I'd be in favor of assigning matrix transform names to the common layouts, and then importing those directly. The layouts file would then appear if there was a need to change the name used for the matrix transform for the common layouts, something I would imagine mostly would only occur if there are other non-common layouts being defined as well. I think that approach would be just as consistent, but much less noisy. I did try the |
317f83b
to
322b138
Compare
transform = <&default_transform>; | ||
kscan = <&kscan0>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am really stuck on this aspect of the refactor. In particular, this makes this import still highly coupled with the importing environment, and makes it harder to refactor without surprising side effects. It also makes it so that future refactors that might identify "Hey, this layout is actually useful, and should be shared!" requires extracting this coupling later anyways.
It also leads to a "two ways to do things" situation, between "using shared layouts" and "using local layouts" that would potentially lead to more confusion. IMHO, I favor Joel's first proposed option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd like consistency between the shared and the local approaches on this point, which way around it goes I'm not too fussy about. That option is a bit ugly, but justifiable imo. What would your thoughts be on applying option 2 to all the shared layouts?
I do think that option 1 should be used for binding kscans to physical transforms when different kscans are used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO matrix transforms are just as tightly coupled to the "host" that is going to inject them, and shouldn't be set either.
As discussed on Discord. Also adjusted the docs for consistency.
I am not entirely sold on the matrix transform assignments happening in the separate file as well, thoughts?