iio: Rename _st_ functions to loose the bit that meant the staging version.
These were originally introduced when the plan was to have parallel IIO cores in and out of staging with a slow move between them. Now we have reached the point where the whole core has moved, they need clearing up! Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
6a17a0768f
commit
314be14bb8
3 changed files with 38 additions and 41 deletions
|
@ -92,8 +92,7 @@ error_ret:
|
||||||
EXPORT_SYMBOL_GPL(iio_map_array_unregister);
|
EXPORT_SYMBOL_GPL(iio_map_array_unregister);
|
||||||
|
|
||||||
static const struct iio_chan_spec
|
static const struct iio_chan_spec
|
||||||
*iio_chan_spec_from_name(const struct iio_dev *indio_dev,
|
*iio_chan_spec_from_name(const struct iio_dev *indio_dev, const char *name)
|
||||||
const char *name)
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const struct iio_chan_spec *chan = NULL;
|
const struct iio_chan_spec *chan = NULL;
|
||||||
|
@ -108,8 +107,7 @@ static const struct iio_chan_spec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct iio_channel *iio_st_channel_get(const char *name,
|
struct iio_channel *iio_channel_get(const char *name, const char *channel_name)
|
||||||
const char *channel_name)
|
|
||||||
{
|
{
|
||||||
struct iio_map_internal *c_i = NULL, *c = NULL;
|
struct iio_map_internal *c_i = NULL, *c = NULL;
|
||||||
struct iio_channel *channel;
|
struct iio_channel *channel;
|
||||||
|
@ -145,16 +143,16 @@ struct iio_channel *iio_st_channel_get(const char *name,
|
||||||
|
|
||||||
return channel;
|
return channel;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(iio_st_channel_get);
|
EXPORT_SYMBOL_GPL(iio_channel_get);
|
||||||
|
|
||||||
void iio_st_channel_release(struct iio_channel *channel)
|
void iio_channel_release(struct iio_channel *channel)
|
||||||
{
|
{
|
||||||
iio_device_put(channel->indio_dev);
|
iio_device_put(channel->indio_dev);
|
||||||
kfree(channel);
|
kfree(channel);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(iio_st_channel_release);
|
EXPORT_SYMBOL_GPL(iio_channel_release);
|
||||||
|
|
||||||
struct iio_channel *iio_st_channel_get_all(const char *name)
|
struct iio_channel *iio_channel_get_all(const char *name)
|
||||||
{
|
{
|
||||||
struct iio_channel *chans;
|
struct iio_channel *chans;
|
||||||
struct iio_map_internal *c = NULL;
|
struct iio_map_internal *c = NULL;
|
||||||
|
@ -217,9 +215,9 @@ error_ret:
|
||||||
|
|
||||||
return ERR_PTR(ret);
|
return ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(iio_st_channel_get_all);
|
EXPORT_SYMBOL_GPL(iio_channel_get_all);
|
||||||
|
|
||||||
void iio_st_channel_release_all(struct iio_channel *channels)
|
void iio_channel_release_all(struct iio_channel *channels)
|
||||||
{
|
{
|
||||||
struct iio_channel *chan = &channels[0];
|
struct iio_channel *chan = &channels[0];
|
||||||
|
|
||||||
|
@ -229,9 +227,9 @@ void iio_st_channel_release_all(struct iio_channel *channels)
|
||||||
}
|
}
|
||||||
kfree(channels);
|
kfree(channels);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(iio_st_channel_release_all);
|
EXPORT_SYMBOL_GPL(iio_channel_release_all);
|
||||||
|
|
||||||
int iio_st_read_channel_raw(struct iio_channel *chan, int *val)
|
int iio_read_channel_raw(struct iio_channel *chan, int *val)
|
||||||
{
|
{
|
||||||
int val2, ret;
|
int val2, ret;
|
||||||
|
|
||||||
|
@ -248,9 +246,9 @@ err_unlock:
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(iio_st_read_channel_raw);
|
EXPORT_SYMBOL_GPL(iio_read_channel_raw);
|
||||||
|
|
||||||
int iio_st_read_channel_scale(struct iio_channel *chan, int *val, int *val2)
|
int iio_read_channel_scale(struct iio_channel *chan, int *val, int *val2)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
@ -269,10 +267,9 @@ err_unlock:
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(iio_st_read_channel_scale);
|
EXPORT_SYMBOL_GPL(iio_read_channel_scale);
|
||||||
|
|
||||||
int iio_st_get_channel_type(struct iio_channel *chan,
|
int iio_get_channel_type(struct iio_channel *chan, enum iio_chan_type *type)
|
||||||
enum iio_chan_type *type)
|
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
/* Need to verify underlying driver has not gone away */
|
/* Need to verify underlying driver has not gone away */
|
||||||
|
@ -289,4 +286,4 @@ err_unlock:
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(iio_st_get_channel_type);
|
EXPORT_SYMBOL_GPL(iio_get_channel_type);
|
||||||
|
|
|
@ -51,12 +51,12 @@ static ssize_t iio_hwmon_read_val(struct device *dev,
|
||||||
* No locking between this pair, so theoretically possible
|
* No locking between this pair, so theoretically possible
|
||||||
* the scale has changed.
|
* the scale has changed.
|
||||||
*/
|
*/
|
||||||
ret = iio_st_read_channel_raw(&state->channels[sattr->index],
|
ret = iio_read_channel_raw(&state->channels[sattr->index],
|
||||||
&val);
|
&val);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = iio_st_read_channel_scale(&state->channels[sattr->index],
|
ret = iio_read_channel_scale(&state->channels[sattr->index],
|
||||||
&scaleint, &scalepart);
|
&scaleint, &scalepart);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -106,7 +106,7 @@ static int __devinit iio_hwmon_probe(struct platform_device *pdev)
|
||||||
goto error_ret;
|
goto error_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
st->channels = iio_st_channel_get_all(dev_name(&pdev->dev));
|
st->channels = iio_channel_get_all(dev_name(&pdev->dev));
|
||||||
if (IS_ERR(st->channels)) {
|
if (IS_ERR(st->channels)) {
|
||||||
ret = PTR_ERR(st->channels);
|
ret = PTR_ERR(st->channels);
|
||||||
goto error_free_state;
|
goto error_free_state;
|
||||||
|
@ -130,7 +130,7 @@ static int __devinit iio_hwmon_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
sysfs_attr_init(&a->dev_attr.attr);
|
sysfs_attr_init(&a->dev_attr.attr);
|
||||||
ret = iio_st_get_channel_type(&st->channels[i], &type);
|
ret = iio_get_channel_type(&st->channels[i], &type);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
kfree(a);
|
kfree(a);
|
||||||
goto error_free_attrs;
|
goto error_free_attrs;
|
||||||
|
@ -186,7 +186,7 @@ error_free_attrs:
|
||||||
iio_hwmon_free_attrs(st);
|
iio_hwmon_free_attrs(st);
|
||||||
kfree(st->attrs);
|
kfree(st->attrs);
|
||||||
error_release_channels:
|
error_release_channels:
|
||||||
iio_st_channel_release_all(st->channels);
|
iio_channel_release_all(st->channels);
|
||||||
error_free_state:
|
error_free_state:
|
||||||
kfree(st);
|
kfree(st);
|
||||||
error_ret:
|
error_ret:
|
||||||
|
@ -201,7 +201,7 @@ static int __devexit iio_hwmon_remove(struct platform_device *pdev)
|
||||||
sysfs_remove_group(&pdev->dev.kobj, &st->attr_group);
|
sysfs_remove_group(&pdev->dev.kobj, &st->attr_group);
|
||||||
iio_hwmon_free_attrs(st);
|
iio_hwmon_free_attrs(st);
|
||||||
kfree(st->attrs);
|
kfree(st->attrs);
|
||||||
iio_st_channel_release_all(st->channels);
|
iio_channel_release_all(st->channels);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,17 +33,17 @@ struct iio_channel {
|
||||||
* side. This typically describes the channels use within
|
* side. This typically describes the channels use within
|
||||||
* the consumer. E.g. 'battery_voltage'
|
* the consumer. E.g. 'battery_voltage'
|
||||||
*/
|
*/
|
||||||
struct iio_channel *iio_st_channel_get(const char *name,
|
struct iio_channel *iio_channel_get(const char *name,
|
||||||
const char *consumer_channel);
|
const char *consumer_channel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iio_st_channel_release() - release channels obtained via iio_st_channel_get
|
* iio_channel_release() - release channels obtained via iio_channel_get
|
||||||
* @chan: The channel to be released.
|
* @chan: The channel to be released.
|
||||||
*/
|
*/
|
||||||
void iio_st_channel_release(struct iio_channel *chan);
|
void iio_channel_release(struct iio_channel *chan);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iio_st_channel_get_all() - get all channels associated with a client
|
* iio_channel_get_all() - get all channels associated with a client
|
||||||
* @name: name of consumer device.
|
* @name: name of consumer device.
|
||||||
*
|
*
|
||||||
* Returns an array of iio_channel structures terminated with one with
|
* Returns an array of iio_channel structures terminated with one with
|
||||||
|
@ -51,37 +51,37 @@ void iio_st_channel_release(struct iio_channel *chan);
|
||||||
* This function is used by fairly generic consumers to get all the
|
* This function is used by fairly generic consumers to get all the
|
||||||
* channels registered as having this consumer.
|
* channels registered as having this consumer.
|
||||||
*/
|
*/
|
||||||
struct iio_channel *iio_st_channel_get_all(const char *name);
|
struct iio_channel *iio_channel_get_all(const char *name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iio_st_channel_release_all() - reverse iio_st_get_all
|
* iio_channel_release_all() - reverse iio_channel_get_all
|
||||||
* @chan: Array of channels to be released.
|
* @chan: Array of channels to be released.
|
||||||
*/
|
*/
|
||||||
void iio_st_channel_release_all(struct iio_channel *chan);
|
void iio_channel_release_all(struct iio_channel *chan);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iio_st_read_channel_raw() - read from a given channel
|
* iio_read_channel_raw() - read from a given channel
|
||||||
* @channel: The channel being queried.
|
* @channel: The channel being queried.
|
||||||
* @val: Value read back.
|
* @val: Value read back.
|
||||||
*
|
*
|
||||||
* Note raw reads from iio channels are in adc counts and hence
|
* Note raw reads from iio channels are in adc counts and hence
|
||||||
* scale will need to be applied if standard units required.
|
* scale will need to be applied if standard units required.
|
||||||
*/
|
*/
|
||||||
int iio_st_read_channel_raw(struct iio_channel *chan,
|
int iio_read_channel_raw(struct iio_channel *chan,
|
||||||
int *val);
|
int *val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iio_st_get_channel_type() - get the type of a channel
|
* iio_get_channel_type() - get the type of a channel
|
||||||
* @channel: The channel being queried.
|
* @channel: The channel being queried.
|
||||||
* @type: The type of the channel.
|
* @type: The type of the channel.
|
||||||
*
|
*
|
||||||
* returns the enum iio_chan_type of the channel
|
* returns the enum iio_chan_type of the channel
|
||||||
*/
|
*/
|
||||||
int iio_st_get_channel_type(struct iio_channel *channel,
|
int iio_get_channel_type(struct iio_channel *channel,
|
||||||
enum iio_chan_type *type);
|
enum iio_chan_type *type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iio_st_read_channel_scale() - read the scale value for a channel
|
* iio_read_channel_scale() - read the scale value for a channel
|
||||||
* @channel: The channel being queried.
|
* @channel: The channel being queried.
|
||||||
* @val: First part of value read back.
|
* @val: First part of value read back.
|
||||||
* @val2: Second part of value read back.
|
* @val2: Second part of value read back.
|
||||||
|
@ -90,7 +90,7 @@ int iio_st_get_channel_type(struct iio_channel *channel,
|
||||||
* as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val
|
* as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val
|
||||||
* + val2/1e6
|
* + val2/1e6
|
||||||
*/
|
*/
|
||||||
int iio_st_read_channel_scale(struct iio_channel *chan, int *val,
|
int iio_read_channel_scale(struct iio_channel *chan, int *val,
|
||||||
int *val2);
|
int *val2);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue