Re: Reg: New MFD Driver for my PCIe Device

Lee Jones
2021-11-08T11:04:41Z

On Mon, 08 Nov 2021, Kumaravel.Thiagarajan@microchip.com wrote:

> Dear Lee Jones,
>
> I am Kumaravel Thiagarajan from Microchip, India and I am new to Linux Kernel development.
>
> I am currently working on linux kernel driver for one of our PCIe based devices whose BAR 0 maps interface registers for a gpio controller, an OTP memory device controller and an EEPROM device controller into the host processor's memory space.
>
> Based on earlier inputs from Linus Walleij, I have developed this as a multi-function device driver - First MFD driver (drivers/mfd) gets loaded for the PCIe device and then it spawns two child devices for OTP/EEPROM and GPIO separately.

You may wish to speak with Greg about your architectural decisions.

He usually dislikes the creation of platform devices from PCI ones.

> I have four new files in my local linux source tree as below for community submission.
>
> 1. mchp_pci1xxxx_gp.h under include/linux/mfd
> 2. mchp_pci1xxxx_gp.c under drivers/mfd
> 3. mchp_pci1xxxx_gpio.c under drivers/gpio
> 4. mchp_pci1xxxx_ otpe2p.c under drivers/mtd/devices
>
> I have a doubt with the location of the fourth file for the following reasons.
>
> 1. I have visualized and architected the OTP and EEPROM memories of my device as individual block devices so that I am able to use the linux dd command to program these memories from a binary file directly or edit them directly using applications like hexedit, both of which I am able to do.
> 2. These only look more like block devices to me and not MTD devices (only writes and reads are possible and not erase).
>
> Can I move the fourth file directly under drivers/block or should there be a new sub directory under drivers/block or leave it as such under drivers/mtd/devices ?

Those are questions for the MTD/Block Maintainers.

I've Cc'ed all of the relevant parties for you.

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog