> the software will probably do trivial things and be very simple, that is what you are selling is the hardware itself, and that is already covered by patents.
How do you figure? In the case of something like an insulin pump or a pacemaker, sure, but once we start interfacing with nerves, especially once we start trying to communicate with them properly instead of just blunt-force stimulating a bunch of them, these devices are essentially software.
That's not to say I necessarily disagree with your conclusion. For devices that depend on patented hardware, opening up the software still works because the hardware effectively acts as a copy protection dongle.
For other devices, or for cases where the software contains critical 'secret sauce', what we need might be something more like the automotive right-to-repair legislation. Even if the device is closed source, the manufacturer must provide appropriate documentation and tooling to allow third parties maintain the device for its intended service life (which, of course, is hopefully a bit longer for a brain implant than for a hatchback!)