18c2ecf20Sopenharmony_ci============= 28c2ecf20Sopenharmony_ciPCMCIA Driver 38c2ecf20Sopenharmony_ci============= 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_cisysfs 68c2ecf20Sopenharmony_ci----- 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ciNew PCMCIA IDs may be added to a device driver pcmcia_device_id table at 98c2ecf20Sopenharmony_ciruntime as shown below:: 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci echo "match_flags manf_id card_id func_id function device_no \ 128c2ecf20Sopenharmony_ci prod_id_hash[0] prod_id_hash[1] prod_id_hash[2] prod_id_hash[3]" > \ 138c2ecf20Sopenharmony_ci /sys/bus/pcmcia/drivers/{driver}/new_id 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciAll fields are passed in as hexadecimal values (no leading 0x). 168c2ecf20Sopenharmony_ciThe meaning is described in the PCMCIA specification, the match_flags is 178c2ecf20Sopenharmony_cia bitwise or-ed combination from PCMCIA_DEV_ID_MATCH_* constants 188c2ecf20Sopenharmony_cidefined in include/linux/mod_devicetable.h. 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ciOnce added, the driver probe routine will be invoked for any unclaimed 218c2ecf20Sopenharmony_ciPCMCIA device listed in its (newly updated) pcmcia_device_id list. 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ciA common use-case is to add a new device according to the manufacturer ID 248c2ecf20Sopenharmony_ciand the card ID (form the manf_id and card_id file in the device tree). 258c2ecf20Sopenharmony_ciFor this, just use:: 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci echo "0x3 manf_id card_id 0 0 0 0 0 0 0" > \ 288c2ecf20Sopenharmony_ci /sys/bus/pcmcia/drivers/{driver}/new_id 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ciafter loading the driver. 31