Sorry for the late reply. Thanks, so AFAIU, the guy who asked this question in 2015, was going to use LS1021a (not a typo LS1012a) as I2C slave device as well, and he shared a part of the slave driver code.
Is there any open source code for the full version of i2c slave driver for LS1012a? I might find it a bit hard to write my own one, or I should refer to some related links that would be helpful. Thanks