meta-mion-delta/recipes-kernel/arm64-delta-tn48m-cpld/files/arm64-delta-tn48m-cpld.c
/* Read and Write CPLD register data codes */
Read and Write CPLD register data codes
Read and Write CPLD register data codes
static ssize_t show_reg_offset(struct device *dev,
                               struct device_attribute *devattr, char *buf)
{
    struct i2c_client *client = to_i2c_client(dev);
    struct tn48m_cpld_data *data = i2c_get_clientdata(client);
    u8 reg_offset;
    mutex_lock(&data->update_lock);
    reg_offset = data->reg_offset;
    mutex_unlock(&data->update_lock);
    return sprintf(buf, "0x%x\n", reg_offset);
}
static ssize_t show_reg_offset ( struct device * dev , struct device_attribute * devattr , char * buf ) { struct i2c_client * client = to_i2c_client ( dev ) ; struct tn48m_cpld_data * data = i2c_get_clientdata ( client ) ; u8 reg_offset ; mutex_lock ( & data -> update_lock ) ; reg_offset = data -> reg_offset ; mutex_unlock ( & data -> update_lock ) ; return sprintf ( buf , " \n " , reg_offset ) ; }
Read and Write CPLD register data codes
Read and Write CPLD register data codes