On Fri Mar 14, 2025 at 9:02 AM CET, Andy Shevchenko wrote: > Thu, Mar 13, 2025 at 05:43:00PM +0100, Mathieu Dubois-Briand kirjoitti: > > On Mon Feb 17, 2025 at 9:08 PM CET, Andy Shevchenko wrote: > > > On Mon, Feb 17, 2025 at 12:20:13PM +0100, Mathieu Dubois-Briand wrote: > > ... > > > > But what I have read above sounds to me like the following: > > > > > > 1) the PORT0-PORT7 should be just a regular pin control with the respective > > > function being provided (see pinctrl-cy8c95x0.c as an example); > > > > Ok, so I created a pin control driver for the PORT pins. This will > > effectively help to prevent concurrent use of pins in place of the > > request()/free() callbacks. > > > > My only concern is: as there is no real pin muxing on the chip, my > > .set_mux callabck in pinmux_ops structure is not doing anything. It > > looks like I'm not the only one > > (drivers/pinctrl/pinctrl-microchip-sgpio.c does the same thing), but I > > hope this is OK. > > Hmm... This is strange. The PWM/GPIO block has 3 functions (GPIO/PWM/rotary), > How comes you have no switch between them? > > As far as I read in the datasheet this is controlled by register 0x40 > (and seems implicitly by other registers when it's in PWM mode). > Yes, on pins 6 and 7, we do switch between rotary encoder and other modes by writing in the register at 0x40, but that's all. My point was more about all other modes. There is no difference between PWM and GPIO, at least in output mode: GPIO level is just a PWM with duty cycle either to 0% or 100%. -- Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com