Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c294ce97 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 5b284b6c on remote branch

Change-Id: I52c6ef880642ab139eb83625ebd5659c7e61dfda
parents 332bfea2 5b284b6c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2016, 2019-2021 The Linux Foundation. All rights reserved. */
/* Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. */

#include <linux/clk.h>
#include <linux/export.h>
@@ -11,6 +12,10 @@
#include <linux/bitops.h>
#include <linux/mfd/syscon.h>
#include <linux/msm-bus.h>
#include <trace/events/power.h>

#define CREATE_TRACE_POINTS
#include "trace.h"

#include "clk-regmap.h"
#include "clk-debug.h"
@@ -271,6 +276,7 @@ static int clk_debug_measure_get(void *data, u64 *val)
	enable_debug_clks(measure);
	*val = clk_debug_mux_measure_rate(measure);

	trace_clk_measure(clk_hw_get_name(hw), *val);
	/* recursively calculate actual freq */
	*val *= get_mux_divs(measure);
	disable_debug_clks(measure);
+51 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only
 *
 * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM clk_qcom

#if !defined(_TRACE_CLOCK_QCOM_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_CLOCK_QCOM

#include <linux/tracepoint.h>

DECLARE_EVENT_CLASS(clk_measure_support,

	TP_PROTO(const char *name, unsigned long rate),

	TP_ARGS(name, rate),

	TP_STRUCT__entry(
		__string(name, name)
		__field(unsigned long, rate)
	),

	TP_fast_assign(
		__assign_str(name, name);
		__entry->rate = rate;
	),

	TP_printk("%s rate: %lu",
		__get_str(name), (unsigned long)__entry->rate)
);

DEFINE_EVENT(clk_measure_support, clk_measure,

	TP_PROTO(const char *name, unsigned long rate),

	TP_ARGS(name, rate)
);

#endif /* _TRACE_CLOCK_QCOM */

/* This part must be outside protection */

#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .

#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace

#include <trace/define_trace.h>
+4 −13
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@
struct dentry *my_direc;
const char delim[] = ",";
int columns = NAME_COLUMN |
	BOUND_COLUMN | STATE_COLUMN | ERROR_CODES;
BOUND_COLUMN | ERROR_CODES;

void populate_bound_rows(
	struct synx_table_row *row,
@@ -29,14 +29,13 @@ void populate_bound_rows(
	char *end)
{
	int j;
	int state = SYNX_STATE_INVALID;


	for (j = 0; j < row->num_bound_synxs;
		j++) {
		cur += scnprintf(cur, end - cur,
			"\n\tID: %d State: %s",
			row->bound_synxs[j].external_data->synx_obj,
			state);
			"\n\tID: %d ",
			row->bound_synxs[j].external_data->synx_obj);
	}
}
static ssize_t synx_table_read(struct file *file,
@@ -51,7 +50,6 @@ static ssize_t synx_table_read(struct file *file,
	char *dbuf, *cur, *end;

	int i = 0;
	int state = SYNX_STATE_INVALID;
	ssize_t len = 0;
	s32 index;

@@ -64,8 +62,6 @@ static ssize_t synx_table_read(struct file *file,
		cur += scnprintf(cur, end - cur, "|   Name   |");
	if (columns & BOUND_COLUMN)
		cur += scnprintf(cur, end - cur, "|   Bound   |");
	if (columns & STATE_COLUMN)
		cur += scnprintf(cur, end - cur, "|  Status  |");
	cur += scnprintf(cur, end - cur, "\n");
	for (i = 1; i < SYNX_MAX_OBJS; i++) {
		row = &dev->synx_table[i];
@@ -84,11 +80,6 @@ static ssize_t synx_table_read(struct file *file,
		if (columns & BOUND_COLUMN)
			cur += scnprintf(cur, end - cur,
				"|%11d|", row->num_bound_synxs);
		if (columns & STATE_COLUMN) {
			state = synx_status(row);
			cur += scnprintf(cur, end - cur,
				"|%10d|", state);
		}
		if ((columns & BOUND_COLUMN) &&
			(row->num_bound_synxs > 0)) {
			cur += scnprintf(
+1 −2
Original line number Diff line number Diff line
@@ -252,9 +252,8 @@ int synx_deinit_object(struct synx_table_row *row)
		}
	}

	mutex_lock(&synx_dev->row_locks[index]);

	memset(row, 0, sizeof(*row));
	mutex_unlock(&synx_dev->row_locks[index]);
	clear_bit(index, synx_dev->bitmap);

	pr_debug("destroying synx obj at %d successful\n", index);
+31 −3
Original line number Diff line number Diff line
@@ -226,6 +226,10 @@ static ssize_t jsrequest_show(struct device *dev,
	} else {
		size = scnprintf(buf, PAGE_SIZE, "no need to ack\n");
	}
	pinctrl_select_state(
		gspi_client->pinctrl_info.pinctrl,
		gspi_client->pinctrl_info.active);
	gspi_client->js_ledl_state = 0;
	mutex_unlock(&gspi_client->js_mutex);

	return size;
@@ -244,6 +248,11 @@ static ssize_t jsrequest_store(struct device *dev,
		return size;
	}

	pinctrl_select_state(
		gspi_client->pinctrl_info.pinctrl,
		gspi_client->pinctrl_info.suspend);
	gspi_client->js_ledl_state = 1;

	mutex_lock(&gspi_client->js_mutex);
	err = kstrtouint(buf, 16, &input);
	if (err) {
@@ -252,9 +261,21 @@ static ssize_t jsrequest_store(struct device *dev,
		memset(&request, 0, sizeof(request_t));
		request.requestHead.requestType =
				((input & 0x7f000000) >> 24);
		request.requestData[0] = (input & 0x000000ff);
		request.requestData[1] = (input & 0x0000ff00);
		request.requestData[2] = (input & 0x00ff0000);
		if (request.requestHead.requestType == 0xc) {
			request.requestData[0] =
					(input & 0x000000ff);
			request.requestData[1] =
					((input & 0x0000ff00) >> 8);
			request.requestData[2] =
					((input & 0x00ff0000) >> 16);
		} else {
			request.requestData[0] =
					(input & 0x000000ff);
			request.requestData[1] =
					(input & 0x0000ff00);
			request.requestData[2] =
					(input & 0x00ff0000);
		}

		switch (request.requestHead.requestType) {
		case setVibStateRequest:
@@ -285,6 +306,7 @@ static ssize_t jsrequest_store(struct device *dev,
		case getRightJoyStickProductNameRequest:
		case getLeftJoyStickFwVersionRequest:
		case getRightJoyStickFwVersionRequest:
		case setControllerSleepMode:
				atomic_set(&gspi_client->userRequest,
					input);
				atomic_inc(&gspi_client->dataflag);
@@ -466,6 +488,12 @@ static int js_thread(void *data)
				spi_client->txbuffer[2] =
					 (currentRequest.requestData[0]&0x01);
				break;
		case setControllerSleepMode:
				spi_client->txbuffer[2] =
					currentRequest.requestData[0];
				spi_client->txbuffer[3] =
					currentRequest.requestData[1];
				break;
		default:
				break;
		}
Loading