This has been created on the purpose of education.
This is not the complete literature and code sample about creating sysfs files.
But, I believe this will help someone to learn how to control sysfs files.
$ make
$ sudo insmod simple_sysfs_mod.ko
https://www.kernel.org/doc/ols/2005/ols2005v1-pages-321-334.pdf