-static ssize_t
-show_beep_enable(struct device *dev, struct device_attribute *attr, char *buf)
-{
- struct i2c_client *client = to_i2c_client(dev);
- struct w83795_data *data = i2c_get_clientdata(client);
- return sprintf(buf, "%u\n", data->beep_enable);
-}
-
-static ssize_t
-store_beep_enable(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct i2c_client *client = to_i2c_client(dev);
- struct w83795_data *data = i2c_get_clientdata(client);
- unsigned long val;
- u8 tmp;
-
- if (strict_strtoul(buf, 10, &val) < 0)
- return -EINVAL;
- if (val != 0 && val != 1)
- return -EINVAL;
-
- mutex_lock(&data->update_lock);
- data->beep_enable = val;
- tmp = w83795_read(client, W83795_REG_BEEP(5));
- tmp &= 0x7f;
- tmp |= val << 7;
- w83795_write(client, W83795_REG_BEEP(5), tmp);
- mutex_unlock(&data->update_lock);
-
- return count;
-}
-